summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-07-21 04:16:34 (GMT)
committerToby Tomkins <toby.tomkins@nokia.com>2010-07-26 06:24:18 (GMT)
commit26a1acf139f7a444bc68d9a1540d418c41aa89ec (patch)
tree2943aee398fab53819db821c2cd3d4781820758d /tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp
parent19835bd63a99e1b71b80f68fac249f4d207975ec (diff)
downloadQt-26a1acf139f7a444bc68d9a1540d418c41aa89ec.zip
Qt-26a1acf139f7a444bc68d9a1540d418c41aa89ec.tar.gz
Qt-26a1acf139f7a444bc68d9a1540d418c41aa89ec.tar.bz2
Bounding rect of text was not always calculated correctly.
The boundingRect depended upon the image cache which may not become valid until after boundingRect is called. Task-number: QTBUG-12291 Reviewed-by: Michael Brasser (cherry picked from commit 3aeafb4839f49f524f10eae65be27fd189d37060)
Diffstat (limited to 'tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp')
-rw-r--r--tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp b/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp
index 821394d..658f381 100644
--- a/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp
+++ b/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp
@@ -97,6 +97,8 @@ private slots:
void clickLink();
+ void QTBUG_12291();
+
private:
QStringList standard;
QStringList richText;
@@ -898,6 +900,23 @@ void tst_qdeclarativetext::wordSpacing()
}
}
+void tst_qdeclarativetext::QTBUG_12291()
+{
+ QDeclarativeView *canvas = createView(SRCDIR "/data/rotated.qml");
+
+ canvas->show();
+ QApplication::setActiveWindow(canvas);
+ QTest::qWaitForWindowShown(canvas);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(canvas));
+
+ QObject *ob = canvas->rootObject();
+ QVERIFY(ob != 0);
+
+ QDeclarativeText *text = ob->findChild<QDeclarativeText*>("text");
+ QVERIFY(text);
+ QVERIFY(text->boundingRect().isValid());
+}
+
class EventSender : public QGraphicsItem
{
public: