PDA

View Full Version : Resizable widgets using mouse



kabanek
6th May 2011, 09:22
hello, I want to add possibility to resize width of widgets in layout using mouse.
I mean... to put mouse between this two widgets, drag and move left/right changing the width of widgets. How can I do that?

nish
6th May 2011, 12:14
read about QSplitter

kabanek
6th May 2011, 22:23
It looks good, but I have a problem with width of this objects. I want to have widths for example: 200px (first widget), 200px (last widget) and the rest of width to the second object. I wrote:


MainSplitter = new QSplitter(Qt::Horizontal, ui->centralWidget);
MainSplitter->insertWidget(0, ui->projectsTab);
MainSplitter->insertWidget(1, ui->filesTab);
MainSplitter->insertWidget(2, ui->detailsTab);

ui->projectsTab->setGeometry(0,0, 500, 100);

but I get the window does not look like I want to look