PDA

View Full Version : QDockWindow that goes not to the bottom?



eiswand
5th December 2010, 13:27
Hello!

Is it possible to design such a layout:
http://img255.imageshack.us/i/52503348.png/
?
I want a QListWidget at the bottom that goes to the left border of the Window. On the left side I also want a QDockWidget, but this QDockWidget should NOT go to the bottom of the window (just like in the screenshot which I made with paint).
Additionally the QDockWidget should resize (vertically) if I resize the QListWidget.

How is this possible in Qt?

Thanks!

franz
5th December 2010, 18:49
Is it possible to design such a layout:
http://img255.imageshack.us/i/52503348.png/?
Yes.



I want a QListWidget at the bottom that goes to the left border of the Window. On the left side I also want a QDockWidget, but this QDockWidget should NOT go to the bottom of the window (just like in the screenshot which I made with paint).

Play around with QMainWindow::setCorner() (http://doc.trolltech.com/latest/qmainwindow.html#setCorner).



Additionally the QDockWidget should resize (vertically) if I resize the QListWidget.

The list widget's size should be automatically linked to the dock widget size when using QDockWidget::setWidget() (http://doc.trolltech.com/latest/qdockwidget.html#setWidget).

eiswand
5th December 2010, 19:47
Thanks for your reply franz!

I have already played around with QMainWindow::setCorner(), but unfortunately without success. The problem is that setCorner() just specifies which corner belongs to which QDockWidget. But I don't want a bottom DockWidget at all, so there actually is no
"conflict" about a corner. As you can see in my picture I want the ListWidget to be under the left DockWidget. But it seems like this is not possible because the DockWidget is always in (one of the four) dock panels and the ListWidget is in the central widget. The central widget and the dock panels are just separate areas. It looks like the only possibility is to add a DockPanel inside the central widget, but I guess thats impossible? :/

franz
5th December 2010, 19:56
Maybe you could explain why you want the list widget on the bottom, below the dock area? I find it hard to imagine why you would want that. (might just be my poor imagination. Can't help it...)

eiswand
5th December 2010, 20:08
Well, it's just an aesthetical reason. I need 2 DockWidgets for toolboxes: One on the left side and one on right side. The right toolbox always is the main toolbox (the important one). The left one is just a helper toolbox. In the bottom area I need a console to notify the user about
certain events. I just don't want the left DockWidget to go down through the bottom cause if makes the console so small and in between the DockWidgets (for me it just does not feel right).

I made a little screenshot of VS 2010 that shows exactly the layout I also want:
http://img338.imageshack.us/i/vs2010.png/

Do you have an idea how I could do this? (Letting the DockWidget bottom stop where the ListWidget begins)

franz
5th December 2010, 20:19
The visual studio screen shot shows three dock areas and a central area (text editor), but I know visual studio allows you to place the windows practically everywhere, which might mean that it isn't really a central widget but the top dock area. If you put your list widget inside a dock window and muck about with setCorner a bit you should have the effect you want.

eiswand
5th December 2010, 20:52
Mh, I think I've got it! . I made what you suggested (placed 3 DockWidgets) and it now looks like this:
http://img338.imageshack.us/i/dock2.png/

Guess that looks ok. :D
Thanks for your help!

B4adle7
23rd February 2012, 19:14
Thank you for the notes.

I wasn't sure what you had actually done since it doesn't seem that the work was discussed or what had solved the issue.

However It was noted about .setCorner() This looks promising. I shall explore this and see if it helps me be able to have the right side dock widget take over the bottom and top corners.