Tabs/Dialog with hidden/extendable content
Inspired by "Expanding Dialog" example I've tried to do something similar, however:
- my hidden content is within a tab.
- the tab should resize vertically (maintain horizontal width)
- the dialog should resize accordingly.
The UI file is here: http://dentharg.pl/photoqueue.ui.
The code within constructor:
ui.setupUi(this);
ui.grpSourceDestination->hide();
ui.tabMain->layout()->setSizeConstraint(QLayout::SetFixedSize);
layout()->setSizeConstraint(QLayout::SetFixedSize());
but of course doesn't work as expected.
Is it at all possible to do such resizable tabwidget/dialog?
Thanks!
Re: Tabs/Dialog with hidden/extendable content
"grpSourceDestination" is missing a top level layout (the grid layout is floating).
Re: Tabs/Dialog with hidden/extendable content
I'm not certain what exactly do you mean, the tabMain which contains grpSourceDestination has grid layout.
Re: Tabs/Dialog with hidden/extendable content
Quote:
Originally Posted by
dentharg
I'm not certain what exactly do you mean, the tabMain which contains grpSourceDestination has grid layout.
But grpSourceDestination itself doesn't have a layout installed. There's a floating grid layout which contains sourceDirectory, destinationDirectory etc.
Re: Tabs/Dialog with hidden/extendable content
When I added a grid layout to grpSourceDestination all of the sizes went with smoke. The contents of the tabMain are now not even at full width.
I've put whole code at http://dentharg.pl/pq.tar.bz2
Forgive my ignorance but this is my very first attempt at QT4.
The idea is that grpSourceDestination is not visible until More button is pressed. The tabMain should be small and whole dialog too. And both of them should expand when More is pressed.
Thanks!
Re: Tabs/Dialog with hidden/extendable content
Ok. Managed to do it. It was truly enough to add layouts to all elements, and remove size constraints from tabMain and leave it only on dialog.
However I wish it was possible to have horizontal width extendable freely (set size constraint only in vertical).
Re: Tabs/Dialog with hidden/extendable content
Managed to achieve what I wanted.
To conclude: layouts are powerful!