Index: sources/model/MListModel.h =================================================================== diff -u -r8c7b9550b05f223be9d094e850e06f9ed80adb70 -rbae1ae230d8b41f90b1fcd34b9bccdfa87bf3cd9 --- sources/model/MListModel.h (.../MListModel.h) (revision 8c7b9550b05f223be9d094e850e06f9ed80adb70) +++ sources/model/MListModel.h (.../MListModel.h) (revision bae1ae230d8b41f90b1fcd34b9bccdfa87bf3cd9) @@ -17,9 +17,12 @@ { Q_OBJECT + Q_PROPERTY(int count READ rowCount NOTIFY countChanged STORED false) + public: - explicit MListModel(QObject *parent = nullptr) : QAbstractListModel (parent) { } + explicit MListModel(QObject *parent = nullptr); + void insertRow (const int pos, const QHash &vData ); QHash roleNames ( ) const override; int rowCount (const QModelIndex & = QModelIndex() ) const override; QVariant data (const QModelIndex &vIndex, int vRole = Qt::DisplayRole ) const override; @@ -28,9 +31,12 @@ void setRoleNames(const QHash& vRoleNames ); MListModel &operator = (const QList> &src ); -public slots: +public Q_SLOTS: QVariantMap get (int vRow ) const; // Exposed to QML +Q_SIGNALS: + void countChanged(); + private: QList> _data; QHash _roleNames;