View Full Version : Show/hide part of dialog with resizing.

19th May 2006, 20:39
Here's the basic outline of a dialog I have designed:

|Gridlayout->contains "show more" button |
|Gridlayout-> contains more stuff |

Now, what I want to have happen is when the "more" button is pressed, the dialog expands, and the rest of the options are displayed. When it is pressed again, those extra options should just diappear and the dialog should be resized appropriately.

What actually happens is the top gridlayout expands to the size of the whole dialog box. When the more button is pressed, the dialog box is not resized, but the second layout is shown, squishing both within the dialog box.

I've tried setting the layouts, sizes, size preferences, etc to everything I can think of, but it never behaves the way I want it to.

There's an example in the Tutorials/Examples in the docs on trolltech's site http://doc.trolltech.com/4.1/dialogs-extension.html, and I can follow that and get things to work using their set up, but I can't figure out how to do the same thing using just the designer. Does anyone have any suggestions?

24th May 2006, 21:11
No one has any ideas? I suppose I could just do it in code like the example shows, but using the designer would definitly be the best way if it worked.

24th May 2006, 22:33
But what exactly doesn't work? Which part you're not able to do with designer?

24th May 2006, 22:51
That's as close as I can get with doing everything from within designer. Two lines of external code needed.

25th May 2006, 15:36
Oh thanks, the problem was I needed to stick in one more line:

I thought that was something that could be set in the designer. Really, I wish more of the examples would be done in the disigner and not straight code, or perhaps both, it'd make it easier to know which settings can be set and where.

7th June 2006, 08:04
i want to hide widget(s). But with that i want to shrink the size of Dialog.
i am using 4 or 5 QGroupBox and under it other widgets. when i hide one QGroupBox using hide(), other boxes adjust there size in free space. I want to shrink the Dialog Box when i hide the QGroupBox .

7th June 2006, 08:22
You can use the same solution. Take a look at the archive in my previous post in this thread.