diff options
author | Martin Jones <martin.jones@nokia.com> | 2010-09-08 05:27:08 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2010-09-08 05:27:08 (GMT) |
commit | aafc407fc3efaf6a7ee8f96623fc59857c7bc2a8 (patch) | |
tree | b547124820ce5f893d67fa2015db56e923d4cbea /tests | |
parent | 56776c574a4af02cfa529095a757b80adfb7d189 (diff) | |
download | Qt-aafc407fc3efaf6a7ee8f96623fc59857c7bc2a8.zip Qt-aafc407fc3efaf6a7ee8f96623fc59857c7bc2a8.tar.gz Qt-aafc407fc3efaf6a7ee8f96623fc59857c7bc2a8.tar.bz2 |
Don't cause repaints during painting in Text element
Calling prepareGeometryChange in a paint event is a bad idea and was
causing jerky scrolling. There is no longer any need for the removed
code since we don't use imgCache.size() to determine boundingRect()
anymore.
Task-number: QTBUG-13453
Reviewed-by: Joona Petrell
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp b/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp index 658f381..f683d98 100644 --- a/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp +++ b/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp @@ -608,6 +608,17 @@ void tst_qdeclarativetext::style() QCOMPARE((int)textObject->style(), (int)styles.at(i)); QCOMPARE(textObject->styleColor(), QColor("white")); } + QString componentStr = "import Qt 4.7\nText { text: \"Hello World\" }"; + QDeclarativeComponent textComponent(&engine); + textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); + QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create()); + + QRectF brPre = textObject->boundingRect(); + textObject->setStyle(QDeclarativeText::Outline); + QRectF brPost = textObject->boundingRect(); + + QVERIFY(brPre.width() < brPost.width()); + QVERIFY(brPre.height() < brPost.height()); } void tst_qdeclarativetext::color() |