From 7d2d897eca62d70943a8e7c3aba99336f368e19f Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Fri, 15 Jan 2010 13:07:09 +0100 Subject: 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. --- src/gui/text/qstatictext.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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(); -- cgit v0.12