universallistmodelbase.h 726 B

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