GroupBox and RadioButton
-
Dear All,
A simple thing, but couldn't figure out.
I have radio buttons, but they can't be selected when they are put into the GroupBox.
If they are out of it, can. Is the setting problem or what is the problem?
Thanks -
What steps are you following ? I tested the same using Designer on windows 7 it works.
-
I pot all radio buttons first, then I put the GroupBox on top of them.
Thanks -
[quote author="thomas11@live.com.sg" date="1355991117"]I pot all radio buttons first, then I put the GroupBox on top of them.
Thanks[/quote]No you need to place the GroupBox first and then add the radio buttons to it and then set the layout for the GroupBox.
Since you are placing the groupBox above the radioButtons , the mouseClick will be accpeted by the groupBox and not the radioButtons.
-
Thanks, i found the problem. I need to link them up like
ui->groupBox->setLayout(ui->verticalLayout_2); -
[quote author="thomas11@live.com.sg" date="1355991398"]Thanks, i found the problem. I need to link them up like
ui->groupBox->setLayout(ui->verticalLayout_2);[/quote]Thats the other way round.
-
Another thing is how to set the border line for the GroupBox, I can't find the setting in the properties list.
-
You can use "Stylesheets":http://qt-project.org/doc/qt-4.8/stylesheet-examples.html#customizing-qgroupbox for that.
eg
@ui->groupBox->setStyleSheet("QGroupBox{border: 2px solid red};");@