diff options
author | Martin Jones <martin.jones@nokia.com> | 2011-12-07 11:20:25 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-12-07 07:18:55 +0100 |
commit | 3bb47f45ebf1f2a5dc26067c762f30b15f2308c4 (patch) | |
tree | b68cb40de89a7999fe7ee35cead36de819568c01 /tests/auto/qtquick2/qquicktext | |
parent | d052d2f569324f9a5416ee69ad60d4d4ded84ad3 (diff) |
Avoid Text layout being triggered unnecessarily
Text was quite often layed out twice during construction due to
geometry changes, and often at run time due to other geometry changes.
This change checks for cases which do not require relayouting and
drops out early. These are easier to detect than trying to have a
single giant if statement covering all the positive combinations.
Change-Id: I2deb2ab52d35b3d02bced698d05fef91c9e2f745
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Diffstat (limited to 'tests/auto/qtquick2/qquicktext')
-rw-r--r-- | tests/auto/qtquick2/qquicktext/tst_qquicktext.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/auto/qtquick2/qquicktext/tst_qquicktext.cpp b/tests/auto/qtquick2/qquicktext/tst_qquicktext.cpp index 60e8571a47..09e7b9c577 100644 --- a/tests/auto/qtquick2/qquicktext/tst_qquicktext.cpp +++ b/tests/auto/qtquick2/qquicktext/tst_qquicktext.cpp @@ -634,6 +634,8 @@ void tst_qquicktext::horizontalAlignment_RightToLeft() QQuickTextPrivate *textPrivate = QQuickTextPrivate::get(text); QVERIFY(textPrivate != 0); + QTRY_VERIFY(textPrivate->layout.lineCount()); + // implicit alignment should follow the reading direction of RTL text QCOMPARE(text->hAlign(), QQuickText::AlignRight); QCOMPARE(text->effectiveHAlign(), text->hAlign()); @@ -1453,6 +1455,8 @@ void tst_qquicktext::lineLaidOut() QVERIFY(r.height() == 20); } } + + delete canvas; } QTEST_MAIN(tst_qquicktext) |