Results 1 to 4 of 4

Thread: QLayout question

  1. #1
    Join Date
    Dec 2008
    Location
    Istanbul, TURKEY
    Posts
    537
    Thanks
    14
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Windows Android

    Default QLayout question

    Hi,

    Suppose that we have a QHBoxLayout and inside it;

    1. we have 2 inner QVBoxLayouts

    2. QSpacerItem(with "expanding" size policy) between those 2 QVBoxLayouts

    I wonder how parent QHBoxLayout organizes those three things? How inner boxlayouts resized relative to qspacer?

    Not: QSpacerItem has expanding size policy and inner layouts have sizeDefaultConstraint

    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: QLayout question

    Quote Originally Posted by zgulser View Post
    I wonder how parent QHBoxLayout organizes those three things? How inner boxlayouts resized relative to qspacer?
    It depends on size policies of the objects in question.
    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. #3
    Join Date
    Dec 2008
    Location
    Istanbul, TURKEY
    Posts
    537
    Thanks
    14
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Windows Android

    Default Re: QLayout question

    I actually wanted to ask how layout treats inner layouts along with other widgets inside it when resizing is performed.

    Widgets have size policy but layouts are a bit different(i.e. sizeDefaultConstraint). That's why I asked the question.

  4. #4
    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: QLayout question

    This is a hierarchy. The layout behaves according to its contents. If the contents means more layouts, they are being looked into. In the end it's widgets that matter. You can experiment by launching Qt Designer, forming hierarchies of widgets and layouts and resizing the top-level window to see how the space is being managed.
    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. set QLayout to QDockWidget
    By WilliamSpiderWeb in forum Newbie
    Replies: 3
    Last Post: 4th March 2011, 23:29
  2. QLayout Problem
    By sivollu in forum Newbie
    Replies: 0
    Last Post: 2nd February 2010, 06:27
  3. QLayout on scenes
    By baray98 in forum Qt Programming
    Replies: 2
    Last Post: 18th November 2008, 17:22
  4. QLayout
    By sudeepdua in forum Qt Programming
    Replies: 2
    Last Post: 21st November 2006, 10:46
  5. A bug of QLayout
    By cocalele in forum Qt Programming
    Replies: 6
    Last Post: 26th April 2006, 06:10

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.