30#include "qwt_global.h"
31#include "qwt_abstract_slider.h"
59 Q_PROPERTY( Qt::Orientation orientation
60 READ orientation WRITE setOrientation )
62 WRITE setScalePosition )
64 Q_PROPERTY(
bool trough READ hasTrough WRITE setTrough )
65 Q_PROPERTY(
bool groove READ hasGroove WRITE setGroove )
67 Q_PROPERTY( QSize handleSize READ handleSize WRITE setHandleSize )
68 Q_PROPERTY(
int borderWidth READ borderWidth WRITE setBorderWidth )
69 Q_PROPERTY(
int spacing READ spacing WRITE setSpacing )
96 explicit QwtSlider( QWidget* parent =
nullptr );
98 explicit QwtSlider( Qt::Orientation, QWidget* parent =
nullptr );
104 void setOrientation( Qt::Orientation );
106 Qt::Orientation orientation()
const;
109 void setScalePosition( ScalePosition );
111 ScalePosition scalePosition()
const;
114 void setTrough(
bool );
116 bool hasTrough()
const;
119 void setGroove(
bool );
121 bool hasGroove()
const;
124 void setHandleSize(
const QSize& );
126 QSize handleSize()
const;
129 void setBorderWidth(
int );
131 int borderWidth()
const;
134 void setSpacing(
int );
139 virtual QSize sizeHint()
const override;
141 virtual QSize minimumSizeHint()
const override;
149 void setUpdateInterval(
int );
151 int updateInterval()
const;
155 virtual double scrolledTo(
const QPoint& )
const override;
160 virtual void drawSlider ( QPainter*,
const QRect& )
const;
162 virtual void drawHandle( QPainter*,
const QRect&,
int pos )
const;
169 virtual void resizeEvent( QResizeEvent* )
override;
171 virtual void paintEvent ( QPaintEvent* )
override;
175 virtual void timerEvent( QTimerEvent* )
override;
178 virtual bool event( QEvent* )
override;
184 QRect sliderRect()
const;
186 QRect handleRect()
const;
193 void layoutSlider(
bool );
195 void initSlider( Qt::Orientation );
virtual void changeEvent(QEvent *) override
Handle change events (English only)
Definition qwt_abstract_scale.cpp:670
带刻度的滑块控件的抽象基类
Definition qwt_abstract_slider.h:57
virtual void scaleChange() override
Handle scale changes (English only)
Definition qwt_abstract_slider.cpp:1007
virtual void mouseReleaseEvent(QMouseEvent *) override
Handle mouse release events (English only)
Definition qwt_abstract_slider.cpp:351
virtual void mousePressEvent(QMouseEvent *) override
Handle mouse press events (English only)
Definition qwt_abstract_slider.cpp:270
virtual bool isScrollPosition(const QPoint &pos) const =0
确定当用户按下鼠标按钮时该做什么
virtual double scrolledTo(const QPoint &pos) const =0
确定滑块可移动部分新位置的值
用于绘制刻度的类
Definition qwt_scale_draw.h:62
滑块控件
Definition qwt_slider.h:54
ScalePosition
刻度位置
Definition qwt_slider.h:84
@ LeadingScale
The scale is right of a vertical or below a horizontal slider
Definition qwt_slider.h:89
@ NoScale
The slider has no scale
Definition qwt_slider.h:86