QWindows11Style: Default PE_IndicatorRadioButton to selected/unselected
In case there is no valid QStyleOption::styleObject, default the PE_IndicatorRadioButton to the selected and unselected appearances. Fixes: QTBUG-132906 Pick-to: 6.9 6.8 Change-Id: I5e9c13cb3384321e025e5af08ee3dab81feb07fe Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
This commit is contained in:
parent
dee731ae98
commit
b717945812
@ -854,14 +854,14 @@ void QWindows11Style::drawPrimitive(PrimitiveElement element, const QStyleOption
|
||||
break;
|
||||
case PE_IndicatorRadioButton:
|
||||
{
|
||||
if (option->styleObject->property("_q_end_radius").isNull())
|
||||
option->styleObject->setProperty("_q_end_radius", option->state & State_On ? 4.0f :7.0f);
|
||||
QNumberStyleAnimation* animation = qobject_cast<QNumberStyleAnimation*>(d->animation(option->styleObject));
|
||||
if (animation != nullptr)
|
||||
option->styleObject->setProperty("_q_inner_radius", animation->currentValue());
|
||||
else
|
||||
option->styleObject->setProperty("_q_inner_radius", option->styleObject->property("_q_end_radius"));
|
||||
int innerRadius = option->styleObject->property("_q_inner_radius").toFloat();
|
||||
qreal innerRadius = option->state & State_On ? 4.0f :7.0f;
|
||||
if (option->styleObject) {
|
||||
if (option->styleObject->property("_q_end_radius").isNull())
|
||||
option->styleObject->setProperty("_q_end_radius", innerRadius);
|
||||
QNumberStyleAnimation *animation = qobject_cast<QNumberStyleAnimation *>(d->animation(option->styleObject));
|
||||
innerRadius = animation ? animation->currentValue() : option->styleObject->property("_q_end_radius").toFloat();
|
||||
option->styleObject->setProperty("_q_inner_radius", innerRadius);
|
||||
}
|
||||
|
||||
QPainterPath path;
|
||||
QRectF rect = option->rect;
|
||||
|
Loading…
x
Reference in New Issue
Block a user