diff options
author | Martin Jones <martin.jones@nokia.com> | 2012-02-16 13:45:02 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-16 06:36:38 +0100 |
commit | 990a95fa3760af233195f87281dfc354002284a0 (patch) | |
tree | 287ac2a8b5e0350b21c3d72fe763abce3dc718ff /src | |
parent | cadb17a958653fbfea31ff2f924eb0d72b3f83a1 (diff) |
Allow binding the size of a Loader to its item.
If the size of the Loader is bound to the item, the item was resized
before the binding was evaluated, resulting in an item height of 0.
This change allows bindings to the item to be evaluated before we
apply the resize logic.
Task-number: QTBUG-22628
Change-Id: I30acdb54214b422a9d4aa4e7e02a0af3674322db
Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/quick/items/qquickloader.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/quick/items/qquickloader.cpp b/src/quick/items/qquickloader.cpp index 50347f993b..92724f4095 100644 --- a/src/quick/items/qquickloader.cpp +++ b/src/quick/items/qquickloader.cpp @@ -569,12 +569,14 @@ void QQuickLoaderPrivate::incubatorStateChanged(QDeclarativeIncubator::Status st QObject *obj = incubator->object(); item = qobject_cast<QQuickItem*>(obj); if (item) { + emit q->itemChanged(); initResize(); } else { qmlInfo(q) << QQuickLoader::tr("Loader does not support loading non-visual elements."); delete itemContext; itemContext = 0; delete obj; + emit q->itemChanged(); } incubator->clear(); } else if (status == QDeclarativeIncubator::Error) { @@ -584,6 +586,7 @@ void QQuickLoaderPrivate::incubatorStateChanged(QDeclarativeIncubator::Status st itemContext = 0; delete incubator->object(); source = QUrl(); + emit q->itemChanged(); } if (loadingFromSource) emit q->sourceChanged(); @@ -591,7 +594,6 @@ void QQuickLoaderPrivate::incubatorStateChanged(QDeclarativeIncubator::Status st emit q->sourceComponentChanged(); emit q->statusChanged(); emit q->progressChanged(); - emit q->itemChanged(); emit q->loaded(); disposeInitialPropertyValues(); // cleanup } |