why the QSplitter cannot show the width as I specified?
Hi, I have encountered a weird problem:
Code:
hctrl->setReadOnly(TRUE);
hctrl->setFixedHeight(150);
LeftPanel->setFixedWidth(18);
LeftPanel->setFixedHeight(150);
clustercanvas->setFixedWidth(325);
clustercanvas->setFixedHeight(150);
panel->addWidget(LeftPanel);
panel->addWidget(hctrl);
panel->addWidget(clustercanvas);
However, the display is like this:
http://www.qtcentre.org/attachment.p...2&d=1310606806
The width of the left part (marked by red pen) is actually 360 instead of 18.
Why? How can I keep the width of the left part to be 18?
Thanks a lot!
Re: why the QSplitter cannot show the width as I specified?
Code:
...
panel->addWidget(LeftPanel);
panel->addWidget(hctrl);
panel->addWidget(clustercanvas);
int index = panel.indexOf(LeftPanel);
if(index > -1)
{
QList<int> sizes = panel.sizes();
sizes[index] = 18;
panel.setSizes(sizes);
}
Re: why the QSplitter cannot show the width as I specified?
Hi, thank you very much, I have tried your method, but the result is the same.
Added after 25 minutes:
I followed your idea.
Since the number o button in the panel is not too many, I just set the width of the buttons directly by setfixedwith(16);
Thanks again.
Re: why the QSplitter cannot show the width as I specified?
you can also set the size for LeftPanel directly