20 #ifndef SERVUSQT_ITEMMODEL
21 #define SERVUSQT_ITEMMODEL
24 #include <servus/types.h>
27 #include <QAbstractItemModel>
63 SERVUSQT_API QModelIndex
index(
int row,
int colum,
64 const QModelIndex&
parent = QModelIndex( ))
const override;
73 SERVUSQT_API QModelIndex
parent(
const QModelIndex& index )
const override;
84 int rowCount(
const QModelIndex& index = QModelIndex( ))
const override;
92 int columnCount(
const QModelIndex& index = QModelIndex( ))
const override;
104 SERVUSQT_API QVariant
data(
const QModelIndex& index,
105 int role = Qt::DisplayRole )
const override;
115 SERVUSQT_API QVariant
headerData(
int section, Qt::Orientation orientation,
116 int role )
const override;
120 std::unique_ptr< Impl > _impl;
126 #endif // SERVUSQT_ITEMMODEL
SERVUSQT_API QModelIndex parent(const QModelIndex &index) const override
Mandatory override of QAbstractItemModel::parent.
SERVUSQT_API QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Mandatory override of QAbstractItemModel::data.
SERVUSQT_API int rowCount(const QModelIndex &index=QModelIndex()) const override
Mandatory override of QAbstractItemModel::rowCount.
An item model on top of a Servus service, to be used in a Qt item view.
Simple wrapper for ZeroConf key/value pairs.
Defines export visibility macros for library ServusQt.
SERVUSQT_API QModelIndex index(int row, int colum, const QModelIndex &parent=QModelIndex()) const override
Mandatory override of QAbstractItemModel::index.
virtual SERVUSQT_API ~ItemModel()
Destruct the model and reset the service back to non-browsing state.
SERVUSQT_API int columnCount(const QModelIndex &index=QModelIndex()) const override
Mandatory override of QAbstractItemModel::columnCount.
SERVUSQT_API ItemModel(Servus &service, QObject *parent=nullptr)
Construct a new model by filling it with the current discovered instances and put the service into br...
SERVUSQT_API QVariant headerData(int section, Qt::Orientation orientation, int role) const override
Optional override of QAbstractItemModel::headerData.