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
|
#include "kledbutton.h"
#include <tqsizepolicy.h>
KLedButton::KLedButton( const TQColor &col, TQWidget *parent, const char *name )
: KLed( col, parent, name )
{
}
KLedButton::KLedButton( const TQColor &col, KLed::State st, KLed::Look look,
KLed::Shape shape, TQWidget *parent, const char *name )
: KLed( col, st, look, shape, parent, name )
{
}
void KLedButton::mousePressEvent( TQMouseEvent *e )
{
if ( e->button() == TQt::LeftButton ) {
toggle();
emit stateChanged( state() == KLed::On );
}
}
TQSize KLedButton::sizeHint() const { return TQSize( 22, 22 ); }
TQSizePolicy KLedButton::sizePolicy() const
{
return TQSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Fixed );
}
#include "kledbutton.moc"
|