PDA

View Full Version : checkbox



nErnie
25th September 2006, 22:30
Hi all,
i have some difficulties with checkbox in my module. My problem is getting the value when the user checks the box. Using designer, i created my checkbox. Then connected them to a slot using a clicked signal in my .cpp file. My problem is in the function call that should test if the user checked the checkbox and if so it should do something.
ie


.cpp file

bool stuff::operatingM(int action)
{
mMaterial->subDj(output);
.
.
.
if(isCheckbox)
display->draw(outputGrap)
.
.
.
}
void stuff::isCheckbox(bool)
{
return true; // this is what i did but its wrong eventhough i set
checkbox on designer as false
}
//enables connections necessary
void stuff::enableQtConnections()
{
connect(checkBox, SIGNAL(clicked()), this, SLOT(isChecked(bool)));
:
:
}

void stuff::disableQtConnections()
{
disconnect(checkBox, SIGNAL(clicked()), this, SLOT(isChecked(bool)));
:
:
}

any help? :confused: thanks in advance

jacek
25th September 2006, 22:59
Use toggled(bool) or stateChanged(int) instead of clicked().