1 // 2 // C++ Implementation: smradiobutton 3 // 4 // Description: a clone of SMCheckBox 5 // 6 // 7 // Author: Pierre Marchand <pierremarc@oep-h.com>, (C) 2009 8 // 9 // Copyright: See COPYING file that comes with this distribution 10 // 11 // 12 13 #include "smradiobutton.h" 14 SMRadioButton(QWidget * parent)15SMRadioButton::SMRadioButton ( QWidget * parent ) 16 : QRadioButton ( parent ) 17 { 18 } 19 setChecked(bool val)20void SMRadioButton::setChecked(bool val) 21 { 22 m_hasParent = false; 23 m_pValue = false; 24 setFont(false); 25 26 QRadioButton::setChecked(val); 27 } 28 setChecked(bool val,bool isParentVal)29void SMRadioButton::setChecked(bool val, bool isParentVal) 30 { 31 m_hasParent = true; 32 m_pValue = val; 33 setFont(!isParentVal); 34 35 QRadioButton::setChecked(val); 36 } 37 setParentValue(bool val)38void SMRadioButton::setParentValue(bool val) 39 { 40 m_hasParent = true; 41 m_pValue = val; 42 } 43 useParentValue()44bool SMRadioButton::useParentValue() 45 { 46 bool ret = m_useParentValue; 47 m_useParentValue = false; 48 return ret; 49 } 50 setFont(bool wantBold)51void SMRadioButton::setFont(bool wantBold) 52 { 53 QFont f(font()); 54 f.setBold(wantBold); 55 QRadioButton::setFont(f); 56 } 57 58 59 60