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. Remove QGroupBox Space

Remove QGroupBox Space

Scheduled Pinned Locked Moved General and Desktop
7 Posts 4 Posters 7.2k Views
  • 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.
  • B Offline
    B Offline
    bijanbina
    wrote on 24 May 2014, 14:43 last edited by
    #1

    How can i remove QGroupbox space
    i already test
    @groupbox->setStyleSheet("QGroupBox::title { border: 0px ; border-radius: 0px; padding: 0px 0px 0px 0px; margin = 0px 0px 0px 0px } QGroupBox { border: 0px ; border-radius: 0px; padding: 0px 0px 0px 0px;} ");
    @
    it reduce the space but not perfectly done!
    how can i remove space completely
    u can c a few space and margin in second radio group but not in first in follow image
    !http://axgig.com/images/42241377009986391810.png(screenshot)!

    thanks

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andreyc
      wrote on 24 May 2014, 17:12 last edited by
      #2

      Where is a groupBox on the picture? Is it whole picture?
      What space do you need to remove? Point it on the picture please.
      How do you create the groupBox? Do you use layouts?

      1 Reply Last reply
      0
      • B Offline
        B Offline
        bijanbina
        wrote on 24 May 2014, 17:45 last edited by
        #3

        in follow picture i located the groupbox with gray rectangle
        the above radioboxes are without groupbox and only layout used

        !http://axgig.com/images/30296945634705783323.jpg(as)!

        i'm trying to tag radiobox so each of four work independtly
        if there is any other way to do so i appreciate it

        1 Reply Last reply
        0
        • Z Offline
          Z Offline
          zeljko
          wrote on 24 May 2014, 18:33 last edited by
          #4

          Try to set attribute Qt::WA_LayoutOnEntireRect on your groupbox.

          1 Reply Last reply
          0
          • B Offline
            B Offline
            bijanbina
            wrote on 29 May 2014, 18:59 last edited by
            #5

            thanks for reply but it doesn't change any thing

            1 Reply Last reply
            0
            • A Offline
              A Offline
              andreyc
              wrote on 29 May 2014, 19:31 last edited by
              #6

              I don't understand what space do you need to remove.
              Is it the space between each radiobutton?

              Right now it looks like this:
              @
              |o null |o null |o null |o null |
              @

              Are you trying to put them close to each other like this:
              @
              |o null |o null |o null |o null |
              @

              If so, then you can create a horizontal layout put all groupboxes together and add horizontal spacer to fill rest of the place.

              If it is not what you need then, please, draw a picture of your desired design.

              1 Reply Last reply
              0
              • K Offline
                K Offline
                k_arnaud
                wrote on 29 May 2014, 21:00 last edited by
                #7

                Hi,
                did you try this:
                @
                group->setVisible(false); //that code will hide the QGroupBox widget
                @

                about the radioboxes, create them with the same parent, so they will work dependently

                try something like this:

                @
                QHBoxLayout *ly = new QHBoxLayout;
                QGroupBox *group = new QGroupBox("Countries");
                QWidget *widget = new QWidget;

                QRadioBox *r1 = new QRadioBox(tr("Ivory coast"),widget);
                QRadioBox *r2= new QRadioBox(tr("Germany"),widget);
                QRadioBox *r3 = new QRadioBox(tr("USA"),widget);
                ly->addWidget(r1);
                ly->addWidget(r2);
                ly->addWidget(r3);
                group->setLayout(ly);
                //and other code
                @

                1 Reply Last reply
                0

                6/7

                29 May 2014, 19:31

                • Login

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