-rw-r--r-- | libopie/oclickablelabel.h | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/libopie/oclickablelabel.h b/libopie/oclickablelabel.h index f65c440..4b6dcbc 100644 --- a/libopie/oclickablelabel.h +++ b/libopie/oclickablelabel.h @@ -5,2 +5,22 @@ +/** + * This class is a special QLabel which can behave + * as a QPushButton or QToggleButton. + * The reason to use a clickable is if you want to save space + * or you want to skip the border of a normal button + * + * <pre> + * QLabel* lbl = new OClickableLabel( parent, "PushLabel" ); + * lbl->setPixmap( "config" ); + * QWhatsThis::add( lbl, tr("Click here to do something") ); + * </pre> + * + * @short A Label behaving as button + * @author Hakan Ardo, Maximillian Reiß ( harlekin@handhelds.org ) + * @see QLabel + * @see QPushButton + * @see QToggleButton + * @version 1.0 + */ + class OClickableLabel: public QLabel @@ -12,2 +32,3 @@ public: void setToggleButton(bool t); + protected: @@ -16,2 +37,3 @@ public: void mouseMoveEvent( QMouseEvent *e ); + public slots: @@ -22,6 +44,7 @@ public: private: - bool isToggle; - bool isDown; + bool isToggle : 1; + bool isDown : 1; + bool textInverted : 1; + void showState(bool on); - bool textInverted; void setInverted(bool on); |