Solved Grid layout and QGroupBox
-
hello
I am following an example at riptutorial about Grid layout and QGroupBox and I add it to my QTabWidget. It works, but not as expected or not like the example. For me it gives extra spaces between the QLineEdit (see picture). How can I remove the spaces between the QLineEdit? Thanks
-
I add it to my
QTabWidget
I think/assume the difference is your
QTabWidget
's pages, which I guess stretches its content to fit? Put a layout on theQTabWidget
pages to lay out without stretching? Show how you added what onto yourQTabWidget
? -
@JonB I added stretching to the lay out but
boxLayout->addStretch(1);
It removed the spaces, but everything is at bottom now.
-
Hi,
Can you show the code you are currently using to setup your widgets ?
-
@SGaist this is the example I'm following riptutorial then I add widget to my tab.
-
If I may, I'd recommend using QFormLayout in place of QGridLayout in this case. That will simplify your life.