diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2009-11-03 10:24:02 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2009-11-03 10:27:04 (GMT) |
commit | a3b84f683e0baae34dc37c85a40dcae3e5306419 (patch) | |
tree | f3a80a0e23bdb0a9708713b3fe85fde3fa4c4e58 /src/gui/styles/qstylesheetstyle.cpp | |
parent | 553d7f7416eca57b63992a453ceb3b333749c11a (diff) | |
download | Qt-a3b84f683e0baae34dc37c85a40dcae3e5306419.zip Qt-a3b84f683e0baae34dc37c85a40dcae3e5306419.tar.gz Qt-a3b84f683e0baae34dc37c85a40dcae3e5306419.tar.bz2 |
QStyleSheetStyle: CE_PushButton Do not call the parent style if we have nothing to draw
This fixes the focus rect that appears on buttons with GtkStyle if a
stylesheet is used.
Task-number: QTBUG-4488
Reviewed-by: Gabriel
Diffstat (limited to 'src/gui/styles/qstylesheetstyle.cpp')
-rw-r--r-- | src/gui/styles/qstylesheetstyle.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/gui/styles/qstylesheetstyle.cpp b/src/gui/styles/qstylesheetstyle.cpp index a224218..dfe5209 100644 --- a/src/gui/styles/qstylesheetstyle.cpp +++ b/src/gui/styles/qstylesheetstyle.cpp @@ -3325,9 +3325,14 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q break; case CE_PushButton: - ParentStyle::drawControl(ce, opt, p, w); - return; - + if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) { + if (rule.hasDrawable() || rule.hasBox() || rule.hasPosition() || rule.hasPalette() || + ((btn->features & QStyleOptionButton::HasMenu) && hasStyleRule(w, PseudoElement_PushButtonMenuIndicator))) { + ParentStyle::drawControl(ce, opt, p, w); + return; + } + } + break; case CE_PushButtonBevel: if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) { QStyleOptionButton btnOpt(*btn); |