00001
00002
00003
00004
00005
00006
00007 #include "QRadioButtonGroup.h"
00008
00009
00010 #include <iostream>
00011 using namespace std;
00012
00013
00014
00015
00016
00017 void QRadioButtonGroup::add( QRadioButton* button )
00018 {
00019 if (button != 0) Items.push_front(button);
00020
00021 }
00022
00023
00024 void QRadioButtonGroup::remove( QRadioButton* button )
00025 {
00026 Items.remove(button);
00027 }
00028
00029
00030 void QRadioButtonGroup::setAsSelected( QRadioButton* button )
00031 {
00032
00033 list<QRadioButton*>::const_iterator iter;
00034
00035 for (iter=Items.begin(); iter != Items.end(); iter++)
00036 {
00037 if ((*iter) != button)
00038 {
00039 (*iter)->setState(cbUnchecked);
00040 }
00041 else
00042 {
00043 (*iter)->setState(cbChecked);
00044 }
00045 }
00046 }
00047
00048
00049
00050
00051 void QRadioButtonGroup::print()
00052 {
00053
00054 cout << "Class : QRadioButtonGroup" << endl;
00055 cout << "Items.size() = " << Items.size() << endl;
00056 }
00057
00058
00059
00060
00061 QRadioButtonGroup::QRadioButtonGroup( )
00062 {
00063 }
00064
00065
00066
00067
00068 QRadioButtonGroup::~QRadioButtonGroup()
00069 {
00070 }
00071
00072
00073
00074