From 8a0135b82e9b354fe5304144a12c850c248f2a79 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 8 Sep 2015 15:52:05 +0200 Subject: Add QQuickContainer::contentChildrenChanged() notifier Makes possible to bind contentChildren to ExclusiveGroup::checkables. Change-Id: Idf9afabb93f78b012d2ca5c77fe79f34bf76e584 Reviewed-by: Mitch Curtis --- src/controls/qquickcontainer.cpp | 1 + src/controls/qquickcontainer_p.h | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'src/controls') 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 contentData READ contentData FINAL) - Q_PROPERTY(QQmlListProperty contentChildren READ contentChildren FINAL) + Q_PROPERTY(QQmlListProperty 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); -- cgit v1.2.3