mirror of
https://github.com/crystalidea/qt-build-tools.git
synced 2024-11-23 03:10:06 +08:00
5.15.7: fix for QTBUG-98093 (backport QSlider: Always set the sunken state and the active control, c7e8133a95
)
This commit is contained in:
parent
031f5beb48
commit
4117ef5166
@ -153,6 +153,13 @@ void QSlider::initStyleOption(QStyleOptionSlider *option) const
|
|||||||
option->pageStep = d->pageStep;
|
option->pageStep = d->pageStep;
|
||||||
if (d->orientation == Qt::Horizontal)
|
if (d->orientation == Qt::Horizontal)
|
||||||
option->state |= QStyle::State_Horizontal;
|
option->state |= QStyle::State_Horizontal;
|
||||||
|
|
||||||
|
if (d->pressedControl) {
|
||||||
|
option->activeSubControls = d->pressedControl;
|
||||||
|
option->state |= QStyle::State_Sunken;
|
||||||
|
} else {
|
||||||
|
option->activeSubControls = d->hoverControl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QSliderPrivate::updateHoverControl(const QPoint &pos)
|
bool QSliderPrivate::updateHoverControl(const QPoint &pos)
|
||||||
@ -315,12 +322,6 @@ void QSlider::paintEvent(QPaintEvent *)
|
|||||||
opt.subControls = QStyle::SC_SliderGroove | QStyle::SC_SliderHandle;
|
opt.subControls = QStyle::SC_SliderGroove | QStyle::SC_SliderHandle;
|
||||||
if (d->tickPosition != NoTicks)
|
if (d->tickPosition != NoTicks)
|
||||||
opt.subControls |= QStyle::SC_SliderTickmarks;
|
opt.subControls |= QStyle::SC_SliderTickmarks;
|
||||||
if (d->pressedControl) {
|
|
||||||
opt.activeSubControls = d->pressedControl;
|
|
||||||
opt.state |= QStyle::State_Sunken;
|
|
||||||
} else {
|
|
||||||
opt.activeSubControls = d->hoverControl;
|
|
||||||
}
|
|
||||||
|
|
||||||
style()->drawComplexControl(QStyle::CC_Slider, &opt, &p, this);
|
style()->drawComplexControl(QStyle::CC_Slider, &opt, &p, this);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user