37
37
* focus and is switched on. When a non-radio button is specified as a buddy, the
38
38
* behaviour is the same as for QLabel.
40
* @author David Jarvie <software@astrojar.org.uk>
40
* @author David Jarvie <djarvie@kde.org>
42
42
class Label : public QLabel
45
friend class LabelFocusWidget;
47
/** Constructs an empty label.
48
* @param parent The parent object of this widget.
49
* @param f Flags. See QWidget constructor for details.
51
explicit Label(QWidget* parent, Qt::WFlags f = 0);
52
/** Constructs a label that displays @p text.
53
* @param text Text string to display.
54
* @param parent The parent object of this widget.
55
* @param f Flags. See QWidget constructor for details.
57
Label(const QString& text, QWidget* parent, Qt::WFlags f = 0);
58
/** Constructs a label, with a buddy widget, that displays @p text.
59
* @param buddy Buddy widget which receives the keyboard focus when the
60
* label's accelerator key is pressed. If @p buddy is a radio
61
* button, @p buddy is in addition selected when the
62
* accelerator key is pressed.
63
* @param text Text string to display.
64
* @param parent The parent object of this widget.
65
* @param f Flags. See QWidget constructor for details.
67
Label(QWidget* buddy, const QString& text, QWidget* parent, Qt::WFlags f = 0);
68
/** Sets the label's buddy widget which receives the keyboard focus when the
69
* label's accelerator key is pressed. If @p buddy is a radio button,
70
* @p buddy is in addition selected when the accelerator key is pressed.
72
virtual void setBuddy(QWidget* buddy);
77
QRadioButton* mRadioButton; // buddy widget if it's a radio button, else 0
78
LabelFocusWidget* mFocusWidget;
45
friend class LabelFocusWidget;
48
/** Constructs an empty label.
49
* @param parent The parent object of this widget.
50
* @param f Flags. See QWidget constructor for details.
52
explicit Label(QWidget* parent, Qt::WFlags f = 0);
53
/** Constructs a label that displays @p text.
54
* @param text Text string to display.
55
* @param parent The parent object of this widget.
56
* @param f Flags. See QWidget constructor for details.
58
Label(const QString& text, QWidget* parent, Qt::WFlags f = 0);
59
/** Constructs a label, with a buddy widget, that displays @p text.
60
* @param buddy Buddy widget which receives the keyboard focus when the
61
* label's accelerator key is pressed. If @p buddy is a radio
62
* button, @p buddy is in addition selected when the
63
* accelerator key is pressed.
64
* @param text Text string to display.
65
* @param parent The parent object of this widget.
66
* @param f Flags. See QWidget constructor for details.
68
Label(QWidget* buddy, const QString& text, QWidget* parent, Qt::WFlags f = 0);
69
/** Sets the label's buddy widget which receives the keyboard focus when the
70
* label's accelerator key is pressed. If @p buddy is a radio button,
71
* @p buddy is in addition selected when the accelerator key is pressed.
73
virtual void setBuddy(QWidget* buddy);
80
QRadioButton* mRadioButton; // buddy widget if it's a radio button, else 0
81
LabelFocusWidget* mFocusWidget;
82
85
// Private class for use by Label
83
86
class LabelFocusWidget : public QWidget
87
LabelFocusWidget(QWidget* parent);
89
virtual void focusInEvent(QFocusEvent*);
90
LabelFocusWidget(QWidget* parent);
93
virtual void focusInEvent(QFocusEvent*);