1 Attachment(s)
Problem while using QFormlayout inside a QGroupbox
Hey,
i've got a problem while using a qformlayout inside a qgroupbox..
if my screenresolution is to small, i get a layout like this:
Attachment 7995
the code i'm using looks like this:
Code:
QFormLayout *formLayout = new QFormLayout();
formLayout->addRow(tr("Store Images"), myCheckbox);
formLayout->addRow(tr("Store Image Path"), myLineEdit)
QxtGroupBox* gb = new QxtGroupBox(tr("&Settings"), this);
mainLayout->addWidget(gb);
Someone a idea how i can fix this problem?
thanks already for your answer..
regards. :)
Re: Problem while using QFormlayout inside a QGroupbox
Set margins and size policies to your widgets.
Make sure that the overall size is not to large for your screen.
Re: Problem while using QFormlayout inside a QGroupbox
hmm - ok i'll have a try, but setting all size policies by hand is a lot of work..
i tried to use a scollarea, but this doesn't work either (or is a scrollarea just the wrong widget?)
Re: Problem while using QFormlayout inside a QGroupbox
Quote:
tried to use a scollarea, but this doesn't work either
What do you mean by "doesn't work"?
Show your code.
Re: Problem while using QFormlayout inside a QGroupbox
like above, but before doing this:
Quote:
mainLayout->addWidget(gb);
i've done this:
Quote:
QScrollArea* sa = new QScrollArea();
QHBoxLayout* hl1 = new QHboxLayout();
hl1->addWidget(sa);
sa->setLayout(formLayout);
gb->setLayout(hl1);
Re: Problem while using QFormlayout inside a QGroupbox
Where is sa->setWidget()?
Re: Problem while using QFormlayout inside a QGroupbox
uuups..
which widget is best for adding a layout before adding to scrollarea? i thought about a QFrame?
this doesn't work..
Quote:
QWidget* w = new QWidget();
w->setLayout(formLayout);
sa->setWidget(w);
then my box is just empty :(
forget about it.. pebcak, its working fine :)