Results 1 to 3 of 3

Thread: Qt Layout engine not respecting minimum size?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    52
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Qt Layout engine not respecting minimum size?

    Hi,

    I use Qt 4.3.1 and created several dialogs with it. I place some groupboxes and other widgets on the form and then apply the layout. The following strange things I have seen:
    GroupBox Layout:
    I have a picture, a lable and a horizontal stretch in a horizontal layout, as one item. I have several of those vertivally stacked in the groupbox. Now I adjust the groupbox to fit the content just right. I have set the items so that they request minimum size. But as soon as the groupbox does get it's layout assigned, each item is becoming wider. That of course than has impact on the whole dialog itself, which I would like to start nicely packed to it's minimum size. It doesn't seem to be working. The dialogs always start in some sort of wasted space mode.

    Anyone seeing something like this? How can I make my dialogs show packed to minimum size to start with, and still use the layout engine for resizable dialogs?

    Regards,
    Michael

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt Layout engine not respecting minimum size?

    Try filling the space you want empty with spacers( that is if I understand your problem correctly).

    Otherwise, try posting some code.

    Regards

  3. #3
    Join Date
    Jan 2007
    Posts
    68
    Thanks
    9
    Thanked 8 Times in 8 Posts

    Default Re: Qt Layout engine not respecting minimum size?

    try to set the horizontal sizepolicy of all items inside your groupbox to
    Qt Code:
    1. QSizePolicy::Maximum
    To copy to clipboard, switch view to plain text mode 

    doing this, the groupbox should always try to stay at a minimum size

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.