diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2009-07-08 09:19:23 (GMT) |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2009-07-17 17:44:47 (GMT) |
commit | 11abe2114aca5bc07d797680550d08ce268ff353 (patch) | |
tree | 1a28f436050e5740f82c04cfd50b72e03abfedc0 /src/gui/styles | |
parent | 5539b4ab311501821eb0e971432d769a25000032 (diff) | |
download | Qt-11abe2114aca5bc07d797680550d08ce268ff353.zip Qt-11abe2114aca5bc07d797680550d08ce268ff353.tar.gz Qt-11abe2114aca5bc07d797680550d08ce268ff353.tar.bz2 |
optimize painting of dithered disabled text
no need to calculate the bounding rect twice
Reviewed-by: jbache
Diffstat (limited to 'src/gui/styles')
-rw-r--r-- | src/gui/styles/qstyle.cpp | 5 |
1 files 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(); |