Results 1 to 8 of 8

Thread: QDockWindow that goes not to the bottom?

  1. #1
    Join Date
    Nov 2010
    Posts
    8
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default QDockWindow that goes not to the bottom?

    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!

  2. #2
    Join Date
    Jul 2009
    Location
    Enschede, Netherlands
    Posts
    462
    Thanked 69 Times in 67 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QDockWindow that goes not to the bottom?

    Quote Originally Posted by eiswand View Post
    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().

    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().
    Horse sense is the thing that keeps horses from betting on people. --W.C. Fields

    Ask Smart Questions

  3. #3
    Join Date
    Nov 2010
    Posts
    8
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QDockWindow that goes not to the bottom?

    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? :/

  4. #4
    Join Date
    Jul 2009
    Location
    Enschede, Netherlands
    Posts
    462
    Thanked 69 Times in 67 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QDockWindow that goes not to the bottom?

    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...)
    Horse sense is the thing that keeps horses from betting on people. --W.C. Fields

    Ask Smart Questions

  5. #5
    Join Date
    Nov 2010
    Posts
    8
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QDockWindow that goes not to the bottom?

    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)
    Last edited by eiswand; 5th December 2010 at 20:14.

  6. #6
    Join Date
    Jul 2009
    Location
    Enschede, Netherlands
    Posts
    462
    Thanked 69 Times in 67 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QDockWindow that goes not to the bottom?

    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.
    Horse sense is the thing that keeps horses from betting on people. --W.C. Fields

    Ask Smart Questions

  7. The following user says thank you to franz for this useful post:

    eiswand (5th December 2010)

  8. #7
    Join Date
    Nov 2010
    Posts
    8
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QDockWindow that goes not to the bottom?

    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.
    Thanks for your help!
    Last edited by eiswand; 5th December 2010 at 20:59.

  9. #8
    Join Date
    Feb 2012
    Location
    Los Angeles
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QDockWindow that goes not to the bottom?

    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.
    Last edited by B4adle7; 23rd February 2012 at 19:24.

Similar Threads

  1. Why QStatusBar do not at the bottom?
    By FinderCheng in forum Qt Programming
    Replies: 5
    Last Post: 29th September 2009, 08:26
  2. Replies: 7
    Last Post: 15th November 2007, 17:19
  3. widgets on bottom
    By kernel_panic in forum Qt Programming
    Replies: 6
    Last Post: 19th October 2007, 20:07
  4. Strange performance of QDockWindow?
    By luffy27 in forum Qt Programming
    Replies: 4
    Last Post: 18th April 2007, 19:10
  5. [QDockWindow] destroy
    By villy in forum Qt Programming
    Replies: 8
    Last Post: 1st December 2006, 11:06

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.