diff options
Diffstat (limited to 'src/qml/types/qqmlobjectmodel_p.h')
-rw-r--r-- | src/qml/types/qqmlobjectmodel_p.h | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/qml/types/qqmlobjectmodel_p.h b/src/qml/types/qqmlobjectmodel_p.h index 4c37a5ac30..f6ab2a19e2 100644 --- a/src/qml/types/qqmlobjectmodel_p.h +++ b/src/qml/types/qqmlobjectmodel_p.h @@ -61,7 +61,7 @@ public: virtual ReleaseFlags release(QObject *object) = 0; virtual void cancel(int) {} virtual QString stringValue(int, const QString &) = 0; - virtual void setWatchedRoles(QList<QByteArray> roles) = 0; + virtual void setWatchedRoles(const QList<QByteArray> &roles) = 0; virtual int indexOf(QObject *object, QObject *objectContext) const = 0; @@ -99,7 +99,7 @@ public: virtual QObject *object(int index, bool asynchronous=false); virtual ReleaseFlags release(QObject *object); virtual QString stringValue(int index, const QString &role); - virtual void setWatchedRoles(QList<QByteArray>) {} + virtual void setWatchedRoles(const QList<QByteArray> &) {} virtual int indexOf(QObject *object, QObject *objectContext) const; @@ -107,6 +107,15 @@ public: static QQmlObjectModelAttached *qmlAttachedProperties(QObject *obj); + Q_REVISION(3) Q_INVOKABLE QObject *get(int index) const; + Q_REVISION(3) Q_INVOKABLE void append(QObject *object); + Q_REVISION(3) Q_INVOKABLE void insert(int index, QObject *object); + Q_REVISION(3) Q_INVOKABLE void move(int from, int to, int n = 1); + Q_REVISION(3) Q_INVOKABLE void remove(int index, int n = 1); + +public Q_SLOTS: + Q_REVISION(3) void clear(); + Q_SIGNALS: void childrenChanged(); @@ -120,7 +129,7 @@ class QQmlObjectModelAttached : public QObject public: QQmlObjectModelAttached(QObject *parent) - : QObject(parent), m_index(0) {} + : QObject(parent), m_index(-1) {} ~QQmlObjectModelAttached() { attachedProperties.remove(parent()); } |