Radio button not checkable for users
General and Desktop
4
Posts
4
Posters
8.2k
Views
1
Watching
-
wrote on 24 Dec 2011, 21:31 last edited by
Hello
In a groupbox I have three radiobuttons.
But I want that I can only checked in my program, not with the mouse.
I have no idea how I can do that.
Maybe someone knows how I set it? -
wrote on 25 Dec 2011, 02:13 last edited by
Set a radiobutton from code and set groupbox disabled?
-
wrote on 25 Dec 2011, 14:40 last edited by
The radio buttons and the groupbox can be disabled from code too even if they are placed in the UI using designer.
From a user's point of view, disabling the button is a good idea, as one knows that clicking on the button doesn't have any effect, then. Leaving the buttons enabled, but "eating" the clicks is annoying, at best.
-
wrote on 25 Dec 2011, 19:47 last edited by
Simple example: @QRadioButton *radioButton = new QRadioButton(this); // defined on ui_file.h
radioButton->setEnabled(0);
radioButton->setChecked(1); // or 0 as you like@
1/4