diff options
author | Stephen Kelly <stephen.kelly@kdab.com> | 2012-07-02 17:11:18 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-07-04 15:51:50 +0200 |
commit | 648d5964ee38b7ec6795c2397dd8dfcd0036656e (patch) | |
tree | 25112b73b5cb8f19fac3df49a8f725b962402b6a /src/corelib/itemmodels/qabstractproxymodel.h | |
parent | e3a9ac4f369859f67fe4be2bf4a3617484e83962 (diff) |
Add a Q_PROPERTY for the sourceModel of a proxy model.
Now that Q_PROPERTY with a QObject derived type is more powerful.
This property can be used in QML so that wrappers for proxy models
do not need to be created, such as in the example
at https://codereview.qt-project.org/#change,13007
Change-Id: I6ba676549d2135585d429a28e214fef0b2a6b1f9
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib/itemmodels/qabstractproxymodel.h')
-rw-r--r-- | src/corelib/itemmodels/qabstractproxymodel.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/corelib/itemmodels/qabstractproxymodel.h b/src/corelib/itemmodels/qabstractproxymodel.h index d80fcb683c..4dcbdfda50 100644 --- a/src/corelib/itemmodels/qabstractproxymodel.h +++ b/src/corelib/itemmodels/qabstractproxymodel.h @@ -57,6 +57,7 @@ class QItemSelection; class Q_CORE_EXPORT QAbstractProxyModel : public QAbstractItemModel { Q_OBJECT + Q_PROPERTY(QAbstractItemModel* sourceModel READ sourceModel WRITE setSourceModel NOTIFY sourceModelChanged) public: explicit QAbstractProxyModel(QObject *parent = 0); @@ -94,6 +95,9 @@ public: QStringList mimeTypes() const; Qt::DropActions supportedDropActions() const; +Q_SIGNALS: + void sourceModelChanged(); + protected: QAbstractProxyModel(QAbstractProxyModelPrivate &, QObject *parent); |