Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Qtdesigner: how radio button group together?

    Tools
    5
    5
    57442
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      shalongbasi last edited by

      I am using Qtdesigner for a UI interface. I found that if I use a Qgroupbox to group all Qradiobuttons together, and only Qradiobuttons, they can be selected normally, that mean one is selected and all other are unselected. But if I put Qrabiobuttons into one QgroupBox, and also, there are other stuffs in the same Qgroubox, such as label, lineedit, pushbutton, those radionbuttons cannot be checked exclusively. Is it possible to make them work with different items in the same groupbox?

      1 Reply Last reply Reply Quote 1
      • musimbate
        musimbate last edited by

        Have you considered arranging QRadioButtons in their groupboxes and then organize your design using layouts?I feel that QGroupBox is there to bundle QRadioButtons and QCheckBoxes together.

        Why join the navy if you can be a pirate?-Steve Jobs

        1 Reply Last reply Reply Quote 2
        • A
          andre last edited by

          You can also create a button group explicitly for your radio buttons. Select the ones you want to group, and right click on one of them. Then, you'll find an option to "group" the buttons. If you click that, you will notice that a new QButtonGroup has appeared in your object browser in designer. You can select that button group to give it a name, make it exclusive, etc.

          B 1 Reply Last reply Reply Quote 7
          • H
            Hareen Laks last edited by

            Andre,
            Thanks. It is good to have rating systems for answers as well.

            1 Reply Last reply Reply Quote 0
            • B
              Bharath Ram @andre last edited by

              @andre I just logged into this old thread to say "Thank you" to Andre for the handy tip.

              1 Reply Last reply Reply Quote 0
              • First post
                Last post