Core: Set the SH_Slider_AbsoluteSetButtons style for QSlider

This way when the user clicks on the slider with the mouse the slider
jumps under the mouse and not left and right according to the slider
page.

Change-Id: If36f9d8ea82f5b200e2322758f4fc25aef5e1a04
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Cristian Adam
2023-09-19 18:57:09 +02:00
parent 7de97c7a7f
commit 957fa89315

View File

@@ -442,6 +442,10 @@ int ManhattanStyle::styleHint(StyleHint hint, const QStyleOption *option, const
ret = QGuiApplication::keyboardModifiers() ret = QGuiApplication::keyboardModifiers()
== (HostOsInfo::isMacHost() ? Qt::MetaModifier : Qt::ControlModifier); == (HostOsInfo::isMacHost() ? Qt::MetaModifier : Qt::ControlModifier);
break; break;
case QStyle::SH_Slider_AbsoluteSetButtons:
// Make QSlider jump on left mouse click
ret = Qt::LeftButton | Qt::MiddleButton | Qt::RightButton;
break;
default: default:
break; break;
} }