How to default to the smallest possible size for a QDockWidget?
I have the following code:
- d_voxSubset = d_3dWidget->geoContext()->newCube();
- cubeVolSelectLayout->addWidget(selectWidget);
- mainVSelectLayout->addLayout(cubeVolSelectLayout);
- connect(resetVolSelectButton,SIGNAL(clicked()),this,SLOT(resetVSubset()));
- mainVSelectLayout->addLayout(buttonVolSelectLayout);
- resetVolSelectButton->setDefault(true);
- mainVSubsetWidget->setLayout(mainVSelectLayout);
- d_dockVSubset->setWidget(mainVSubsetWidget);
- showVSubset(0);
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]
and this:
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,
HeatherKM
0 replies
You must log in to post a reply. Not a member yet? Register here!
