Doc
Doc

Reputation: 385

How to allow only one checkbox checked at a time?

I am making a GUI for a script in Python, using PySide Qt. I have a couple of checkboxes in the main window and I was wondering if it is possible to make them dependant to each other. What I mean is that, if I check one of them, all the others should become unchecked. So only one can be checked at a time.

Is there a comfortable way to do this? Otherwise I would just write a function to uncheck the others.

Upvotes: 0

Views: 2977

Answers (1)

user3656716
user3656716

Reputation: 34

use QButtonGroup to make them as a group and you might want to derive a class from this and override the basic check/uncheck depending on how you want the checkboxes to behave

Upvotes: 1

Related Questions