summaryrefslogtreecommitdiffstats
path: root/src/declarative/fx
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/fx')
-rw-r--r--src/declarative/fx/qfxrepeater.cpp22
-rw-r--r--src/declarative/fx/qfxrepeater.h5
2 files changed, 24 insertions, 3 deletions
diff --git a/src/declarative/fx/qfxrepeater.cpp b/src/declarative/fx/qfxrepeater.cpp
index 5ef7b10..f887060 100644
--- a/src/declarative/fx/qfxrepeater.cpp
+++ b/src/declarative/fx/qfxrepeater.cpp
@@ -154,15 +154,15 @@ void QFxRepeater::setModel(const QVariant &model)
{
Q_D(QFxRepeater);
clear();
- /*
if (d->model) {
disconnect(d->model, SIGNAL(itemsInserted(int,int)), this, SLOT(itemsInserted(int,int)));
disconnect(d->model, SIGNAL(itemsRemoved(int,int)), this, SLOT(itemsRemoved(int,int)));
disconnect(d->model, SIGNAL(itemsMoved(int,int,int)), this, SLOT(itemsMoved(int,int,int)));
+ /*
disconnect(d->model, SIGNAL(createdItem(int, QFxItem*)), this, SLOT(createdItem(int,QFxItem*)));
disconnect(d->model, SIGNAL(destroyingItem(QFxItem*)), this, SLOT(destroyingItem(QFxItem*)));
- }
*/
+ }
d->dataSource = model;
QObject *object = qvariant_cast<QObject*>(model);
QFxVisualModel *vim = 0;
@@ -181,10 +181,10 @@ void QFxRepeater::setModel(const QVariant &model)
dataModel->setModel(model);
}
if (d->model) {
- /*
connect(d->model, SIGNAL(itemsInserted(int,int)), this, SLOT(itemsInserted(int,int)));
connect(d->model, SIGNAL(itemsRemoved(int,int)), this, SLOT(itemsRemoved(int,int)));
connect(d->model, SIGNAL(itemsMoved(int,int,int)), this, SLOT(itemsMoved(int,int,int)));
+ /*
connect(d->model, SIGNAL(createdItem(int, QFxItem*)), this, SLOT(createdItem(int,QFxItem*)));
connect(d->model, SIGNAL(destroyingItem(QFxItem*)), this, SLOT(destroyingItem(QFxItem*)));
*/
@@ -304,4 +304,20 @@ void QFxRepeater::regenerate()
foreach(QGraphicsItem* other, otherChildren)
other->setParentItem(parentItem());
}
+
+void QFxRepeater::itemsInserted(int, int)
+{
+ regenerate();
+}
+
+void QFxRepeater::itemsRemoved(int, int)
+{
+ regenerate();
+}
+
+void QFxRepeater::itemsMoved(int,int,int)
+{
+ regenerate();
+}
+
QT_END_NAMESPACE
diff --git a/src/declarative/fx/qfxrepeater.h b/src/declarative/fx/qfxrepeater.h
index 7d64d86..7a0318b 100644
--- a/src/declarative/fx/qfxrepeater.h
+++ b/src/declarative/fx/qfxrepeater.h
@@ -84,6 +84,11 @@ protected:
QVariant itemChange(GraphicsItemChange change, const QVariant &value);
QFxRepeater(QFxRepeaterPrivate &dd, QFxItem *parent);
+private Q_SLOTS:
+ void itemsInserted(int,int);
+ void itemsRemoved(int,int);
+ void itemsMoved(int,int,int);
+
private:
Q_DISABLE_COPY(QFxRepeater)
Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QFxRepeater)