Commit aac46537 authored by Thomas BOUTROUE's avatar Thomas BOUTROUE

Make functions invokable in FastObjectListModel

parent deda0ea4
Pipeline #981 passed with stage
in 9 seconds
...@@ -14,10 +14,11 @@ public: ...@@ -14,10 +14,11 @@ public:
explicit QQmlFastObjectListModelBase (QObject * parent = Q_NULLPTR) : QObject { parent } { } explicit QQmlFastObjectListModelBase (QObject * parent = Q_NULLPTR) : QObject { parent } { }
virtual ~QQmlFastObjectListModelBase (void) { } virtual ~QQmlFastObjectListModelBase (void) { }
virtual int getCount (void) const { return 0; } Q_INVOKABLE virtual int getCount (void) const { return 0; }
virtual QObject * getFirstItem (void) const { return Q_NULLPTR; } Q_INVOKABLE virtual bool getContains (QObject *) const { return false; }
virtual QObject * getLastItem (void) const { return Q_NULLPTR; } Q_INVOKABLE virtual QObject * getFirstItem (void) const { return Q_NULLPTR; }
virtual QObject * getItem (const int) const { return Q_NULLPTR; } Q_INVOKABLE virtual QObject * getLastItem (void) const { return Q_NULLPTR; }
Q_INVOKABLE virtual QObject * getItem (const int) const { return Q_NULLPTR; }
signals: signals:
void countChanged (void); void countChanged (void);
...@@ -150,6 +151,9 @@ protected: // API for QQuickFastObjectListView only ...@@ -150,6 +151,9 @@ protected: // API for QQuickFastObjectListView only
int getCount (void) const Q_DECL_FINAL { int getCount (void) const Q_DECL_FINAL {
return count (); return count ();
} }
bool getContains (QObject * item) const Q_DECL_FINAL {
return contains (qobject_cast<T *> (item));
}
QObject * getItem (const int idx) const Q_DECL_FINAL { QObject * getItem (const int idx) const Q_DECL_FINAL {
return getAt (idx); return getAt (idx);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment