summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles/qfusionstyle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/styles/qfusionstyle.cpp')
-rw-r--r--src/widgets/styles/qfusionstyle.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/widgets/styles/qfusionstyle.cpp b/src/widgets/styles/qfusionstyle.cpp
index 3bffd7873f..8da21a2e11 100644
--- a/src/widgets/styles/qfusionstyle.cpp
+++ b/src/widgets/styles/qfusionstyle.cpp
@@ -1590,7 +1590,7 @@ void QFusionStyle::drawControl(ControlElement element, const QStyleOption *optio
(option->styleObject && option->styleObject->property("_q_isComboBoxPopupItem").toBool()))
ignoreCheckMark = true; //ignore the checkmarks provided by the QComboMenuDelegate
- if (!ignoreCheckMark) {
+ if (!ignoreCheckMark || menuItem->state & (State_On | State_Off)) {
// Check, using qreal and QRectF to avoid error accumulation
const qreal boxMargin = dpiScaled(3.5, option);
const qreal boxWidth = checkcol - 2 * boxMargin;
@@ -1601,7 +1601,7 @@ void QFusionStyle::drawControl(ControlElement element, const QStyleOption *optio
if (checkable) {
if (menuItem->checkType & QStyleOptionMenuItem::Exclusive) {
// Radio button
- if (checked || sunken) {
+ if (menuItem->state & State_On || checked || sunken) {
painter->setRenderHint(QPainter::Antialiasing);
painter->setPen(Qt::NoPen);
@@ -1617,8 +1617,10 @@ void QFusionStyle::drawControl(ControlElement element, const QStyleOption *optio
QStyleOptionButton box;
box.QStyleOption::operator=(*option);
box.rect = checkRect;
- if (checked)
+ if (checked || menuItem->state & State_On)
box.state |= State_On;
+ else
+ box.state |= State_Off;
proxy()->drawPrimitive(PE_IndicatorCheckBox, &box, painter, widget);
}
}
@@ -2411,7 +2413,7 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption
int oldMin = styleObject->property("_q_stylemin").toInt();
int oldMax = styleObject->property("_q_stylemax").toInt();
QRect oldRect = styleObject->property("_q_stylerect").toRect();
- QStyle::State oldState = static_cast<QStyle::State>(styleObject->property("_q_stylestate").value<QStyle::State::Int>());
+ QStyle::State oldState = static_cast<QStyle::State>(qvariant_cast<QStyle::State::Int>(styleObject->property("_q_stylestate")));
uint oldActiveControls = styleObject->property("_q_stylecontrols").toUInt();
// a scrollbar is transient when the the scrollbar itself and
@@ -3684,7 +3686,7 @@ int QFusionStyle::styleHint(StyleHint hint, const QStyleOption *option, const QW
return 0;
case SH_Table_GridLineColor:
- return option ? option->palette.window().color().darker(120).rgb() : 0;
+ return option ? option->palette.window().color().darker(120).rgba() : 0;
case SH_MessageBox_TextInteractionFlags:
return Qt::TextSelectableByMouse | Qt::LinksAccessibleByMouse;