Results 1 to 8 of 8

Thread: QVBoxLayout width size limit

  1. #1
    Join Date
    Jul 2007
    Posts
    121
    Thanks
    38
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default QVBoxLayout width size limit

    I am using Qt Designer and I cannot figure out how to set up maximum width size of QVBoxLayout. Say, I have a listview and I enclose it in QVBoxLayout. I can set up maximum width size of listview, but when I stretch layout horizontally the widget itself reaches maximum size and stays there, but QVBoxLayout continues to grow.

  2. #2
    Join Date
    Sep 2008
    Location
    Bangalore
    Posts
    659
    Thanks
    116
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QVBoxLayout width size limit

    try changing layoutsizeconstraint property ..
    "Behind every great fortune lies a crime" - Balzac

  3. #3
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QVBoxLayout width size limit

    but when I stretch layout horizontally the widget itself reaches maximum size and stays there, but QVBoxLayout continues to grow.
    Reply With Quote
    You could set some max size onthe widget u are stretching,,, cant you ?

  4. #4
    Join Date
    Jul 2007
    Posts
    121
    Thanks
    38
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Unhappy Re: QVBoxLayout width size limit

    wagmare: That the first thing I did, changed layoutsizeconstraint. I can change the value of it to "SetMinimumSize', or "setMaximumSize", but I don't see the way to set this size anywhere. There are 4 ...Margin parameters, one Spacing and one Stretch, that's all.

    Still confused..

  5. #5
    Join Date
    Sep 2008
    Location
    Bangalore
    Posts
    659
    Thanks
    116
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QVBoxLayout width size limit

    i think u will try this one also .. but any way consider this ..

    in stretch .. try to change the sizeType to fixed and now u try to change width and height of that stretch property .. it will makes in fixed position

    mr.Ameer also suggest the same ..
    "Behind every great fortune lies a crime" - Balzac

  6. #6
    Join Date
    Jul 2007
    Posts
    121
    Thanks
    38
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QVBoxLayout width size limit

    Well, I did the following:

    Again, in QtDesigner, I have a widget (with fixed maximum width set to 150) inside QVBoxLayout. I changed property "layoutSizeConstraint" to "SetFixedSize" and I changed "layoutStretch" property to 200,250. After these properties are changed I can still enlarge layout size to whatever I want by dragging lower-right corner of it.

    Repeating this process by changing "layoutSizeConstraint" to "SetMaximumSize" also does not prevent layout to be enlarged

  7. #7
    Join Date
    Apr 2006
    Location
    Denmark / Norway
    Posts
    67
    Thanks
    3
    Thanked 12 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: QVBoxLayout width size limit

    Does the size stay fixed in your compiled app?

    If so, it's probably how Qt Designer is built. If you want to resize with the mouse, it let's you do it. (which is logical enough).

  8. The following user says thank you to luf for this useful post:

    QPlace (18th June 2009)

  9. #8
    Join Date
    Jul 2007
    Posts
    121
    Thanks
    38
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Smile Re: QVBoxLayout width size limit

    luf:

    That was it! Indeed, when the project is build the layout behaves properly. What confused me was that when the constrains are set for a widget I can't change the widget size beyong the limits. It is not the case with layouts. IMHO, it is a subtle inconsistency, but to complain about it using Qt - the best GUI framework - that would be rude.

Similar Threads

  1. Scale size of QGraphicsItem without scaling pen width
    By Lodorot in forum Qt Programming
    Replies: 1
    Last Post: 25th May 2009, 01:18
  2. Replies: 4
    Last Post: 15th October 2008, 14:24
  3. Replies: 11
    Last Post: 21st February 2007, 12:26
  4. changing the size of the tab width: QTabWidget
    By nikita in forum Qt Programming
    Replies: 2
    Last Post: 29th August 2006, 09:31
  5. How to get size (length, width ....) of string or char
    By Krishnacins in forum Qt Programming
    Replies: 1
    Last Post: 20th March 2006, 10: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.