Navigation

    Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    1. Home
    2. Tags
    3. qgroupbox
    Log in to post

    • UNSOLVED Button not collinear with QGroupBox
      General and Desktop • qpushbutton qgroupbox sizepolicy stackedwidget • • TUStudi  

      4
      0
      Votes
      4
      Posts
      52
      Views

      @TUStudi Try a cascading horizontal + vertical layout for your page. Could be an issue with the stretch of the last column, where your green button lives or the QGridLayout in general. Edit: Yeah, that's probably it. Gridlayouts can have "empty" cells... Your two groupBoxes with your options take two cells above the button, which takes one, but expands to full size. As soon as you hide the content (grpBox 2nd opt) of second column, the gridLayout only has three rows (grpBx radio, grpBx first, green btn), but the QGridLayout won't delete its second column, but will leave it just empty and this takes some (little) space. Probably exact that amount of space, the green button expands to the right (aligning to the outter border of your grid). So try horizontal + vertical layouts or check, if there really is some empty cell (which should be, since you don't take the widget but just hide it). QGridLayout::columnCount() should return (at least) 2 when your app is in "small" mode (and also 2 or 3 when you switch to "big")
    • UNSOLVED is it possible to change the default behavior of a checkable QGroupBox?
      General and Desktop • qgroupbox • • Savio Brilhante  

      3
      0
      Votes
      3
      Posts
      45
      Views

      Hi You can cheat a bit and just use the signal toggled() https://doc.qt.io/qt-5/qgroupbox.html#toggled void MainWindow::on_groupBox_toggled(bool status) { auto List = ui->groupBox->findChildren<QLineEdit *>(); for (QLineEdit *line : List ) { line->setEnabled( ! status ); } } Works ok if you tweak the start settings a bit.
    • SOLVED Problem: Stylesheet for QGroupBox
      General and Desktop • stylesheet qgroupbox • • willemf  

      3
      0
      Votes
      3
      Posts
      786
      Views

      @J.Hilk Merci beaucoup, JH, c'est parfait! wf
    • SOLVED QGroupBox title with two different colors (left half black, right half orange)
      General and Desktop • color qgroupbox • • MasterBLB  

      4
      0
      Votes
      4
      Posts
      286
      Views

      @MasterBLB said in QGroupBox title with two different colors (left half black, right half orange): WTF, why I can't mark @mrjj 's post as correct answer?? Sadly, until we update to a newer version of the forum software, that option is not available for every user. I'll set it as the correct answer for you.
    • UNSOLVED QGroupBox does not fit into layouts
      General and Desktop • qgroupbox qvboxlayout qhboxlayout qt5.6.1 • • pauledd  

      7
      0
      Votes
      7
      Posts
      3290
      Views

      @SGaist thank you, I took QFormLayout into account. @VRonin also thank you! I can not believe that it would take so much code to get this done... After starting over and over again I came up with this: GeneralTab::GeneralTab(QWidget *parent) :QWidget(parent) { QLineEdit *lineEdit = new QLineEdit("/dev/video0"); QGroupBox *groupBox = new QGroupBox("Settings",this); groupBox->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding); QFormLayout *formLayout = new QFormLayout(groupBox); formLayout->addRow("Video Device: ",lineEdit); } and this looks exactly what I wanted, two widgets with a nice group box border sized to minimal space usage: https://pauledd.files.wordpress.com/2016/08/pat4.png I dont really know If this code is correct or might produce trouble but at least I dont find any errors at the moment.
    • UNSOLVED How to adjust scroll area as per widgets?
      General and Desktop • qscrollarea qgroupbox • • NIXIN  

      2
      0
      Votes
      2
      Posts
      596
      Views

      @NIXIN have you set QScrollArea's widgetResizeable property set to true? If not it should be enough to resize the QScrollArea's content widget to it's sizeHint.
    • UNSOLVED Elements of the same size in two GroupBoxes
      General and Desktop • qtdesigner qlayout qgroupbox • • alan73  

      7
      0
      Votes
      7
      Posts
      1548
      Views

      @Wieland Ah. thank you. Ok, you are right - spacer wont do it. He could set Alignment to right. (for edit) Then they stay same with all the time. Not sure its 100% the wanted effect? https://www.dropbox.com/s/px3t6ir6d767nn7/keepright.zip?dl=0
    • SOLVED Group boxes and own widget not having correct size.
      General and Desktop • qwidget qgroupbox qgridlayout • • Bart_Vandewoestyne  

      7
      1
      Votes
      7
      Posts
      3763
      Views

      @Bart_Vandewoestyne I see you used a QVBoxLayout, but if I understand things correctly, it could've as well been a QHBoxLayout or QGridLayout because there's only one widget added? Yes of course, you can use whatever layout suits your needs. Also there is no restriction that you have to put one single widget in it, it can as easily accomodate many child widgets. QMainWindow is bit different in that respect, as it doesn't have a layout itself, but instead relies on a central widget (the client area) to do the laying out. I hope that clears things. :)
    • QGroupBox does not auto resize when I put QHBoxLayout inside
      General and Desktop • c++ linux qgroupbox qhboxlayout • • marlenet15  

      3
      0
      Votes
      3
      Posts
      953
      Views

      @SGaist I am just using the .ui (Qt Designer).
    • replace one widget with another on a layout with a button
      General and Desktop • c++ linux qpushbutton qscrollarea qgroupbox • • marlenet15  

      11
      0
      Votes
      11
      Posts
      5322
      Views

      @marlenet15 instructionsScrollArea1 and ReplaceNow() should be in same object or same file at least. that what scope means. so where is instructionsScrollArea1 declared and where is void ReplaceNow() ? Also the * in removeWidget(*instructionsScrollArea1); is wrong. If possible,post whole code here and its easier for us to help.
    • Resize widgets within the same QGroupBox
      Mobile and Embedded • c++ linux widgets size qgroupbox • • marlenet15  

      2
      0
      Votes
      2
      Posts
      1156
      Views

      Hi, You can add a stretch before or after the button so it will be pushed against a border. For your second question, you can again use the stretch like described here
    • Need help by setting default-system icon to GroupBox
      General and Desktop • stylesheet qgroupbox icons • • vatriani  

      1
      0
      Votes
      1
      Posts
      676
      Views

      No one has replied

    • Imitate QRadioButton for QGroupBox
      General and Desktop • qgroupbox qradiobutton • • david.luggen  

      5
      0
      Votes
      5
      Posts
      1062
      Views

      Hi Checkbox is a QAbstractButton child. I think QButtonGroup is the one doing the real work of "exclusive" so I wonder if its possible to create a child of QButtonGroup and teach it to handle new types. But for QGroupBox, I did not trip over anything that suggest it can use another QButtonGroup. :(
    • [SOLVED] How to move QGroupBox tittle to bottom side?
      General and Desktop • qtwidgets qstyle qgroupbox • • Vitek  

      3
      0
      Votes
      3
      Posts
      1348
      Views

      Hi, and thank you. For improve appearance might to add it "QGroupBox {margin-bottom: 3px;}" "QGroupBox::title { subcontrol-position: bottom; " " top: 3px; }"
    • Too much space between rows in QGroupbox
      General and Desktop • qgroupbox setverticalspac • • Joe Macaroni  

      6
      0
      Votes
      6
      Posts
      1276
      Views

      I mean't: call the addStretch method form QXXXLayout