PDA

View Full Version : Dockable windows



blaylockr
7th August 2008, 17:19
What is the best way to create an application like the "QT Main Window Demo" using Qt Designer?

jpn
8th August 2008, 17:38
"Just do it"? :) Have you tried if yourself? Did you experience any problems?

jirach_gag
11th August 2008, 10:21
Yes ! "Just Do It" it helps

jpn
11th August 2008, 14:03
Yes ! "Just Do It" it helps
Well, Qt Designer supports designing dock widgets so that's all I have to say unless the original poster elaborates the problem. The more specific question one comes up with the more specific answer s/he usually gets. If the problem is about how to place a dock widget on the form, here is what Qt Designer manual has to say about it: Dock Widgets (http://doc.trolltech.com/4.4/designer-using-containers.html#dock-widgets).

blaylockr
11th August 2008, 14:28
I placed several dock widgets in a "main window" inside a "grid layout" . The problem is that the "grid layout" does not perfectly fill the "main window" and does not resize with the window. This works in the "demo" but they, of course, don't use the designer.:(

jpn
11th August 2008, 15:50
I placed several dock widgets in a "main window" inside a "grid layout".
Placing a dock widget into a grid layout kills most of its features. It won't be a dockable widget anymore. QMainWindow has a special layout which can handle dock widgets like they should. That's why Qt Designer offers a main window template, like mentioned in the Qt Designer manual link in my previous post.


The problem is that the "grid layout" does not perfectly fill the "main window" and does not resize with the window.
Floating layouts don't follow the size of the form. Deselect all children and select a layout from the toolbar instead. That way you'll install so called top level layout which will follow the form size.

yosetl
24th August 2008, 06:06
I placed several dock widgets in a "main window" inside a "grid layout" . The problem is that the "grid layout" does not perfectly fill the "main window" and does not resize with the window. This works in the "demo" but they, of course, don't use the designer.:(

I have successfully re-create the DockWidget sample using Qt Designer to create all the user interface; including the dock. After the GUI complete I just add code to fill in the widget and add code for signal-slot.

One thing to remember is to set on the "dockable" property before arranging the widget in the "grid" layout. I got this right after some trial&error :p

PS: I also have to re-create the dock for "Cute Editor" sample from chapter 4 of Daniel Molkentin "The Book of Qt 4" doing the same method.