Results 1 to 5 of 5

Thread: howto expand frame to maximum size

  1. #1
    Join Date
    Apr 2006
    Location
    the netherlands
    Posts
    17
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question howto expand frame to maximum size

    Hi all,

    I have a layout question.

    I've made a form and put a QToolbox and a QFrame on it. I organized these two widgets by putting them into a QHBoxLayout. Now I want the toolbox on the left side to be of a static witdh so I put the sizePolicy to Fixed (horizontal) and Expanding (vertical). The right frame should occupy the rest of the space (Expanding, Expanding).

    This seems to be ok because if I resize the layout box it behaves like I hoped (and expected) it would :-)

    But now to the question.. how can I make the layout use the entire window? Forgive me that I fall back on my Delphi experience but in Delphi you had the alignement -> alClient option which is exactly what I would like to achieve here.

    Thanks in advance!
    Rob

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: howto expand frame to maximum size

    J-P Nurmi

  3. #3
    Join Date
    Apr 2006
    Location
    the netherlands
    Posts
    17
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: howto expand frame to maximum size

    Sorry but that didn't help me..

    I designed the form in QtDesigner and there is no possibility to set the name of the layout (so to later retrieve it) or to set the margin or spacing property to -1

    this is part of the ui-file

    Qt Code:
    1. <layout class="QHBoxLayout" >
    2. <property name="margin" >
    3. <number>1</number>
    4. </property>
    5. <property name="spacing" >
    6. <number>6</number>
    7. </property>
    8. <item>
    9. .. (widgets)
    10. </item>
    11.  
    12. </layout>
    To copy to clipboard, switch view to plain text mode 

    Should I hack the ui generated file? I guess not. But then what? I do not know the name of the layout so I can't just use code in the constructor like layoutName.setMargin(-1) or something like that.

    Any further help?

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: howto expand frame to maximum size

    Check the last section ("Layout") of the Property Editor, when the window/widget (for which the layout is set) is selected.
    J-P Nurmi

  5. #5
    Join Date
    Apr 2006
    Location
    the netherlands
    Posts
    17
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: howto expand frame to maximum size

    Quote Originally Posted by jpn
    Check the last section ("Layout") of the Property Editor, when the window/widget (for which the layout is set) is selected.
    I did.. but there is no possibility to set either of these values to -1 in QtDesigner.

Similar Threads

  1. maximum size of xml files
    By freeskydiver in forum Qt Programming
    Replies: 1
    Last Post: 15th January 2008, 10:02
  2. Qt 4.1.1 linker warnings
    By Matt Smith in forum Installation and Deployment
    Replies: 0
    Last Post: 26th February 2006, 22:14

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.