Results 1 to 4 of 4

Thread: Mainwindow layout problem with QDockWidget.

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

    Default Mainwindow layout problem with QDockWidget.

    Hi Friends,


    I have to create a custom layout for my main application. Layout can be of different type as:


    Qt Code:
    1. |--------------------------------------|
    2. | | | |
    3. | 2 | | 4 |
    4. |-----| 1 |-----|
    5. | |-----------| |
    6. | 3 | 7 | 5 |
    7. |-----------------------|
    8. | 6 |
    9. |-----------------------|
    To copy to clipboard, switch view to plain text mode 


    Here all no's(1...) are the dockwidgets. But I am facing following problems to do so:

    1) As DockWidgetAreas have only the following layout option:

    Qt::LeftDockWidgetArea
    Qt::RightDockWidgetArea
    Qt::TopDockWidgetArea
    Qt::BottomDockWidgetArea
    Qt::AllDockWidgetAreas
    Qt::NoDockWidgetArea

    then how can I add the position for other windows.

    2) Positioning of the 'QDockWidget': When I am positioning the docs using the move and resize functions then it does not work properly.

    Note:

    I have done the following try:

    Try 1: I have tried the sizeHint() and save/load geometry but it does not worked.

    Try 2: I have tried the layout on centerwidget using splitter and gridlayout but it does not give me the proper docking feature as the dock-widgets was the child of centerwidget. I am facing the following problem in this:

    - Unable to auto dock in the another dock area while moving the window as dock feature.
    - While undocking window moves up.

    Please provide me some idea or solution on this issue....I have attached the zip file for the "Try 2"

    or

    Is there any way to do this by removing center widget and add dock directly to the main window in the specified layout.

    It will be very helpful for me if you work on the attached examples.


    Compiler Used: Visual Studio [GCC will also work but not tested]

    Thanks in advance...
    Attached Files Attached Files

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

    Default Re: Mainwindow layout problem with QDockWidget.

    if I work on Try 1:

    Is there any way to do this by removing center widget and add dock directly to the main window in the specified layout.
    Here I tried using the above way(with out removing the center widget as it gives some other problems).

    I have attached zip file of my work-through.
    Attached Files Attached Files

  3. #3
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Mainwindow layout problem with QDockWidget.

    What do you mean by layout ? You want to add dock widgets to those layouts ?
    If yes, then I guess its a tedious task,, and you may refer to Qt designer code how they do it.

    If you simply want to achieve the above layout,,, it can be made out of hor/ver layout..
    2/3 - ver
    1/7 - ver ( with more space to 1)
    4/5 - ver

    Then these 3 ver layouts in hor layout.
    and finally the hor layout in ver layout with 6.

    Hope you get the idea ..

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

    Default Re: Mainwindow layout problem with QDockWidget.

    Hi Aamer...thanks for the reply...

    Actually I want to add dock widgets on that layout (Or something widget like that have all dock features).

Similar Threads

  1. mainwindow layout vs widget layout
    By fatecasino in forum Newbie
    Replies: 2
    Last Post: 14th December 2010, 14:45
  2. Replies: 5
    Last Post: 30th November 2010, 06:40
  3. QDockWidget Problem.
    By pastispast in forum Qt Programming
    Replies: 3
    Last Post: 9th October 2010, 03:35
  4. QDockWidget problem..
    By jajdoo in forum Newbie
    Replies: 3
    Last Post: 17th July 2010, 10:28
  5. Problem with QDockWidget
    By Banjo in forum Newbie
    Replies: 8
    Last Post: 26th March 2008, 22:02

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.