Qbuttongroup
The Qbuttongroup class provides a container to organize groups of button widgets.
Qbuttongroup provides an abstract container to which button widgets can be placed. It does not provide a visual representation of this container (see Qgroupbox for a container widgets), but instead Manages the states of each of the buttons in the group.
An exclusive button Group Switches off all checkable (toggle) buttons except the one and has been clicked. By default, the A button group is exclusive. The buttons in a button group is usually Checkable qpushbuttons,qcheckboxes ( Normally for non-exclusive button groups), Or qradiobuttons. If you create a exclusive button group, you should ensure that one of the buttons in the group is initially checked; Otherwise, the group would initially is in a state where no buttons is checked.
A button can be added to the group With addbutton () and removed With removebutton (). If The group is exclusive, the currently checked button is available with checke Dbutton (). If a button is clicked, thebuttonclicked () signal is emitted; The For a checkable button is exclusive group This means, the button has been checked. The list of buttons in the group is returned By buttons ().
In addition, Qbuttongroup can map between integers and buttons. You can assign an integer ID to a button with SetId (), and retrieve it with ID (). The ID of the currently checked button is available with Checkedid (), and there are an overloaded signal buttonclic Ked () which emits the-ID of the button. The ID is -1
reserved byqbuttongroup to mean "no such button". The purpose of the mapping mechanism is to simplify the representation of enum values in a user interface.
Qbuttongroup: A non-visual container for a button class that implements the selection of a child class instance of a button by default.