Results 1 to 3 of 3

Thread: Layout question

  1. #1
    Join Date
    Sep 2012
    Posts
    44
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Layout question

    Hi,

    i have a question about the layout in Qt.
    Let's say we have a simple QWidget and inside i place for instance two QFrames.I want to layout them horizontally so i use QVLayout.OK, they fill the space proportionally 50% for the first one and 50% for second one.My question is how i can change this for instance 30% to 70% or each of QFrames to have custom size but to be aslo with layout.I use Qt Designer and i need a layout because manually i can't set precisely the widgets.

  2. #2
    Join Date
    May 2010
    Location
    Romania
    Posts
    1,021
    Thanks
    62
    Thanked 260 Times in 246 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Layout question

    Take the QSizePolicy of the widgets, set horizontal (or vertical) stretch factor and then set the size policy back to the widget.

  3. #3
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,540
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Layout question

    Set layoutStretch to (7,3)

Similar Threads

  1. Beginner layout question
    By frankiefrank in forum Qwt
    Replies: 1
    Last Post: 10th March 2011, 17:37
  2. Question about layout and memory leak
    By franco.amato in forum Newbie
    Replies: 3
    Last Post: 15th October 2010, 18:50
  3. Fixed-height layout question
    By TheJim01 in forum Newbie
    Replies: 1
    Last Post: 16th March 2010, 20:37
  4. Layout question (Twitter-client-like app)
    By piotrj in forum Newbie
    Replies: 1
    Last Post: 10th January 2010, 08:47
  5. A question about adding to layout
    By Cruz in forum Qt Programming
    Replies: 1
    Last Post: 20th January 2009, 12:41

Tags for this Thread

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.