QAbstractSpinBox css: properly honor spincontrol-disable-on-bounds

The css style 'spincontrol-disable-on-bounds' was not properly honored
within QAbstractSpinBox::initStyleOption() because the affected widget
was not passed to QStyle::styleHint(). Therefore QStyleSheetStyle did
not find the correct render rule.
Fix it by passing 'this' as third argument to QStyle::styleHint().

Fixes: QTBUG-18008
Change-Id: Iabcebf0b83143f45309b4e7066bccb8d20bd0419
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
This commit is contained in:
Christian Ehrlicher 2019-09-20 22:27:44 +02:00
parent 1d1ed01711
commit 70c053ee68

View File

@ -1726,7 +1726,7 @@ void QAbstractSpinBox::initStyleOption(QStyleOptionSpinBox *option) const
option->activeSubControls = d->hoverControl;
}
option->stepEnabled = style()->styleHint(QStyle::SH_SpinControls_DisableOnBounds)
option->stepEnabled = style()->styleHint(QStyle::SH_SpinControls_DisableOnBounds, nullptr, this)
? stepEnabled()
: (QAbstractSpinBox::StepDownEnabled|QAbstractSpinBox::StepUpEnabled);