blob: dd930bdff11a4b3fa20c43350357947ad403b169 (
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
#ifndef __OPIE_OLED_H__
#define __OPIE_OLED_H__
#include <qwidget.h>
#include <qcolor.h>
class QPixmap;
#define _QTE_IS_TOO_DUMB_TO_DRAW_AN_ARC
class OLedBox : public QWidget {
Q_OBJECT
public:
OLedBox ( const QColor &col = red, QWidget *parent = 0, const char *name = 0 );
virtual ~OLedBox ( );
QColor color ( ) const;
bool isOn ( ) const;
void setReadOnly( bool R )
{ m_readonly = R; }
inline bool readOnly( void ) const
{ return m_readonly; }
virtual QSize sizeHint ( ) const;
public slots:
void toggle ( );
void setOn ( bool on );
void setColor ( const QColor &col );
signals:
void toggled ( bool );
protected:
virtual void paintEvent ( QPaintEvent *e );
virtual void resizeEvent ( QResizeEvent *e );
virtual void mousePressEvent ( QMouseEvent *e );
private:
void drawLed ( QPixmap *, const QColor &col );
private:
QPixmap *m_pix [2];
QColor m_color;
bool m_on;
bool m_readonly;
#ifdef _QTE_IS_TOO_DUMB_TO_DRAW_AN_ARC
static QPixmap *s_border_pix;
#endif
};
#endif
|