From 11abe2114aca5bc07d797680550d08ce268ff353 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 8 Jul 2009 11:19:23 +0200 Subject: optimize painting of dithered disabled text no need to calculate the bounding rect twice Reviewed-by: jbache --- src/gui/styles/qstyle.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/styles/qstyle.cpp b/src/gui/styles/qstyle.cpp index d47c610..a5ab80e 100644 --- a/src/gui/styles/qstyle.cpp +++ b/src/gui/styles/qstyle.cpp @@ -526,8 +526,9 @@ void QStyle::drawItemText(QPainter *painter, const QRect &rect, int alignment, c } if (!enabled) { if (styleHint(SH_DitherDisabledText)) { - painter->drawText(rect, alignment, text); - painter->fillRect(painter->boundingRect(rect, alignment, text), QBrush(painter->background().color(), Qt::Dense5Pattern)); + QRect br; + painter->drawText(rect, alignment, text, &br); + painter->fillRect(br, QBrush(painter->background().color(), Qt::Dense5Pattern)); return; } else if (styleHint(SH_EtchDisabledText)) { QPen pen = painter->pen(); -- cgit v0.12