10#include <QStyleOption>
13#include <dtkwidget_global.h>
16DWIDGET_BEGIN_NAMESPACE
19class LIBDTKWIDGETSHARED_EXPORT
DSlider :
public QWidget,
public DTK_CORE_NAMESPACE::DObject
35 void setLeftIcon(
const QIcon &left);
36 void setRightIcon(
const QIcon &right);
38 void setIconSize(
const QSize &size);
40 void setMinimum(
int min);
43 void setValue(
int value);
46 void setPageStep(
int pageStep);
49 void setMaximum(
int max);
60 void setMouseWheelEnabled(
bool enabled);
62 void setTipValue(
const QString &value);
64 QSlider::TickPosition tickPosition()
const;
65 QSize sizeHint()
const override;
67 void setHandleVisible(
bool b);
68 bool handleVisible()
const;
70 void setEnabledAcrossStyle(
bool enabled);
87 bool event(
QEvent *event)
override;
96 void paintEvent(QPaintEvent *ev) {
99 QStyleOptionSlider opt;
100 initStyleOption(&opt);
102 DSlider* dSlider = qobject_cast<DSlider *>(this->parent());
108 opt.subControls = QStyle::SC_SliderGroove | QStyle::SC_SliderHandle;
110 opt.subControls = QStyle::SC_SliderGroove;
112 style()->drawComplexControl(QStyle::CC_Slider, &opt, &p, parentWidget());