qt-material-widgets/components/slider.h

54 lines
1.2 KiB
C
Raw Normal View History

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-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
2016-05-09 20:32:16 +00:00
Q_PROPERTY(qreal thumbSize WRITE setThumbSize READ thumbSize)
Q_PROPERTY(qreal thumbPenWidth WRITE setThumbPenWidth READ thumbPenWidth)
Q_PROPERTY(QColor thumbColor WRITE setThumbColor READ thumbColor)
2016-05-04 22:34:16 +00:00
2016-03-22 14:16:49 +00:00
public:
explicit Slider(QWidget *parent = 0);
~Slider();
2016-03-22 15:05:02 +00:00
2016-05-09 20:32:16 +00:00
QSize minimumSizeHint() const;
2016-05-04 22:34:16 +00:00
2016-05-09 20:32:16 +00:00
int thumbOffset() const;
void setThumbSize(qreal size);
qreal thumbSize() const;
void setThumbPenWidth(qreal width);
qreal thumbPenWidth() const;
void setThumbColor(const QColor &color);
QColor thumbColor() const;
signals:
void changedToMinimum();
void changedFromMinimum();
2016-05-01 21:10:31 +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-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