]> icculus.org git repositories - duncan/yast2-qt4.git/blob - src/YQRadioButton.h
don't create QObjects in ycp thread - make timeouts work
[duncan/yast2-qt4.git] / src / YQRadioButton.h
1 /*---------------------------------------------------------------------\
2 |                                                                      |
3 |                      __   __    ____ _____ ____                      |
4 |                      \ \ / /_ _/ ___|_   _|___ \                     |
5 |                       \ V / _` \___ \ | |   __) |                    |
6 |                        | | (_| |___) || |  / __/                     |
7 |                        |_|\__,_|____/ |_| |_____|                    |
8 |                                                                      |
9 |                               core system                            |
10 |                                                        (C) SuSE GmbH |
11 \----------------------------------------------------------------------/
12
13   File:       YQRadioButton.h
14
15   Author:     Stefan Hundhammer <sh@suse.de>
16
17 /-*/
18
19
20 #ifndef YQRadioButton_h
21 #define YQRadioButton_h
22
23 #include "YRadioButton.h"
24 #include <QRadioButton>
25
26 using std::string;
27
28
29 class YQRadioButton : public QRadioButton, public YRadioButton
30 {
31     Q_OBJECT
32
33 public:
34     /**
35      * Constructor.
36      **/
37     YQRadioButton( YWidget *            parent,
38                    const string &       label,
39                    bool                 checked );
40
41     /**
42      * Return the "checked" state of the RadioButton.
43      *
44      * Reimplemented from YRadioButton.
45      **/
46     virtual bool value();
47
48     /**
49      * Set the "checked" state of the RadioButton.
50      *
51      * Reimplemented from YRadioButton.
52      **/
53     virtual void setValue( bool checked );
54
55     /**
56      * Change the label (the text) on the RadioButton.
57      *
58      * Reimplemented from YRadioButton.
59      **/
60     virtual void setLabel( const string & label );
61
62     /**
63      * Use a bold font.
64      *
65      * Reimplemented from YRadioButton.
66      **/
67     virtual void setUseBoldFont( bool bold = true );
68
69     /**
70      * Set enabled / disabled state.
71      *
72      * Reimplemented from YWidget.
73      **/
74     virtual void setEnabled( bool enabled );
75
76     /**
77      * Preferred width of the widget.
78      *
79      * Reimplemented from YWidget.
80      **/
81     virtual int preferredWidth();
82
83     /**
84      * Preferred height of the widget.
85      *
86      * Reimplemented from YWidget.
87      **/
88     virtual int preferredHeight();
89
90     /**
91      * Set the new size of the widget.
92      *
93      * Reimplemented from YWidget.
94      **/
95     virtual void setSize( int newWidth, int newHeight );
96
97     /**
98      * Accept the keyboard focus.
99      *
100      * Reimplemented from YWidget.
101      **/
102     virtual bool setKeyboardFocus();
103
104 protected slots:
105     /**
106      * Triggered when the RadioButton is toggled.
107      **/
108     void changed( bool newState );
109
110     /**
111      * Redirect events to this object.
112      **/
113     bool eventFilter( QObject * obj, QEvent * event );
114
115 };
116
117 #endif // YQRadioButton_h