How to default to the smallest possible size for a QDockWidget?
I have the following code:
- QWidget *mainVSubsetWidget = new QWidget;
- QVBoxLayout *mainVSelectLayout = new QVBoxLayout;
- QVBoxLayout *cubeVolSelectLayout = new QVBoxLayout;
- QVBoxLayout *buttonVolSelectLayout = new QVBoxLayout;
- d_voxSubset = d_3dWidget->geoContext()->newCube();
- QWidget * selectWidget = d_voxSubset->infoWidget();
- d_dockVSubset = new QDockWidget("V Subset",this);
- addDockWidget(Qt::LeftDockWidgetArea, d_dockVSubset);
So the widget is hidden by default. When I first open it up, it looks like this docked:
initial docked [docs.google.com]
and this undocked:
initial undocked [docs.google.com]
I can grab the corner or resize bar and make it smaller, to this size:
minimum docked [docs.google.com]
minimum undocked [docs.google.com]
How do I do that in code? I want it to be shown as small as possible in the width direction, but be able to grow as needed when docked, if other docked widgets are added that are wider.
I’m fairly new to Qt, and I have looked through the documentation and looked at using the sizeHint and such, but I’m not getting anything to work, so I must be missing something.
Thanks for the help,