Results 1 to 8 of 8

Thread: QDockWidget locations

  1. #1
    Join Date
    Jan 2006
    Posts
    371
    Thanks
    14
    Thanked 18 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QDockWidget locations

    I am trying to convice a layout of 3 dockbars to be placed in a very specific way, and I am missing something.

    I want to put the 3 docks on the borders of the window, and the 2 on the sides to be streched from the top to the bottom, and the 3rd on the middle between them.

    What I can achieve is only that the bottom dock is spanned over the bottom of the window.

    In the attached image the left is what I get, and rigth is what i want (the dock is floating for the screen shot). I saw that FullMetelCoder made this on edyuk, but I failed to find the exact code.
    Attached Images Attached Images

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QDockWidget locations

    Experiment a bit with Dock Widgets -> Bottom Left Corner and Dock Widgets -> Bottom Right Corner menus.

    A small hint: .

  3. #3
    Join Date
    Jan 2006
    Posts
    371
    Thanks
    14
    Thanked 18 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QDockWidget locations

    Even with the risk of sounding too stupid...

    "I don't get it"

    My code looks like:
    Qt Code:
    1. setDockOptions( QMainWindow::ForceTabbedDocks | QMainWindow::VerticalTabs | QMainWindow::AnimatedDocks );
    2. setCorner( Qt::TopLeftCorner, Qt::TopDockWidgetArea );
    3. setCorner( Qt::TopRightCorner, Qt::TopDockWidgetArea );
    4. setCorner( Qt::BottomLeftCorner, Qt::BottomDockWidgetArea );
    5. setCorner( Qt::BottomRightCorner, Qt::BottomDockWidgetArea );
    6.  
    7. tabifyDockWidget( dockBuild, dockOutputs_ );
    8. tabifyDockWidget( dockBuild, dockVariables );
    9. tabifyDockWidget( dockBuild, dockOtherVariables );
    10. tabifyDockWidget( dockBuild, dockFindInFiles );
    11. tabifyDockWidget( dockFiles, dockClasses );
    12. tabifyDockWidget( dockCallsStack, dockRegisters );
    To copy to clipboard, switch view to plain text mode 

    All tabs are already docked into the main window (they have been set non float docks in the designer).

    I read the hints, but it seems I need more help. Sorry

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QDockWidget locations

    So shouldn't the bottom left corner be associated with the left dock area and bottom right one with the right dock area instead of being associated with the bottom dock area?

  5. #5
    Join Date
    Jan 2006
    Posts
    371
    Thanks
    14
    Thanked 18 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QDockWidget locations

    Is this what you mean? Not working here:

    Qt Code:
    1. setCorner( Qt::TopLeftCorner, Qt::LeftDockWidgetArea );
    2. setCorner( Qt::TopRightCorner, Qt::RightDockWidgetArea );
    3. setCorner( Qt::BottomLeftCorner, Qt::BottomDockWidgetArea );
    4. setCorner( Qt::BottomRightCorner, Qt::BottomDockWidgetArea );
    5.  
    6. addDockWidget( Qt::BottomDockWidgetArea, dockBuild );
    7. addDockWidget( Qt::BottomDockWidgetArea, dockOutputs );
    8. addDockWidget( Qt::BottomDockWidgetArea, dockVariables );
    9. addDockWidget( Qt::BottomDockWidgetArea, dockOtherVariables );
    10. addDockWidget( Qt::BottomDockWidgetArea, dockFindInFiles );
    11. addDockWidget( Qt::LeftDockWidgetArea , dockFiles );
    12. addDockWidget( Qt::LeftDockWidgetArea , dockClasses );
    13. addDockWidget( Qt::RightDockWidgetArea , dockCallsStack );
    14. addDockWidget( Qt::RightDockWidgetArea , dockRegisters );
    15.  
    16. tabifyDockWidget( dockBuild, dockOutputs );
    17. tabifyDockWidget( dockBuild, dockVariables );
    18. tabifyDockWidget( dockBuild, dockOtherVariables );
    19. tabifyDockWidget( dockBuild, dockFindInFiles );
    20. tabifyDockWidget( dockFiles, dockClasses );
    21. tabifyDockWidget( dockCallsStack, dockRegisters );
    To copy to clipboard, switch view to plain text mode 

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QDockWidget locations

    Hmm... I meant:
    Qt Code:
    1. setCorner( Qt::TopLeftCorner, Qt::LeftDockWidgetArea );
    2. setCorner( Qt::TopRightCorner, Qt::RightDockWidgetArea );
    3. setCorner( Qt::BottomLeftCorner, Qt::LeftDockWidgetArea );
    4. setCorner( Qt::BottomRightCorner, Qt::RightDockWidgetArea );
    To copy to clipboard, switch view to plain text mode 

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

    Seishin (19th October 2013)

  8. #7
    Join Date
    Jan 2006
    Posts
    371
    Thanks
    14
    Thanked 18 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QDockWidget locations

    I don't understand how, but it works. Thanks

  9. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QDockWidget locations

    The bottom left corner is to be occupied by the left dock location and not the bottom location, etc. This way the left dock spans the corner and not the bottom one.

Similar Threads

  1. Default size of a QListWidget inside a QDockWidget
    By rakuco in forum Qt Programming
    Replies: 0
    Last Post: 25th July 2007, 08:01
  2. Replies: 8
    Last Post: 4th February 2007, 00:42
  3. QDockWidget flicker
    By fellobo in forum Qt Programming
    Replies: 1
    Last Post: 28th April 2006, 20:42
  4. QTableWidget -> QDockWidget,
    By ogre in forum Qt Programming
    Replies: 3
    Last Post: 26th January 2006, 06:51
  5. QDockWidget: Debugging crash
    By carsten in forum Qt Programming
    Replies: 10
    Last Post: 7th January 2006, 10:50

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
  •  
Qt is a trademark of The Qt Company.