summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2016-10-04 12:41:47 +0200
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2016-10-04 14:30:13 +0000
commit4d552815cf370c0d5abbbeb50ff1350b449e7bb2 (patch)
tree120722bc61931f7c5054b76e50d617ead2f4da12 /src/gui
parentf3d19244cd8cc09d643dc74e0476ff8e975a7054 (diff)
Fix plain text QStaticText with line breaks
The layout isn't actually created until endLayout() or setLineWidth() is called. So in the case where this was not done, the height of the line would be 0, thus multiple lines would be placed on top of each other, at y == 0. [ChangeLog][QtGui][Text] Fixed QStaticText when manually breaking lines and no text width was set. Task-number: QTBUG-56346 Change-Id: I7f6ed6260545882f05fe39b21134315eca7401b9 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/text/qstatictext.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gui/text/qstatictext.cpp b/src/gui/text/qstatictext.cpp
index a10071490e..dbc2e6e558 100644
--- a/src/gui/text/qstatictext.cpp
+++ b/src/gui/text/qstatictext.cpp
@@ -622,6 +622,8 @@ void QStaticTextPrivate::paintText(const QPointF &topLeftPosition, QPainter *p)
if (textWidth >= 0.0)
line.setLineWidth(textWidth);
+ else
+ line.setLineWidth(QFIXED_MAX);
height += leading;
line.setPosition(QPointF(0.0, height));
height += line.height();