user2761786
user2761786

Reputation: 271

Deactivate Checkbox in QT Designer

I have a (very rough) GUI created using QT Designer.

Within it there are two radio buttons. When Button A is toggled I would like the check boxes below to be unavailable for use. When A is toggled, I would like to activate them. Is this possible?

I have tried using the signal and slots mode, but I can only find an option to setChecked when B is toggled, not deactivate when A is toggled

enter image description here

Upvotes: 1

Views: 1716

Answers (1)

Dmitry Markin
Dmitry Markin

Reputation: 1205

It's quite simple: just connect radio button signal toggled() with group box's setVisible() slot. This will completely hide the checkboxes.

You can also connect toggled() with every checkbox's setDisabled() slot just to deactivate them.

Upvotes: 3

Related Questions