Results 1 to 3 of 3

Thread: QDockWidget with Grid Layout avoid content stretching

  1. #1
    Join Date
    Apr 2013
    Posts
    63
    Thanks
    15
    Qt products
    Qt4
    Platforms
    Windows

    Default QDockWidget with Grid Layout avoid content stretching

    I have a Dock widget and I am setting a container QWidget for that. I am using Grid Layout for that container layout. I have two items added to row 1 and row 2 of the grid layout. The problem is that the Grid Layout is stretched to all four sides of Dock Widget. I would like the items to appear on top of the Dock Widget. How to Do that?

  2. #2
    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: QDockWidget with Grid Layout avoid content stretching

    Place a spacer item (in Designer) or a vertical stretch (in code) under your widgets.
    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.


  3. The following user says thank you to wysota for this useful post:

    mqt (6th September 2013)

  4. #3
    Join Date
    Apr 2013
    Posts
    63
    Thanks
    15
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QDockWidget with Grid Layout avoid content stretching

    Qt Code:
    1. setRowStretch(last_row,1)
    To copy to clipboard, switch view to plain text mode 
    worked

Similar Threads

  1. Replies: 3
    Last Post: 19th July 2011, 14:37
  2. Grid Layout problem
    By succorguy in forum Qt Programming
    Replies: 1
    Last Post: 26th April 2009, 23:01
  3. qdirmodel in grid layout
    By babu198649 in forum Newbie
    Replies: 1
    Last Post: 27th July 2008, 08:26
  4. How do I layout in a Grid?
    By DPinLV in forum Qt Tools
    Replies: 7
    Last Post: 10th August 2006, 01:37
  5. Grid layout
    By nupul in forum Qt Programming
    Replies: 7
    Last Post: 21st April 2006, 21:15

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.