diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-04-28 04:32:28 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-04-28 04:32:28 (GMT) |
commit | a6ffd7c7c28066f2794579bc40e7b9517e76d1ff (patch) | |
tree | 1188f96a9c6e49c71c02f1ee0aab71a443f9a232 /src/declarative/fx/qfxrepeater.cpp | |
parent | c8daf2ac917a90a54db780e8844a770a2cd0b464 (diff) | |
download | Qt-a6ffd7c7c28066f2794579bc40e7b9517e76d1ff.zip Qt-a6ffd7c7c28066f2794579bc40e7b9517e76d1ff.tar.gz Qt-a6ffd7c7c28066f2794579bc40e7b9517e76d1ff.tar.bz2 |
Delay Repeater item construction until component completion
The engine can crash if objects with bindings or parser status's are created and
destroyed before a component complete. This works around this limitation, that
should ideally be fixed in the engine.
Diffstat (limited to 'src/declarative/fx/qfxrepeater.cpp')
-rw-r--r-- | src/declarative/fx/qfxrepeater.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/declarative/fx/qfxrepeater.cpp b/src/declarative/fx/qfxrepeater.cpp index ad4081b..78e9f51 100644 --- a/src/declarative/fx/qfxrepeater.cpp +++ b/src/declarative/fx/qfxrepeater.cpp @@ -235,6 +235,15 @@ void QFxRepeater::setComponent(QmlComponent *_c) /*! \internal */ +void QFxRepeater::componentComplete() +{ + QFxItem::componentComplete(); + regenerate(); +} + +/*! + \internal + */ void QFxRepeater::parentChanged(QSimpleCanvasItem *o, QSimpleCanvasItem *n) { QFxItem::parentChanged(o, n); @@ -250,7 +259,7 @@ void QFxRepeater::regenerate() qDeleteAll(d->deletables); d->deletables.clear(); - if(!d->component || !itemParent()) + if(!d->component || !itemParent() || !isComponentComplete()) return; QFxItem *lastItem = this; |