开发者

What is the easiest way to keep track of a group of checkable buttons in QT?

开发者 https://www.devze.com 2023-01-27 18:55 出处:网络
I have six checkable push buttons in QT, and I want开发者_如何学Python it so that only one of the buttons are checked at one time (like radio buttons). I could probably do it with lots of signals and

I have six checkable push buttons in QT, and I want开发者_如何学Python it so that only one of the buttons are checked at one time (like radio buttons). I could probably do it with lots of signals and slots, but is there a easier way to do this?

I'm looking for something similar to how the QGroupBox and QRadioButtons work together.

Thanks


I think you're looking for http://doc.trolltech.com/4.7/qbuttongroup.html .

Make sure all of your buttons are checkable, make the group exclusive, use addButton() for each button and run with it.

0

精彩评论

暂无评论...
验证码 换一张
取 消