blob: f65c4402639581626f526cf9729c89d59d217911 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
#ifndef CLICKABLELABEL
#define CLICKABLELABEL
#include <qlabel.h>
class OClickableLabel: public QLabel
{
Q_OBJECT
public:
OClickableLabel(QWidget* parent = 0, const char* name = 0,
WFlags fl = 0);
void setToggleButton(bool t);
protected:
void mousePressEvent( QMouseEvent *e );
void mouseReleaseEvent( QMouseEvent *e );
void mouseMoveEvent( QMouseEvent *e );
public slots:
void setOn(bool on);
signals:
void clicked();
void toggled(bool on);
private:
bool isToggle;
bool isDown;
void showState(bool on);
bool textInverted;
void setInverted(bool on);
};
#endif
|