Results 1 to 2 of 2

Thread: How to set de maximum width of a QGridLayout?

  1. #1
    Join Date
    Mar 2012
    Posts
    14
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default How to set de maximum width of a QGridLayout?

    Hi all,

    I am thinking in a QGridLayout with 4 QLineEdit horizontaly positioned, but I want the total size of the QGridLayout to be limited to 100, for example.

    Is that possible?

    I see the following, but do not understand how to deal with it.

    Qt Code:
    1. quaternionLayout->setSizeConstraint(QLayout::SetMaximumSize());
    To copy to clipboard, switch view to plain text mode 
    Thanks in advance.

  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: How to set de maximum width of a QGridLayout?

    Place the layout in the widget and set the maximum width for the widget to 100. However this is usually a bad idea to constrain widget sizes this way.
    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.


Similar Threads

  1. Fix proportion of width and height in QGridLayout
    By Wong in forum Qt Programming
    Replies: 6
    Last Post: 7th January 2011, 08:24
  2. Replies: 1
    Last Post: 13th August 2010, 07:28
  3. maximum text width of interval
    By osiris81 in forum Qt Programming
    Replies: 2
    Last Post: 20th January 2010, 15:37
  4. QToolBox width fixed to maximum content width
    By ghorwin in forum Qt Programming
    Replies: 0
    Last Post: 10th July 2009, 10:58
  5. Maximum number of characters in width
    By ralphmerridew in forum Qt Programming
    Replies: 3
    Last Post: 27th May 2008, 02: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.