Results 1 to 3 of 3

Thread: QMainWindow Central Widget - how to maximize size and make dockwidgets minimum size?

  1. #1
    Join Date
    Jul 2007
    Posts
    56
    Thanks
    6
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Question QMainWindow Central Widget - how to maximize size and make dockwidgets minimum size?

    I have a QMainWindow that has a central widget. There are a bunch of dockwidgets in the main window also. I'd like to maximize the size of the central widget within the window, and minimize the sizes of the dockwidgets (same as manually moving the size rectangle around the central widget.

    When I try and set the size of the central widget to maximum it doesn't make the dockwidgets go to their minimum size. Should I be doing the reverse - set each of the dockwidgets to their minimum sizes?

    Thanks

  2. #2
    Join Date
    Jan 2006
    Posts
    667
    Thanks
    10
    Thanked 80 Times in 74 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QMainWindow Central Widget - how to maximize size and make dockwidgets minimum si

    Try setting size policy to minimum for your dock widgets.
    Qt Code:
    1. setSizePolicy ( QSizePolicy::Policy Minimum, QSizePolicy::Policy Minimum )
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Jul 2007
    Posts
    56
    Thanks
    6
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QMainWindow Central Widget - how to maximize size and make dockwidgets minimum si

    Unfortunately that doesn't seem to work. If I replace the central widget with another one, the docks all expand to take up space. I need a way to push them all back to their smallest size.

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.