libyui-qt
2.43.5
|
00001 /* 00002 Copyright (C) 2000-2012 Novell, Inc 00003 This library is free software; you can redistribute it and/or modify 00004 it under the terms of the GNU Lesser General Public License as 00005 published by the Free Software Foundation; either version 2.1 of the 00006 License, or (at your option) version 3.0 of the License. This library 00007 is distributed in the hope that it will be useful, but WITHOUT ANY 00008 WARRANTY; without even the implied warranty of MERCHANTABILITY or 00009 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 00010 License for more details. You should have received a copy of the GNU 00011 Lesser General Public License along with this library; if not, write 00012 to the Free Software Foundation, Inc., 51 Franklin Street, Fifth 00013 Floor, Boston, MA 02110-1301 USA 00014 */ 00015 00016 00017 /*-/ 00018 00019 File: YQRadioButton.h 00020 00021 Author: Stefan Hundhammer <sh@suse.de> 00022 00023 /-*/ 00024 00025 00026 #ifndef YQRadioButton_h 00027 #define YQRadioButton_h 00028 00029 #include <yui/YRadioButton.h> 00030 #include <QRadioButton> 00031 00032 using std::string; 00033 00034 00035 class YQRadioButton : public QRadioButton, public YRadioButton 00036 { 00037 Q_OBJECT 00038 00039 public: 00040 /** 00041 * Constructor. 00042 **/ 00043 YQRadioButton( YWidget * parent, 00044 const std::string & label, 00045 bool checked ); 00046 00047 /** 00048 * Return the "checked" state of the RadioButton. 00049 * 00050 * Reimplemented from YRadioButton. 00051 **/ 00052 virtual bool value(); 00053 00054 /** 00055 * Set the "checked" state of the RadioButton. 00056 * 00057 * Reimplemented from YRadioButton. 00058 **/ 00059 virtual void setValue( bool checked ); 00060 00061 /** 00062 * Change the label (the text) on the RadioButton. 00063 * 00064 * Reimplemented from YRadioButton. 00065 **/ 00066 virtual void setLabel( const std::string & label ); 00067 00068 /** 00069 * Use a bold font. 00070 * 00071 * Reimplemented from YRadioButton. 00072 **/ 00073 virtual void setUseBoldFont( bool bold = true ); 00074 00075 /** 00076 * Set enabled / disabled state. 00077 * 00078 * Reimplemented from YWidget. 00079 **/ 00080 virtual void setEnabled( bool enabled ); 00081 00082 /** 00083 * Preferred width of the widget. 00084 * 00085 * Reimplemented from YWidget. 00086 **/ 00087 virtual int preferredWidth(); 00088 00089 /** 00090 * Preferred height of the widget. 00091 * 00092 * Reimplemented from YWidget. 00093 **/ 00094 virtual int preferredHeight(); 00095 00096 /** 00097 * Set the new size of the widget. 00098 * 00099 * Reimplemented from YWidget. 00100 **/ 00101 virtual void setSize( int newWidth, int newHeight ); 00102 00103 /** 00104 * Accept the keyboard focus. 00105 * 00106 * Reimplemented from YWidget. 00107 **/ 00108 virtual bool setKeyboardFocus(); 00109 00110 protected slots: 00111 /** 00112 * Triggered when the RadioButton is toggled. 00113 **/ 00114 void changed( bool newState ); 00115 00116 /** 00117 * Redirect events to this object. 00118 **/ 00119 bool eventFilter( QObject * obj, QEvent * event ); 00120 00121 }; 00122 00123 #endif // YQRadioButton_h