00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef __QTOGGLEBUTTON_H_
00028 #define __QTOGGLEBUTTON_H_
00029
00030
00031
00033
00034
00035
00036
00038
00039
00040
00042
00043
00044
00046
00047 class QPixmap;
00048 class QWidget;
00049
00050
00051 #if QT_VERSION >= 300
00052 #define CHECK_PTR Q_CHECK_PTR
00053 #endif
00054
00055
00057
00063 class QToggleButton : public QPushButton
00064 {
00065 Q_OBJECT
00066
00067 public:
00069 QToggleButton( QWidget *parent=0, const char *name=0 );
00071 QToggleButton( const char *text1, const char *text2, QWidget *parent=0, const char *name=0 );
00073 ~QToggleButton();
00074
00075 void setText( const QString &) {};
00076 void setPixmap( const QPixmap &) {};
00077
00079 void setText( const QString &up_text, const QString &down_text = "" );
00081 void setPixmap( const QPixmap &up_pixmap, const QPixmap &down_pixmap );
00082
00083 private slots:
00084 void togglePixmap(bool on);
00085
00086 private:
00087 QString toggled_btext;
00088 QPixmap *toggled_bpixmap;
00089 };
00090
00091
00092 #endif // __QTOGGLEBUTTON_H_