Finding gap in layouts after adding scrollarea to the dock widget
-
Hi,
I am trying to set scroll area to the dock widget, which has a vertical layout which gets filled dynamically with custom collapsible group box , when i add two or more collapsible groups i m getting gap between 1st and next collapsible group box .
i have done setspacing = 0 for layout ;Note - it was working fine before i add scroll area .
before it was something like this without scroll area-
After adding this code in respective .Cpp
QScrollArea* scrollArea = new QScrollArea(this);
scrollArea->setGeometry(10, 10, 390, 800);
scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
scrollArea->setWidgetResizable(true);
scrollArea->setWidget(ui->dockWidget);can anyone suggest me what could be the problem.
-
hi
i dont see any
pLayout->setContentsMargins(0,0,0,0); -
Ok.
Since it also seems the TextEdit have space around it , im out of guesses.Are you sure you setContentsMargins on the right layout ?
Did you try to raise the values and see space would become bigger ? -
Yes i am setting to the right layout,
after setting ui->pLayout->setContentsMargins(20,20,20,20); it effected left right top bottom, not the gap between two layouts it is happening only after adding scroll area ..Also after adding ui->verticalLayout->setContentsMargins(20,20,20,20); to the inside layout results are like this:
0_1557914571781_Capture3_LI.jpg
if i close all :
! -
Hi
Looks like its that collapse thing that does it.
when open, there is no space between them.
in any case, i have no more guesses.
I would try with plain QFrames and see.