aboutsummaryrefslogtreecommitdiffstats
path: root/tests/manual/scenegraph_lancelot/data
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>2013-01-24 10:28:19 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-01-24 14:14:49 +0100
commitdde265294fb8c48f9e0dce95d2287482ef0c0c6b (patch)
treeb125366e921b2fb22a44a804e4384313aef8f98b /tests/manual/scenegraph_lancelot/data
parentc5fb0a9d8a7eedaed0c4ecfe354219a9d252062f (diff)
Fix alignment of Text element with implicit size
In change e1d6b323d474acc5cd70fd9a0b283326316f55a0 there's an optimization which disables layouts on the QTextDocument, but the layout has to be re-enabled before we can call idealWidth() since this will be zero as long as the page size is 0x0. We simply set the page size to undefined again before calling idealWidth. Task-number: QTBUG-29262 Change-Id: I6bebe7be4c99fce0de8fc4178b5e1abc81abbe87 Reviewed-by: Michael Brasser <michael.brasser@live.com> Reviewed-by: aavit <eirik.aavitsland@digia.com>
Diffstat (limited to 'tests/manual/scenegraph_lancelot/data')
-rw-r--r--tests/manual/scenegraph_lancelot/data/text/text_html_center_tag.qml35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/manual/scenegraph_lancelot/data/text/text_html_center_tag.qml b/tests/manual/scenegraph_lancelot/data/text/text_html_center_tag.qml
new file mode 100644
index 0000000000..86b528f0a4
--- /dev/null
+++ b/tests/manual/scenegraph_lancelot/data/text/text_html_center_tag.qml
@@ -0,0 +1,35 @@
+import QtQuick 2.0
+
+Item {
+ width: 320
+ height: 480
+
+ Text {
+ id: implicitSizedText
+ textFormat: Text.RichText
+ text: "<center>Implicit size<br>----- Second line -----</center>"
+ anchors.centerIn: parent
+ color: "white"
+
+ Rectangle {
+ anchors.fill: parent
+ z: -1
+ color: "blue"
+ }
+ }
+ Text {
+ textFormat: Text.RichText
+ text: "<center>Explicit size<br>----- Second line -----</center>"
+ anchors.top: implicitSizedText.bottom
+ anchors.topMargin: 10
+ anchors.horizontalCenter: parent.horizontalCenter
+ width: 300
+ color: "white"
+
+ Rectangle {
+ anchors.fill: parent
+ z: -1
+ color: "blue"
+ }
+ }
+}