2016-03-22 14:16:49 +00:00
|
|
|
#ifndef SLIDER_H
|
|
|
|
#define SLIDER_H
|
|
|
|
|
2016-04-03 17:08:26 +00:00
|
|
|
#include <QAbstractSlider>
|
2016-05-01 19:56:39 +00:00
|
|
|
#include <QScopedPointer>
|
2016-03-23 05:35:41 +00:00
|
|
|
|
2016-05-12 09:49:46 +00:00
|
|
|
#define SLIDER_MARGIN 30
|
|
|
|
|
2016-05-01 19:56:39 +00:00
|
|
|
class SliderPrivate;
|
2016-03-22 15:05:02 +00:00
|
|
|
|
2016-04-03 17:08:26 +00:00
|
|
|
class Slider : public QAbstractSlider
|
2016-03-22 14:16:49 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit Slider(QWidget *parent = 0);
|
|
|
|
~Slider();
|
2016-03-22 15:05:02 +00:00
|
|
|
|
2016-05-10 14:17:51 +00:00
|
|
|
QSize minimumSizeHint() const Q_DECL_OVERRIDE;
|
2016-05-04 22:34:16 +00:00
|
|
|
|
2016-05-09 20:32:16 +00:00
|
|
|
int thumbOffset() const;
|
|
|
|
|
2016-05-10 14:17:51 +00:00
|
|
|
void setPageStepMode(bool pageStep);
|
|
|
|
bool pageStepMode() const;
|
2016-05-09 20:32:16 +00:00
|
|
|
|
2016-05-12 11:19:59 +00:00
|
|
|
bool hovered() const;
|
2016-05-11 17:26:19 +00:00
|
|
|
|
2016-03-22 15:05:02 +00:00
|
|
|
protected:
|
2016-05-09 20:32:16 +00:00
|
|
|
void sliderChange(SliderChange change) Q_DECL_OVERRIDE;
|
2016-05-01 20:21:48 +00:00
|
|
|
void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
|
2016-05-01 23:22:43 +00:00
|
|
|
void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
|
2016-05-03 05:48:43 +00:00
|
|
|
void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
|
2016-05-02 20:57:57 +00:00
|
|
|
void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
|
2016-05-12 06:37:30 +00:00
|
|
|
void leaveEvent(QEvent *event) Q_DECL_OVERRIDE;
|
2016-05-01 20:21:48 +00:00
|
|
|
|
2016-05-01 19:56:39 +00:00
|
|
|
const QScopedPointer<SliderPrivate> d_ptr;
|
2016-05-01 12:13:37 +00:00
|
|
|
|
|
|
|
private:
|
2016-05-01 19:56:39 +00:00
|
|
|
Q_DISABLE_COPY(Slider)
|
|
|
|
Q_DECLARE_PRIVATE(Slider)
|
2016-03-22 14:16:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // SLIDER_H
|