Results 1 to 4 of 4

Thread: QDockWidget Problem.

  1. #1
    Join Date
    Jul 2010
    Posts
    38
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question QDockWidget Problem.

    Hi Friends,

    I have some problem regarding to the positioning of the QDockWidget on the QMainWindow. I have 3 dockwidget in my main window [centre widget I put as 0]:

    maindock: left side
    leftdock: right side
    bottomdock: bottom side

    But I am facing some problem:

    1) I have to position the dockwidget in some ratio (Say 3/4 width for maindock, 1/4 width for left dock and 100 px height for bottom widget).

    What I have Done: I have checked two approaches, 1'st is sizeHint() function and another is "savesetting/loadsetting", as I found "savesetting/loadsetting" is more preferable. So I have implemented the approach. But in this case I am not able to maintain the proper ratio[coming some thing 1/2 ratio] of the dockwidgets.

    For sizeHint() I am confused how to implement it.

    2) I want that when I close one dockwidget then another widget should not take the place of others. DockWidget should fix with respect to the position and place. Only user can do the docking.

    Is there any way for the second problem and what I am missing in the first problem.

  2. #2
    Join Date
    Sep 2010
    Posts
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QDockWidget Problem.

    You might have the results you want with the QSplitter class instead of QDockWidgets if it is possible for you.

  3. #3
    Join Date
    Jul 2010
    Posts
    38
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QDockWidget Problem.

    Hi Live...Thanks for the reply but it seems that I can not use the QSplitter in my application as:

    ) I need the floating behavior for the windows.
    ) I need to add some more dock windows later on my application.

    Is there any possible way to do this[Point 2] and what I am missing in point 1...thanks

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: QDockWidget Problem.

    Here is what I think you want:
    • A layout of three panels with some ratio of space allocation.
    • Each panel can contain zero or more QDockWidgets.
    • When panel contains no docked widgets it remains present in the layout and empty.

    Have you tried using splitters or another layout method to place three QMainWindows inside your application's main window central widget. The QDockWidgets can be docked with these subordinate QMainWindows rather than the top level one.

  5. The following user says thank you to ChrisW67 for this useful post:

    pastispast (29th November 2010)

Similar Threads

  1. QDockWidget problem..
    By jajdoo in forum Newbie
    Replies: 3
    Last Post: 17th July 2010, 10:28
  2. QDockWidget pos, size problem
    By waynew in forum Qt Programming
    Replies: 4
    Last Post: 2nd March 2010, 23:02
  3. Qt 4.4 QDockWidget resize problem
    By MarkSutton in forum Qt Tools
    Replies: 2
    Last Post: 27th September 2008, 08:55
  4. Problem with QDockWidget
    By Banjo in forum Newbie
    Replies: 8
    Last Post: 26th March 2008, 22:02
  5. QDockWidget nesting problem..
    By aamer4yu in forum Qt Programming
    Replies: 6
    Last Post: 31st January 2007, 12:23

Tags for this Thread

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.