28 #ifndef IPconnectionOPTIONSPAGE_H
29 #define IPconnectionOPTIONSPAGE_H
32 #include <QStyledItemDelegate>
33 #include <QAbstractTableModel>
43 class IPconnectionOptionsPage;
57 QString
id()
const {
return QLatin1String(
"settings"); }
58 QString
trName()
const {
return tr(
"settings"); }
59 QString
category()
const {
return "IP Network Telemetry"; };
60 QString
trCategory()
const {
return "IP Network Telemetry"; };
62 QWidget *createPage(QWidget *parent);
66 enum Columns { ColumnProtocol = 0, ColumnHostname, ColumnPort, ColumnCount };
69 void availableDevChanged();
74 Ui::IPconnectionOptionsPage *m_page;
84 : QStyledItemDelegate(parent)
88 QWidget *createEditor(QWidget *parent,
const QStyleOptionViewItem &option,
89 const QModelIndex &index)
const override;
90 void setEditorData(QWidget *editor,
const QModelIndex &index)
const override;
91 void setModelData(QWidget *editor, QAbstractItemModel *model,
92 const QModelIndex &index)
const override;
93 void updateEditorGeometry(QWidget *editor,
const QStyleOptionViewItem &option,
94 const QModelIndex &index)
const override;
103 : QAbstractTableModel(parent)
107 int rowCount(
const QModelIndex &parent = QModelIndex())
const;
108 int columnCount(
const QModelIndex &parent = QModelIndex())
const;
109 QVariant
data(
const QModelIndex &index,
int role = Qt::EditRole)
const;
110 QVariant headerData(
int section, Qt::Orientation orientation,
int role = Qt::DisplayRole)
const;
111 Qt::ItemFlags flags(
const QModelIndex &index)
const;
112 bool setData(
const QModelIndex &index,
const QVariant &value,
int role = Qt::EditRole);
113 bool insertRows(
int position,
int rows,
const QModelIndex &index = QModelIndex());
114 bool removeRows(
int position,
int rows,
const QModelIndex &index = QModelIndex());
116 QVector<IPConnectionConfiguration::Host> &
hosts() {
return m_hosts; }
119 QVector<IPConnectionConfiguration::Host> m_hosts;
122 #endif // IPconnectionOPTIONSPAGE_H
IPConnectionOptionsModel(QObject *parent=nullptr)
QString trCategory() const
IPConnectionOptionsDelegate(QObject *parent=nullptr)
void setData(const DataFields &data)
QVector< IPConnectionConfiguration::Host > & hosts()
The IOptionsPage is an interface for providing options pages.