From 279562172d2e998e910d82599255cb04b54df823 Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Tue, 15 May 2012 20:02:53 +0300 Subject: enable the text layout's cache where it is seems to be missed e.g. in QStaticText, the data is used just to get the line's y-position and re-calculates just after the loop to determine the bounding rect and to draw the text; in QWidgetLineControl, the data re-calculated over and over while the result is seems to remain the same; probably the caching is needed here too Change-Id: I0f7eb291532f63eccb9c5f749daebb73ff90632f Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/qstatictext.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/gui/text/qstatictext.cpp') diff --git a/src/gui/text/qstatictext.cpp b/src/gui/text/qstatictext.cpp index 5bee2a9915..faee6d2b76 100644 --- a/src/gui/text/qstatictext.cpp +++ b/src/gui/text/qstatictext.cpp @@ -610,6 +610,7 @@ void QStaticTextPrivate::paintText(const QPointF &topLeftPosition, QPainter *p) textLayout.setText(text); textLayout.setFont(font); textLayout.setTextOption(textOption); + textLayout.setCacheEnabled(true); qreal leading = QFontMetricsF(font).leading(); qreal height = -leading; -- cgit v1.2.3