Results 1 to 3 of 3

Thread: the default width of QDockWidget

  1. #1
    Join Date
    Mar 2009
    Location
    Gansu,China
    Posts
    188
    Qt products
    Qt4
    Platforms
    Windows

    Default the default width of QDockWidget

    In QMainWindow,I create three QDockWidget,and add them with the following code:

    Qt Code:
    1. addDockWidget(Qt::LeftDockWidgetArea, treeDock);
    2. addDockWidget(Qt::RightDockWidgetArea, viewDock1);
    3. addDockWidget(Qt::RightDockWidgetArea, viewDock2);
    To copy to clipboard, switch view to plain text mode 

    Now I have two questions:
    1. how to set the default size of treeDock? for its default size is half of the mainwindow,and it is too wide.
    2.viewDock1 and viewDock2 aligned vertically? how to let them align horizonally?

    Thanks.

  2. #2
    Join Date
    Mar 2009
    Location
    Gansu,China
    Posts
    188
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: the default width of QDockWidget

    any one help me?

  3. #3
    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: the default width of QDockWidget

    1. From the QDockWidget docs:
    Custom size hints, minimum and maximum sizes and size policies should be implemented in the child widget. QDockWidget will respect them, adjusting its own constraints to include the frame and title.
    If your dock widget content has a layout then the size constraint set on the layout will dictate some or all of these values.

    2. See dockNestingEnabled

Similar Threads

  1. QDockWidget default size ?
    By pl01 in forum Newbie
    Replies: 2
    Last Post: 20th December 2010, 09:10
  2. QTableWidget Default width of row and column
    By sagirahmed in forum Newbie
    Replies: 4
    Last Post: 11th October 2010, 04:01
  3. simple question,set width of QTreewidget or QDockWidget
    By weixj2003ld in forum Qt Programming
    Replies: 0
    Last Post: 17th May 2010, 01:52
  4. Header Width of QDockWidget in Qt4.3.3?
    By vishal.chauhan in forum Qt Programming
    Replies: 1
    Last Post: 8th February 2008, 09:11
  5. different arrangement of QDockWidget than default
    By Wurgl in forum Qt Programming
    Replies: 3
    Last Post: 13th July 2006, 10:41

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.