aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@live.com>2013-11-06 22:05:52 -0600
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-12-02 22:27:41 +0100
commitf7fc7e1a7f36485642c5c44af31a67986f006cf8 (patch)
tree3851493218540aa5a6cade704bfbdb13be228110 /src/quick
parent7c7665bbd6609d5c0ee7abd635e37c626b60802b (diff)
Ensure correct horizontal alignment when onLineLaidOut is used.
Task-number: QTBUG-34647 Change-Id: I07cb1f6f433d64c8889750a1fef06cd3b3bcc9e5 Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
Diffstat (limited to 'src/quick')
-rw-r--r--src/quick/items/qquicktext.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/quick/items/qquicktext.cpp b/src/quick/items/qquicktext.cpp
index d62bf8efa1..bde9637ea0 100644
--- a/src/quick/items/qquicktext.cpp
+++ b/src/quick/items/qquicktext.cpp
@@ -669,8 +669,9 @@ void QQuickTextPrivate::setupCustomLineGeometry(QTextLine &line, qreal &height,
textLine->setHeight(0);
textLine->setLineOffset(lineOffset);
- // use the text item's width by default if it has one and wrap is on
- if (q->widthValid() && q->wrapMode() != QQuickText::NoWrap)
+ // use the text item's width by default if it has one and wrap is on or text must be aligned
+ if (q->widthValid() && (q->wrapMode() != QQuickText::NoWrap ||
+ q->effectiveHAlign() != QQuickText::AlignLeft))
textLine->setWidth(q->width());
else
textLine->setWidth(INT_MAX);