Results 1 to 2 of 2

Thread: QDockWidget initial size

  1. #1
    Join Date
    Oct 2010
    Posts
    95
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Question QDockWidget initial size

    Hi,

    I use Qt Designer and try to set the initial size of a QDockWidget... but no way.

    I have try the following :

    - Change the sizes with the Qt Designer, it the designer it looks good but not when I launch the application.
    - Play with the following methods : resize, updateGeometry, setGeometry, raise
    - Implement sizeHint this way :
    virtual QSize sizeHint() const
    {
    return QSize(247, 241);
    }

    Of course, I have try on both the QDockWidget and the child widget !

    Only the setFixedWidth works... but then the width is fixed :-P

    What is strange is that the 'window::restoreState' update the layout correctly !

    Thanks
    Last edited by pl01; 22nd March 2013 at 09:55.

  2. #2
    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: QDockWidget initial size

    The initial size of the docked (I assume, you did not say) dock widget is set by the layout of the QMainWindow you insert it in. That size is constrained by maximum and minimum sizes you set on the dock content and central widgets but is otherwise under the control of the layout.

    If you can provide a small example program that shows what you have done, explain what you expected, and how the result is not as expected, the perhaps we could give more specific guidance.

Similar Threads

  1. initial size of widgets in a QSplitter
    By momesana in forum Newbie
    Replies: 3
    Last Post: 12th July 2012, 15:41
  2. initial size of docked window
    By GrahamLabdon in forum Newbie
    Replies: 3
    Last Post: 28th February 2011, 15:33
  3. Replies: 2
    Last Post: 16th April 2010, 23:55
  4. Adjust the initial size of a QTextEdit in a layout
    By hecinho in forum Qt Programming
    Replies: 0
    Last Post: 26th November 2009, 15:58
  5. How to set initial QDockWidget's size?
    By rajesh in forum Qt Programming
    Replies: 4
    Last Post: 16th November 2006, 15:49

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.