void QQuickLoaderPrivate::_q_updateSize(bool loaderGeometryChanged)
{
Q_Q(QQuickLoader);
- if (!item || updatingSize)
+ if (!item)
return;
- updatingSize = true;
-
if (loaderGeometryChanged && q->widthValid())
item->setWidth(q->width());
if (loaderGeometryChanged && q->heightValid())
item->setHeight(q->height());
+ if (updatingSize)
+ return;
+
+ updatingSize = true;
+
q->setImplicitSize(getImplicitWidth(), getImplicitHeight());
updatingSize = false;
void parented();
void sizeBound();
+ void QTBUG_30183();
private:
QQmlEngine engine;
delete root;
}
+void tst_QQuickLoader::QTBUG_30183()
+{
+ QQmlComponent component(&engine, testFileUrl("/QTBUG_30183.qml"));
+ QQuickLoader *loader = qobject_cast<QQuickLoader*>(component.create());
+ QVERIFY(loader != 0);
+ QCOMPARE(loader->width(), 240.0);
+ QCOMPARE(loader->height(), 120.0);
+
+ // the loaded item must follow the size
+ QQuickItem *rect = qobject_cast<QQuickItem*>(loader->item());
+ QVERIFY(rect);
+ QCOMPARE(rect->width(), 240.0);
+ QCOMPARE(rect->height(), 120.0);
+
+ delete loader;
+}
QTEST_MAIN(tst_QQuickLoader)