universallistmodelbase.h 664 B

123456789101112131415161718192021222324
  1. #pragma once
  2. #include <QAbstractListModel>
  3. /*!
  4. * \brief The UniversalListModelBase class to make possible properties definition for UniversalListModel
  5. * This class should not be used as is, but leaves this possibility.
  6. */
  7. class UniversalListModelBase : public QAbstractListModel
  8. {
  9. Q_OBJECT
  10. Q_PROPERTY(int count READ count NOTIFY countChanged)
  11. public:
  12. explicit UniversalListModelBase(QObject *parent = nullptr);
  13. /*!
  14. * \brief count property that declares row count of UniversalListModel
  15. * \return
  16. */
  17. virtual int count() const = 0;
  18. Q_INVOKABLE virtual void remove(int valueIndex) = 0;
  19. signals:
  20. void countChanged();
  21. };