diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2009-11-04 10:41:31 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2009-11-04 10:58:47 (GMT) |
commit | e1a81c96790bee72ee4fbd2b0c4a7b48078c4ec1 (patch) | |
tree | 0a58eaca795605e57096a4667f8e22fbd0b66f9b /src/gui | |
parent | 2747f200ce27599af74f01cb629ec8930bae7b44 (diff) | |
download | Qt-e1a81c96790bee72ee4fbd2b0c4a7b48078c4ec1.zip Qt-e1a81c96790bee72ee4fbd2b0c4a7b48078c4ec1.tar.gz Qt-e1a81c96790bee72ee4fbd2b0c4a7b48078c4ec1.tar.bz2 |
Fixes StyleSheets: Incorrect display of custom style to QComboBox
Two problem:
- When QWindowsStyle draw CC_ComboBox, it does not save/restor the
painter, whilt it does modify the pen and the brush.
- QStyleSheetStyle CE_ComboBoxLabel did not specify the palette role
to paint the text with, leaving the one from the palette
Task-number: QTBUG-3974
Reviewed-by: Gabriel
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/styles/qstylesheetstyle.cpp | 2 | ||||
-rw-r--r-- | src/gui/styles/qwindowsstyle.cpp | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/styles/qstylesheetstyle.cpp b/src/gui/styles/qstylesheetstyle.cpp index dfe5209..e61658b 100644 --- a/src/gui/styles/qstylesheetstyle.cpp +++ b/src/gui/styles/qstylesheetstyle.cpp @@ -3675,7 +3675,7 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q } if (!cb->currentText.isEmpty() && !cb->editable) { drawItemText(p, editRect.adjusted(0, 0, 0, 0), Qt::AlignLeft | Qt::AlignVCenter, cb->palette, - cb->state & State_Enabled, cb->currentText); + cb->state & State_Enabled, cb->currentText, QPalette::Text); } p->restore(); return; diff --git a/src/gui/styles/qwindowsstyle.cpp b/src/gui/styles/qwindowsstyle.cpp index 5cf738e..abce4d2 100644 --- a/src/gui/styles/qwindowsstyle.cpp +++ b/src/gui/styles/qwindowsstyle.cpp @@ -2994,6 +2994,7 @@ void QWindowsStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComp #ifndef QT_NO_COMBOBOX case CC_ComboBox: if (const QStyleOptionComboBox *cmb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) { + p->save(); QBrush editBrush = cmb->palette.brush(QPalette::Base); if ((cmb->subControls & SC_ComboBoxFrame)) { if (cmb->frame) { @@ -3063,6 +3064,7 @@ void QWindowsStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComp proxy()->drawPrimitive(PE_FrameFocusRect, &focus, p, widget); } } + p->restore(); } break; #endif // QT_NO_COMBOBOX |