]> icculus.org git repositories - duncan/yast2-qt4.git/blob - src/YQRadioButtonGroup.h
picking up branches/tmp/sh/qt4-port/, merging it with trunk
[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.h>
23 #include "YRadioButtonGroup.h"
24
25 class Q3ButtonGroup;
26
27 class YQRadioButtonGroup : public QWidget, public YRadioButtonGroup
28 {
29     Q_OBJECT
30
31 public:
32     /**
33      * Constructor.
34      **/
35     YQRadioButtonGroup( YWidget * parent );
36
37     /**
38      * Destructor.
39      **/
40     virtual ~YQRadioButtonGroup();
41
42     /**
43      * Add a RadioButton.
44      *
45      * Reimplemented from YRadioButtonGroup.
46      **/
47     virtual void addRadioButton( YRadioButton * button );
48
49     /**
50      * Set enabled/disabled state.
51      *
52      * Reimplemented from YWidget.
53      **/
54     virtual void setEnabled( bool enabled );
55     
56     /**
57      * Set the new size of the widget.
58      *
59      * Reimplemented from YWidget.
60      **/
61     virtual void setSize( int newWidth, int newHeight );
62
63
64 private slots:
65
66     /**
67      * Triggered when one of the radio buttons changed state.
68      * This implements the radio box behaviour, i.e. unselects all but the last
69      * selected radio button.
70      **/
71     void radioButtonClicked( bool newState );
72
73
74 private:
75
76     /**
77      * Used to prevent infinite recursion due to signal race conditions.
78      **/
79     bool _recursive;
80 };
81
82
83 #endif // YQRadioButtonGroup_h