1 /*---------------------------------------------------------------------\
3 | __ __ ____ _____ ____ |
4 | \ \ / /_ _/ ___|_ _|___ \ |
5 | \ V / _` \___ \ | | __) | |
6 | | | (_| |___) || | / __/ |
7 | |_|\__,_|____/ |_| |_____| |
11 \----------------------------------------------------------------------/
13 File: YQCheckBoxFrame.h
15 Author: Stefan Hundhammer <sh@suse.de>
20 #ifndef YQCheckBoxFrame_h
21 #define YQCheckBoxFrame_h
23 #include <qgroupbox.h>
24 #include "YCheckBoxFrame.h"
30 class YQCheckBoxFrame : public QGroupBox, public YCheckBoxFrame
39 YQCheckBoxFrame( YWidget * parent,
44 * Change the label text on the CheckBoxFrame.
46 * Reimplemented from YCheckBoxFrame.
48 virtual void setLabel( const string & label );
51 * Check or uncheck the CheckBoxFrame's check box.
53 * Reimplemented from YCheckBoxFrame.
55 virtual void setValue( bool isChecked );
58 * Get the status of the CheckBoxFrame's check box.
60 * Reimplemented from YCheckBoxFrame.
65 * Set enabled / disabled state.
67 * Reimplemented from YWidget.
69 virtual void setEnabled( bool enabled );
72 * Preferred width of the widget.
74 * Reimplemented from YWidget.
76 virtual int preferredWidth();
79 * Preferred height of the widget.
81 * Reimplemented from YWidget.
83 virtual int preferredHeight();
86 * Set the new size of the widget.
88 * Reimplemented from YWidget.
90 virtual void setSize( int newWidth, int newHeight );
93 * Accept the keyboard focus.
95 * Reimplemented from YWidget.
97 virtual bool setKeyboardFocus();
103 * Triggered when the on/off status is changed
105 void stateChanged( bool newState );
111 * Prevent standard QGroupBox behaviour to always enable or disable all
112 * children according to its check box's status (can't be inverted or left
113 * to the application).
115 * This is a nasty hack, but it prevents oversights from the Qt designers.
116 * Their view on how that check box should affect the frame content appears
117 * to be somewhat limiting.
119 void preventQGroupBoxAutoEnablement();
122 * Reimplemented from QGroupBox to prevent QGroupBox from disabling
123 * children according to the check box status as the children are inserted.
125 virtual void childEvent( QChildEvent * );
132 QCheckBox * _checkBox;
136 #endif // YQCheckBoxFrame_h