diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-10-27 05:10:41 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-10-27 05:10:41 (GMT) |
commit | bc363b7c4819e1e4837079d6e6489654dee7de97 (patch) | |
tree | b914470884c40c8da6d7e5eab6f54018369df0ae /src/declarative | |
parent | 7a0f9e754f76b052bf1474ec7c1d5f59b774de54 (diff) | |
download | Qt-bc363b7c4819e1e4837079d6e6489654dee7de97.zip Qt-bc363b7c4819e1e4837079d6e6489654dee7de97.tar.gz Qt-bc363b7c4819e1e4837079d6e6489654dee7de97.tar.bz2 |
Add QFxVisualItemModel::children notify signal
Diffstat (limited to 'src/declarative')
-rw-r--r-- | src/declarative/fx/qfxvisualitemmodel.cpp | 6 | ||||
-rw-r--r-- | src/declarative/fx/qfxvisualitemmodel.h | 5 |
2 files changed, 10 insertions, 1 deletions
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<QFxItem*>::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<QFxItem *>* children READ children DESIGNABLE false) + Q_PROPERTY(QmlList<QFxItem *>* 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) }; |