diff options
author | J-P Nurmi <jpnurmi@theqtcompany.com> | 2015-09-08 15:52:05 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@theqtcompany.com> | 2015-09-09 20:41:31 +0000 |
commit | 8a0135b82e9b354fe5304144a12c850c248f2a79 (patch) | |
tree | 4d1a0fd87d387bc9ea076780d8f2afbdfa193f0a /src/controls | |
parent | 945c59f42fd1ab171df90b137ca40286120364f7 (diff) |
Add QQuickContainer::contentChildrenChanged() notifier
Makes possible to bind contentChildren to ExclusiveGroup::checkables.
Change-Id: Idf9afabb93f78b012d2ca5c77fe79f34bf76e584
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'src/controls')
-rw-r--r-- | src/controls/qquickcontainer.cpp | 1 | ||||
-rw-r--r-- | src/controls/qquickcontainer_p.h | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/controls/qquickcontainer.cpp b/src/controls/qquickcontainer.cpp index 5138dc95..20b900a2 100644 --- a/src/controls/qquickcontainer.cpp +++ b/src/controls/qquickcontainer.cpp @@ -57,6 +57,7 @@ void QQuickContainerPrivate::init() Q_Q(QQuickContainer); contentModel = new QQmlObjectModel(q); QObject::connect(contentModel, &QQmlObjectModel::countChanged, q, &QQuickContainer::countChanged); + QObject::connect(contentModel, &QQmlObjectModel::childrenChanged, q, &QQuickContainer::contentChildrenChanged); } void QQuickContainerPrivate::cleanup() diff --git a/src/controls/qquickcontainer_p.h b/src/controls/qquickcontainer_p.h index 22fa059a..8fe35faf 100644 --- a/src/controls/qquickcontainer_p.h +++ b/src/controls/qquickcontainer_p.h @@ -61,7 +61,7 @@ class Q_QUICKCONTROLS_EXPORT QQuickContainer : public QQuickControl Q_PROPERTY(int count READ count NOTIFY countChanged FINAL) Q_PROPERTY(QVariant contentModel READ contentModel CONSTANT FINAL) Q_PROPERTY(QQmlListProperty<QObject> contentData READ contentData FINAL) - Q_PROPERTY(QQmlListProperty<QQuickItem> contentChildren READ contentChildren FINAL) + Q_PROPERTY(QQmlListProperty<QQuickItem> contentChildren READ contentChildren NOTIFY contentChildrenChanged FINAL) Q_CLASSINFO("DefaultProperty", "contentData") public: @@ -81,6 +81,7 @@ public: Q_SIGNALS: void countChanged(); + void contentChildrenChanged(); protected: QQuickContainer(QQuickContainerPrivate &dd, QQuickItem *parent); |