Results 1 to 2 of 2

Thread: How to layout verticalyl two widgets in a fiz % ratio.

  1. #1
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default How to layout verticalyl two widgets in a fiz % ratio.

    I have 2 widgets. I'd want to have the 40% of vertical space for the first and the remainder for the second.
    And, pleas, can anybody explain me the strecht values ? Maybe it can be useful to do what I want ?
    Thanls

  2. #2
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: How to layout verticalyl two widgets in a fiz % ratio.

    Stretch values represents the amount of total available space that will be assigned to each widget, for example if you have two widgets in a box layout and set stretch values 1 and 3, then layout manager will try to divide the available space such that second widget gets 3x more the space than first - so first will get 25% of total available space.
    You can think about this values as : 1 part for first widget, 3 parts for second.
    ---
    this is explained with an example in documentation: Layout Management : Stretch Factors
    Last edited by stampede; 3rd August 2011 at 10:39. Reason: updated contents

  3. The following 3 users say thank you to stampede for this useful post:

    gkarthick5 (30th August 2011), NullPointer (4th August 2011), tonnot (3rd August 2011)

Similar Threads

  1. How to Verticalyl right align Title Bar QDockWidget
    By vaibhav in forum Qt Programming
    Replies: 1
    Last Post: 29th June 2011, 12:54
  2. Replies: 5
    Last Post: 18th April 2010, 23:31
  3. Widgets Layout in a QToolBar.
    By cydside in forum Qt Programming
    Replies: 1
    Last Post: 27th June 2009, 08:46
  4. Custom widgets in layout
    By Palmik in forum Newbie
    Replies: 11
    Last Post: 26th January 2009, 12:08
  5. aspect ratio of top-level widgets
    By urbangipsy in forum Qt Programming
    Replies: 3
    Last Post: 16th January 2007, 21:49

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
  •  
Qt is a trademark of The Qt Company.