I want to perform a function when the radio button is pressed in QT
Unsolved
General and Desktop
-
Have you looked at the signals available in QRadioButton like checked(), clicked(), pressed() etc ? Make signal & slot communication with clicked() signal.
-
@dheerendra
are you saying this?
if (ui->radioButton_on->isChecked())
{
ui->command->setText();
}
between the setText() , i enter the command but it doesn't work -
Is the radioButton already checked ? If yes, then only it works. Otherwise it does not work. Since u r telling it does not work, i'm sure it is not checked. Who is supposed to click on the RadioButton ?
-
@dheerendra
i will test qt , check button . and add code
"if (ui->radioButton_on->isChecked())
{
ui->command->setText("mon 1");
}"
but device dosen't work. -
- Can you confirm whether RadioButton is selected ?
- Can you confirm whether code piece you pasted here, is executed ?
- Can you tell me when above code piece executed ? Is it based on some condition ? OR
- Are you expecting the above code piece to be executed when you click on the radioButton ?