diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2009-11-06 05:33:45 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2009-11-06 05:33:45 (GMT) |
commit | 37aef8c7d55d3f5bf036d66613e87f89fcd9b897 (patch) | |
tree | 23dd69005c6026cc1123d0915228c9dbd76211c1 /tests | |
parent | 426e3aaf155267f14eb205cc97837256508a9a9a (diff) | |
download | Qt-37aef8c7d55d3f5bf036d66613e87f89fcd9b897.zip Qt-37aef8c7d55d3f5bf036d66613e87f89fcd9b897.tar.gz Qt-37aef8c7d55d3f5bf036d66613e87f89fcd9b897.tar.bz2 |
Fix crash when using anchors inside a positioner.
Task-number: QTBUG-5428
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/declarative/anchors/data/crash1.qml | 11 | ||||
-rw-r--r-- | tests/auto/declarative/anchors/tst_anchors.cpp | 15 |
2 files changed, 26 insertions, 0 deletions
diff --git a/tests/auto/declarative/anchors/data/crash1.qml b/tests/auto/declarative/anchors/data/crash1.qml new file mode 100644 index 0000000..fd9dc55 --- /dev/null +++ b/tests/auto/declarative/anchors/data/crash1.qml @@ -0,0 +1,11 @@ +import Qt 4.6 + +Column { + Text { + text: "foo" + anchors.fill: parent + } + Text { + text: "bar" + } +} diff --git a/tests/auto/declarative/anchors/tst_anchors.cpp b/tests/auto/declarative/anchors/tst_anchors.cpp index c3a857c..4c85d2d 100644 --- a/tests/auto/declarative/anchors/tst_anchors.cpp +++ b/tests/auto/declarative/anchors/tst_anchors.cpp @@ -62,6 +62,7 @@ private slots: void illegalSets(); void reset(); void nullItem(); + void crash1(); }; /* @@ -248,6 +249,20 @@ void tst_anchors::nullItem() item->anchors()->setBottom(anchor); } +void tst_anchors::crash1() +{ + QmlView *view = new QmlView; + + view->setUrl(QUrl("file://" SRCDIR "/data/crash1.qml")); + + QString expect = "QML QmlGraphicsText (" + view->url().toString() + ":4:5" + ") Possible anchor loop detected on fill."; + QTest::ignoreMessage(QtWarningMsg, expect.toLatin1()); + view->execute(); + qApp->processEvents(); + + delete view; +} + QTEST_MAIN(tst_anchors) #include "tst_anchors.moc" |