aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@digia.com>2013-03-13 18:31:57 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-03-17 14:59:49 +0100
commitb7032bed6799c72ef8d89e5763586349b6991b93 (patch)
tree430d515fe675b33f246db368eb8ceae4bb1795ac /tests
parentd0af156930f80c7133b0190765d21b12a3d4a76a (diff)
QQuickLoader: fix the recursion guard for size updates
Task-number: QTBUG-30183 Change-Id: Ic8720e1e35bf2f349d74d2021dd202849da67852 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com> Reviewed-by: Caroline Chao <caroline.chao@digia.com> Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/quick/qquickloader/data/QTBUG_30183.qml12
-rw-r--r--tests/auto/quick/qquickloader/tst_qquickloader.cpp17
2 files changed, 29 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickloader/data/QTBUG_30183.qml b/tests/auto/quick/qquickloader/data/QTBUG_30183.qml
new file mode 100644
index 0000000000..1f626d969f
--- /dev/null
+++ b/tests/auto/quick/qquickloader/data/QTBUG_30183.qml
@@ -0,0 +1,12 @@
+import QtQuick 2.0
+
+Loader {
+ width: implicitWidth
+ height: implicitHeight
+
+ sourceComponent: Rectangle {
+ color: "green"
+ implicitWidth: 240
+ implicitHeight: 120
+ }
+}
diff --git a/tests/auto/quick/qquickloader/tst_qquickloader.cpp b/tests/auto/quick/qquickloader/tst_qquickloader.cpp
index d01e8aae52..50ded4d95a 100644
--- a/tests/auto/quick/qquickloader/tst_qquickloader.cpp
+++ b/tests/auto/quick/qquickloader/tst_qquickloader.cpp
@@ -126,6 +126,7 @@ private slots:
void parented();
void sizeBound();
+ void QTBUG_30183();
private:
QQmlEngine engine;
@@ -1126,6 +1127,22 @@ void tst_QQuickLoader::sizeBound()
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)