From bc363b7c4819e1e4837079d6e6489654dee7de97 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Tue, 27 Oct 2009 15:10:41 +1000 Subject: Add QFxVisualItemModel::children notify signal --- src/declarative/fx/qfxvisualitemmodel.cpp | 6 ++++++ src/declarative/fx/qfxvisualitemmodel.h | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/declarative/fx/qfxvisualitemmodel.cpp b/src/declarative/fx/qfxvisualitemmodel.cpp index e1ac246..7ee6eea 100644 --- a/src/declarative/fx/qfxvisualitemmodel.cpp +++ b/src/declarative/fx/qfxvisualitemmodel.cpp @@ -123,6 +123,10 @@ public: emit q->countChanged(); } + void emitChildrenChanged() { + Q_Q(QFxVisualItemModel); + emit q->childrenChanged(); + } ItemList children; }; @@ -224,6 +228,8 @@ void QFxVisualItemModelPrivate::ItemList::append(QFxItem *item) QmlConcreteList::append(item); item->QObject::setParent(model->q_ptr); model->itemAppended(); + + model->emitChildrenChanged(); } QFxVisualItemModelAttached *QFxVisualItemModel::qmlAttachedProperties(QObject *obj) diff --git a/src/declarative/fx/qfxvisualitemmodel.h b/src/declarative/fx/qfxvisualitemmodel.h index 5b613d8..8e33279 100644 --- a/src/declarative/fx/qfxvisualitemmodel.h +++ b/src/declarative/fx/qfxvisualitemmodel.h @@ -108,7 +108,7 @@ class Q_DECLARATIVE_EXPORT QFxVisualItemModel : public QFxVisualModel Q_OBJECT Q_DECLARE_PRIVATE(QFxVisualItemModel) - Q_PROPERTY(QmlList* children READ children DESIGNABLE false) + Q_PROPERTY(QmlList* children READ children NOTIFY childrenChanged DESIGNABLE false) Q_CLASSINFO("DefaultProperty", "children") public: @@ -128,6 +128,9 @@ public: static QFxVisualItemModelAttached *qmlAttachedProperties(QObject *obj); +signals: + void childrenChanged(); + private: Q_DISABLE_COPY(QFxVisualItemModel) }; -- cgit v0.12