diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-08-02 11:47:32 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-08-02 11:47:32 (GMT) |
commit | e393c706e1e8d9004ac3dc855b6e33327523a137 (patch) | |
tree | 047074617b22314418786e87bb7adbe6c371bed1 /tests | |
parent | 02d3230a6b569e848bdae30ac2184613aade64ff (diff) | |
parent | cf5d8a23241c31d8a49c78ffb1e3f6ae288eb585 (diff) | |
download | Qt-e393c706e1e8d9004ac3dc855b6e33327523a137.zip Qt-e393c706e1e8d9004ac3dc855b6e33327523a137.tar.gz Qt-e393c706e1e8d9004ac3dc855b6e33327523a137.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-qml:
Ensure currentItem is released when the delegate changes
State doc fixes, improvements
Make sure ListView.nextSection attached property is set for the first item
Correctly apply PropertyChanges when entering an extended state
Update QtGui def files
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/declarative/qdeclarativestates/data/extendsBug.qml | 26 | ||||
-rw-r--r-- | tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp | 16 |
2 files changed, 42 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativestates/data/extendsBug.qml b/tests/auto/declarative/qdeclarativestates/data/extendsBug.qml new file mode 100644 index 0000000..a3c4827 --- /dev/null +++ b/tests/auto/declarative/qdeclarativestates/data/extendsBug.qml @@ -0,0 +1,26 @@ +import Qt 4.7 + +Rectangle { + width: 200 + height: 200 + + Rectangle { + id: rect + objectName: "greenRect" + width: 100 + height: 100 + color: "green" + } + + states:[ + State { + name: "a" + PropertyChanges { target: rect; x: 100 } + }, + State { + name: "b" + extend:"a" + PropertyChanges { target: rect; y: 100 } + } + ] +} diff --git a/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp index 3b6a420..6ae2759 100644 --- a/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp +++ b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp @@ -139,6 +139,7 @@ private slots: void urlResolution(); void unnamedWhen(); void returnToBase(); + void extendsBug(); }; void tst_qdeclarativestates::initTestCase() @@ -1186,6 +1187,21 @@ void tst_qdeclarativestates::returnToBase() QCOMPARE(rect->property("stateString").toString(), QLatin1String("originalState")); } +//QTBUG-12559 +void tst_qdeclarativestates::extendsBug() +{ + QDeclarativeEngine engine; + + QDeclarativeComponent c(&engine, SRCDIR "/data/extendsBug.qml"); + QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create()); + QVERIFY(rect != 0); + QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect); + QDeclarativeRectangle *greenRect = rect->findChild<QDeclarativeRectangle*>("greenRect"); + + rectPrivate->setState("b"); + QCOMPARE(greenRect->x(), qreal(100)); + QCOMPARE(greenRect->y(), qreal(100)); +} QTEST_MAIN(tst_qdeclarativestates) |