Qbuttongroup: A non-visual container for a button class that implements the selection of a child class instance of a button by default.

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.