]> icculus.org git repositories - duncan/yast2-qt4.git/blob - src/YQRadioButtonGroup.h
clicking packages work! so the package selector is now
[duncan/yast2-qt4.git] / src / YQRadioButtonGroup.h
1 /*---------------------------------------------------------------------\
2 |                                                                      |
3 |                      __   __    ____ _____ ____                      |
4 |                      \ \ / /_ _/ ___|_   _|___ \                     |
5 |                       \ V / _` \___ \ | |   __) |                    |
6 |                        | | (_| |___) || |  / __/                     |
7 |                        |_|\__,_|____/ |_| |_____|                    |
8 |                                                                      |
9 |                               core system                            |
10 |                                                        (C) SuSE GmbH |
11 \----------------------------------------------------------------------/
12
13   File:       YQRadioButtonGroup.h
14
15   Author:     Stefan Hundhammer <sh@suse.de>
16
17 /-*/
18
19 #ifndef YQRadioButtonGroup_h
20 #define YQRadioButtonGroup_h
21
22 #include <QWidget>
23 #include "YRadioButtonGroup.h"
24
25
26 class YQRadioButtonGroup : public QWidget, public YRadioButtonGroup
27 {
28     Q_OBJECT
29
30 public:
31     /**
32      * Constructor.
33      **/
34     YQRadioButtonGroup( YWidget * parent );
35
36     /**
37      * Destructor.
38      **/
39     virtual ~YQRadioButtonGroup();
40
41     /**
42      * Add a RadioButton.
43      *
44      * Reimplemented from YRadioButtonGroup.
45      **/
46     virtual void addRadioButton( YRadioButton * button );
47
48     /**
49      * Set enabled/disabled state.
50      *
51      * Reimplemented from YWidget.
52      **/
53     virtual void setEnabled( bool enabled );
54     
55     /**
56      * Set the new size of the widget.
57      *
58      * Reimplemented from YWidget.
59      **/
60     virtual void setSize( int newWidth, int newHeight );
61
62
63 private slots:
64
65     /**
66      * Triggered when one of the radio buttons changed state.
67      * This implements the radio box behaviour, i.e. unselects all but the last
68      * selected radio button.
69      **/
70     void radioButtonClicked( bool newState );
71
72
73 private:
74
75     /**
76      * Used to prevent infinite recursion due to signal race conditions.
77      **/
78     bool _recursive;
79 };
80
81
82 #endif // YQRadioButtonGroup_h