diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2010-01-15 12:07:09 (GMT) |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2010-01-15 12:07:09 (GMT) |
commit | 7d2d897eca62d70943a8e7c3aba99336f368e19f (patch) | |
tree | 6196ab97f6eae9360447e1b3cbbddd60a0ace266 /src/gui/text/qstatictext.cpp | |
parent | 9ec5972b3d7b972e74f6d7504d81d062ccdd863d (diff) | |
download | Qt-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/gui/text/qstatictext.cpp')
-rw-r--r-- | src/gui/text/qstatictext.cpp | 2 |
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(); |