diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com> | 2013-01-23 14:18:28 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-01-24 09:33:42 +0100 |
commit | 57f593b96f2b1af21e7d84099d169d51f698672f (patch) | |
tree | 8ddc6ecf078bd51112edbcafe8d7e2243a130aa7 /src | |
parent | 742cff521a366e907ceddbd441b8a34101e58d01 (diff) |
Make HTML horizontal alignment work like in QtQuick 1
If the text width set is higher than the ideal width, there's
no risk of wrapping, and thus we align the text based on the
full width of the Text element. This matches the behavior in
Qt Quick 1.1.
Task-number: QTBUG-29262
Change-Id: Ib191e3dd9d17e3bea63ca7825708f53768960e26
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/quick/items/qquicktext.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/quick/items/qquicktext.cpp b/src/quick/items/qquicktext.cpp index 5a97f77e56..934451e825 100644 --- a/src/quick/items/qquicktext.cpp +++ b/src/quick/items/qquicktext.cpp @@ -527,7 +527,7 @@ void QQuickTextPrivate::updateSize() } if (internalWidthUpdate) return; - if (wrapMode != QQuickText::NoWrap && q->widthValid()) + if (q->widthValid() && (wrapMode != QQuickText::NoWrap || extra->doc->idealWidth() < q->width())) extra->doc->setTextWidth(q->width()); else extra->doc->setTextWidth(extra->doc->idealWidth()); // ### Text does not align if width is not set (QTextDoc bug) |