diff options
author | Joona Petrell <joona.t.petrell@nokia.com> | 2010-12-17 06:18:03 (GMT) |
---|---|---|
committer | Joona Petrell <joona.t.petrell@nokia.com> | 2010-12-17 06:22:30 (GMT) |
commit | e0abcb2ff7a3044305580659f9a432a9630a5943 (patch) | |
tree | ddb96bb810d47aadafff1e50ebe960358376110f /tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp | |
parent | 632016368e26ba06d7d09740a8a1805f4ea911f1 (diff) | |
download | Qt-e0abcb2ff7a3044305580659f9a432a9630a5943.zip Qt-e0abcb2ff7a3044305580659f9a432a9630a5943.tar.gz Qt-e0abcb2ff7a3044305580659f9a432a9630a5943.tar.bz2 |
Fix QDeclarativeState::reset() autotest
Current state reset mechanism does not really work for Text elements as the keeping implicit correct would require relayouting of text twice (See bug QTBUG-15118). Changed QDeclarativeState reset autotest to use Image element instead of Text element until the issue has been fixed.
Task-number:
Reviewed-by: Yann Bodson
Diffstat (limited to 'tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp')
-rw-r--r-- | tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp index b8409a5..870842c 100644 --- a/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp +++ b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp @@ -44,7 +44,6 @@ #include <private/qdeclarativeanchors_p_p.h> #include <private/qdeclarativerectangle_p.h> #include <private/qdeclarativeimage_p.h> -#include <private/qdeclarativetext_p.h> #include <private/qdeclarativepropertychanges_p.h> #include <private/qdeclarativestategroup_p.h> #include <private/qdeclarativeitem_p.h> @@ -1126,15 +1125,15 @@ void tst_qdeclarativestates::reset() QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create()); QVERIFY(rect != 0); - QDeclarativeText *text = rect->findChild<QDeclarativeText*>(); - QVERIFY(text != 0); - QCOMPARE(text->width(), qreal(40.)); - QVERIFY(text->width() < text->height()); + QDeclarativeImage *image = rect->findChild<QDeclarativeImage*>(); + QVERIFY(image != 0); + QCOMPARE(image->width(), qreal(40.)); + QCOMPARE(image->height(), qreal(20.)); QDeclarativeItemPrivate::get(rect)->setState("state1"); - QVERIFY(text->width() > 41); - QVERIFY(text->width() > text->height()); + QCOMPARE(image->width(), 20.0); + QCOMPARE(image->height(), qreal(20.)); } void tst_qdeclarativestates::illegalObjectCreation() |