Changeset View
Changeset View
Standalone View
Standalone View
examples/demo/colorslider.h
Show All 28 Lines | 26 | { | |||
---|---|---|---|---|---|
29 | Q_PROPERTY( QColor endColor READ endColor WRITE setStartColor NOTIFY endColorChanged ) | 29 | Q_PROPERTY( QColor endColor READ endColor WRITE setStartColor NOTIFY endColorChanged ) | ||
30 | public: | 30 | public: | ||
31 | explicit ColorSlider( QWidget *parent = nullptr ); | 31 | explicit ColorSlider( QWidget *parent = nullptr ); | ||
32 | ~ColorSlider(); | 32 | ~ColorSlider(); | ||
33 | QColor startColor() const; | 33 | QColor startColor() const; | ||
34 | void setStartColor( const QColor &color ); | 34 | void setStartColor( const QColor &color ); | ||
35 | QColor endColor() const; | 35 | QColor endColor() const; | ||
36 | void setEndColor( const QColor &color ); | 36 | void setEndColor( const QColor &color ); | ||
37 | QSize sizeHint() const Q_DECL_OVERRIDE; | 37 | QSize sizeHint() const override; | ||
38 | 38 | | |||
39 | protected: | 39 | protected: | ||
40 | void paintEvent( QPaintEvent *event ) Q_DECL_OVERRIDE; | 40 | void paintEvent( QPaintEvent *event ) override; | ||
41 | void mousePressEvent(QMouseEvent *event ) Q_DECL_OVERRIDE; | 41 | void mousePressEvent(QMouseEvent *event ) override; | ||
42 | void mouseReleaseEvent(QMouseEvent *event ) Q_DECL_OVERRIDE; | 42 | void mouseReleaseEvent(QMouseEvent *event ) override; | ||
43 | void mouseMoveEvent( QMouseEvent *event ) Q_DECL_OVERRIDE; | 43 | void mouseMoveEvent( QMouseEvent *event ) override; | ||
44 | 44 | | |||
45 | Q_SIGNALS: | 45 | Q_SIGNALS: | ||
46 | void startColorChanged(); | 46 | void startColorChanged(); | ||
47 | void endColorChanged(); | 47 | void endColorChanged(); | ||
48 | 48 | | |||
49 | public Q_SLOTS: | 49 | public Q_SLOTS: | ||
50 | private: | 50 | private: | ||
51 | class Private; | 51 | class Private; | ||
52 | Private *d; | 52 | Private *d; | ||
53 | 53 | | |||
54 | }; | 54 | }; | ||
55 | 55 | | |||
56 | #endif // COLORSLIDER_H | 56 | #endif // COLORSLIDER_H |