summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-01-15 12:07:09 (GMT)
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-01-15 12:07:09 (GMT)
commit7d2d897eca62d70943a8e7c3aba99336f368e19f (patch)
tree6196ab97f6eae9360447e1b3cbbddd60a0ace266 /src
parent9ec5972b3d7b972e74f6d7504d81d062ccdd863d (diff)
downloadQt-7d2d897eca62d70943a8e7c3aba99336f368e19f.zip
Qt-7d2d897eca62d70943a8e7c3aba99336f368e19f.tar.gz
Qt-7d2d897eca62d70943a8e7c3aba99336f368e19f.tar.bz2
Fix crash when wrapping text
The two runs (counting the number of items and then storing the information) needs to be identical, so they need to have the same text flags set. Otherwise we would count more items than we actually generated and crash later when we tried to access an uninitialized item.
Diffstat (limited to 'src')
-rw-r--r--src/gui/text/qstatictext.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/text/qstatictext.cpp b/src/gui/text/qstatictext.cpp
index 85d3c81..79f8aa5 100644
--- a/src/gui/text/qstatictext.cpp
+++ b/src/gui/text/qstatictext.cpp
@@ -484,7 +484,7 @@ void QStaticTextPrivate::init()
if (size.isValid()) {
QRectF boundingRect;
- painter.drawText(QRectF(QPointF(0, 0), size), 0, text, &boundingRect);
+ painter.drawText(QRectF(QPointF(0, 0), size), Qt::TextWordWrap, text, &boundingRect);
needsClipRect = boundingRect.width() > size.width()
|| boundingRect.height() > size.height();