UI: Add SliderAbsoluteSetStyle class
When this class is used in conjunction with a QSlider control, allows direct setting of the slider handle position when clicking in an area other than the slider handle. The default QSlider handle behavior is to step towards clicked position.
This commit is contained in:
19
obs/slider-absoluteset-style.cpp
Normal file
19
obs/slider-absoluteset-style.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#include "slider-absoluteset-style.hpp"
|
||||
|
||||
SliderAbsoluteSetStyle::SliderAbsoluteSetStyle(const QString& baseStyle)
|
||||
:QProxyStyle(baseStyle)
|
||||
{
|
||||
}
|
||||
SliderAbsoluteSetStyle::SliderAbsoluteSetStyle(QStyle* baseStyle)
|
||||
:QProxyStyle(baseStyle)
|
||||
{
|
||||
}
|
||||
|
||||
int SliderAbsoluteSetStyle::styleHint(QStyle::StyleHint hint,
|
||||
const QStyleOption* option = 0, const QWidget* widget = 0,
|
||||
QStyleHintReturn* returnData = 0) const
|
||||
{
|
||||
if(hint == QStyle::SH_Slider_AbsoluteSetButtons)
|
||||
return (Qt::LeftButton | Qt::MidButton);
|
||||
return QProxyStyle::styleHint(hint, option, widget, returnData);
|
||||
}
|
Reference in New Issue
Block a user