Results 1 to 3 of 3

Thread: How disable "QDockWidget expanding" when QMainWindow resize

  1. #1
    Join Date
    May 2013
    Posts
    321
    Thanks
    9
    Thanked 8 Times in 8 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default How disable "QDockWidget expanding" when QMainWindow resize

    Hi all,
    I have a QMainWindow, I init it with two docks on the right area and at the end I show maximized.
    The problem is when the main window is showed maximized the two dock has the same height.
    Is it possible to have the bottom dock stays at the same height when the main window resize ?
    I have the same issue on the bottom dock area, I would have the first stays at the same width.
    How to achieve this result ?
    Thanks for the help

  2. #2
    Join Date
    Dec 2014
    Posts
    49
    Thanks
    6
    Thanked 3 Times in 3 Posts
    Qt products
    Qt5 PyQt3 PyQt4
    Platforms
    Windows

    Default Re: How disable "QDockWidget expanding" when QMainWindow resize

    Do you want the dock widget to stay the same size all the time, meaning it is not resizable, even when QMainWindow is not maximized ? If so, then you can set the QSizePolicy::Fixed for height, and that dock window will not change size, ever.

    If you still want it to be able to be resized, but have only the top window expand, while the bottom one stays the same, then i think you want to set the QSizePolicy::Minimum

    You can learn more about the QSizePolicy and how they affect widgets here

  3. #3
    Join Date
    May 2013
    Posts
    321
    Thanks
    9
    Thanked 8 Times in 8 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How disable "QDockWidget expanding" when QMainWindow resize

    I want it to be able to be resized. The QUndoView is the bottom widget.
    Qt Code:
    1. QUndoView* UndoView = new QUndoView( MainEditorUndoStack, this );
    2. UndoView->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum );
    3. m_UndoHistoryDock->setWidget( UndoView );
    To copy to clipboard, switch view to plain text mode 
    This code has no effect, setSizePolicy on the dock has no effect too.

Similar Threads

  1. Replies: 4
    Last Post: 14th February 2014, 17:57
  2. Replies: 2
    Last Post: 19th October 2012, 09:39
  3. How to disable "app not responding dialog" [QML- MeeGo Harmattan PR1.2]
    By aya_lawliet in forum Qt for Embedded and Mobile
    Replies: 4
    Last Post: 14th May 2012, 11:37
  4. Replies: 1
    Last Post: 1st May 2010, 23:03
  5. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 19:05

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.