graphlistmodel.h 635 B

1234567891011121314151617181920212223242526272829303132
  1. #ifndef GRAPHLISTMODEL_H
  2. #define GRAPHLISTMODEL_H
  3. #include <universallistmodel.h>
  4. #include <graphpoint.h>
  5. #include <QPointer>
  6. class GraphListModel : public UniversalListModel<GraphPoint>
  7. {
  8. Q_OBJECT
  9. Q_PROPERTY(int count READ count NOTIFY countChanged)
  10. public:
  11. GraphListModel(QObject* parent = 0);
  12. QList<QPointer<GraphPoint> > container() const {
  13. return m_container;
  14. }
  15. Q_INVOKABLE GraphPoint* at(int i) const {
  16. return m_container.at(i).data();
  17. }
  18. int count() const {
  19. return m_container.count();
  20. }
  21. signals:
  22. void countChanged(int count);
  23. };
  24. #endif // GRAPHLISTMODEL_H