Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. GroupBox and RadioButton
Forum Updated to NodeBB v4.3 + New Features

GroupBox and RadioButton

Scheduled Pinned Locked Moved General and Desktop
8 Posts 2 Posters 5.5k Views 1 Watching
  • 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.
  • T Offline
    T Offline
    thomas11live.com.sg
    wrote on last edited by
    #1

    Dear All,
    A simple thing, but couldn't figure out.
    I have radio buttons, but they can't be selected when they are put into the GroupBox.
    If they are out of it, can. Is the setting problem or what is the problem?
    Thanks

    1 Reply Last reply
    0
    • S Offline
      S Offline
      Sam
      wrote on last edited by
      #2

      What steps are you following ? I tested the same using Designer on windows 7 it works.

      1 Reply Last reply
      0
      • T Offline
        T Offline
        thomas11live.com.sg
        wrote on last edited by
        #3

        I pot all radio buttons first, then I put the GroupBox on top of them.
        Thanks

        1 Reply Last reply
        0
        • S Offline
          S Offline
          Sam
          wrote on last edited by
          #4

          [quote author="thomas11@live.com.sg" date="1355991117"]I pot all radio buttons first, then I put the GroupBox on top of them.
          Thanks[/quote]

          No you need to place the GroupBox first and then add the radio buttons to it and then set the layout for the GroupBox.

          Since you are placing the groupBox above the radioButtons , the mouseClick will be accpeted by the groupBox and not the radioButtons.

          1 Reply Last reply
          0
          • T Offline
            T Offline
            thomas11live.com.sg
            wrote on last edited by
            #5

            Thanks, i found the problem. I need to link them up like
            ui->groupBox->setLayout(ui->verticalLayout_2);

            1 Reply Last reply
            0
            • S Offline
              S Offline
              Sam
              wrote on last edited by
              #6

              [quote author="thomas11@live.com.sg" date="1355991398"]Thanks, i found the problem. I need to link them up like
              ui->groupBox->setLayout(ui->verticalLayout_2);[/quote]

              Thats the other way round.

              1 Reply Last reply
              0
              • T Offline
                T Offline
                thomas11live.com.sg
                wrote on last edited by
                #7

                Another thing is how to set the border line for the GroupBox, I can't find the setting in the properties list.

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  Sam
                  wrote on last edited by
                  #8

                  You can use "Stylesheets":http://qt-project.org/doc/qt-4.8/stylesheet-examples.html#customizing-qgroupbox for that.

                  eg

                  @ui->groupBox->setStyleSheet("QGroupBox{border: 2px solid red};");@

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved