Results 1 to 4 of 4

Thread: How can I increase the size of a DockWidget in a MainWindow?

  1. #1
    Join Date
    Feb 2008
    Posts
    36
    Thanks
    4

    Default How can I increase the size of a DockWidget in a MainWindow?

    Hi all,

    I am using Qt 4.3.3 on Debian Linux. The MainWindow in my program has a DockWidget in the rightarea. The DockWidget has QLineEdits (20 rows, 2 columns) added with QGridLayout. During program execursion numbers (QStrings) are displayed in the QLineEdits. The only problem is that the Number strings is to long for the QLineEdits. It is possible to increase the size of the DockWidget area manually by dragging it to the left. My question is: is there a way to make the DockWidget a bit wider or make the RightDockWidgetArea wider?

    Thanks in advance!
    Attached Images Attached Images

  2. #2
    Join Date
    Feb 2008
    Posts
    98
    Thanks
    2
    Thanked 24 Times in 24 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How can I increase the size of a DockWidget in a MainWindow?

    Just use resize().
    Last edited by victor.fernandez; 2nd September 2009 at 13:40. Reason: added link

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

    Default Re: How can I increase the size of a DockWidget in a MainWindow?

    You can set the minimumSize or size constraint on the contents of QDockWidget. Just make sure you don't apply it to the dock widget but to its contents.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  4. #4
    Join Date
    Feb 2008
    Posts
    36
    Thanks
    4

    Default Re: How can I increase the size of a DockWidget in a MainWindow?

    Thank you!

    I used the setMinimumWidth(int) function on the Widget which worked nicely.

Similar Threads

  1. How to increase font size in arm target
    By soumya in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 2nd September 2009, 06:58
  2. Increase the size of radio buttons
    By arunvv in forum Qt Programming
    Replies: 7
    Last Post: 24th January 2009, 01:09
  3. How to increase size of QGraphicsView Dynamically
    By Kingofhearts_sri in forum Qt Programming
    Replies: 1
    Last Post: 23rd January 2009, 09:54
  4. Replies: 1
    Last Post: 11th September 2007, 14:34
  5. Replies: 2
    Last Post: 29th May 2007, 14:55

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.