Changeset View
Changeset View
Standalone View
Standalone View
bitbutton.h
Show All 30 Lines | 30 | public: | |||
---|---|---|---|---|---|
31 | explicit BitButton(QWidget *parent = nullptr); | 31 | explicit BitButton(QWidget *parent = nullptr); | ||
32 | bool isOn() const; | 32 | bool isOn() const; | ||
33 | void setOn(bool value); | 33 | void setOn(bool value); | ||
34 | 34 | | |||
35 | protected: | 35 | protected: | ||
36 | void paintEvent(QPaintEvent *event) override; | 36 | void paintEvent(QPaintEvent *event) override; | ||
37 | 37 | | |||
38 | private: | 38 | private: | ||
39 | void enterEvent(QEvent * event) override; | ||||
40 | void leaveEvent(QEvent * event) override; | ||||
39 | bool on_; | 41 | bool on_; | ||
42 | bool over_; | ||||
40 | }; | 43 | }; | ||
41 | 44 | | |||
42 | #endif | 45 | #endif |