Results 1 to 4 of 4

Thread: groupbox scale to contents height in qtdesigner

  1. #1
    Join Date
    Apr 2014
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default groupbox scale to contents height in qtdesigner

    im just getting started with qt and ive got an application containing lots of groupboxes in a window, which need to be as large as posible, but only as tall as they need to be to fit their contents, which will vary in size. obviously i could do this in code quite easily but it would be far neater to put that behaviour in via the designer, i just cant seem to see an obvious way of doing it.

    im using qt designer version 4.8.2

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: groupbox scale to contents height in qtdesigner

    You use the same properties on layouts/widgets in Designer as you would implement in code to achieve a size that is fixed by the size hint of the contained widgets. What have you tried?

  3. #3
    Join Date
    Apr 2014
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: groupbox scale to contents height in qtdesigner

    not much, all i saw was pixel based sizing options, and lay out vertically option in the container widget

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: groupbox scale to contents height in qtdesigner

    You are looking for size constraints on the layout applied to each group box content, and on the layout that contains the group boxes.

    See the "Extension Example" in Assistant for a mechanism that has the content control the size of the container (rather than the more typical container controlling its content).

Similar Threads

  1. QWinWidget is not visible with MFC GroupBox
    By dpace in forum Qt Programming
    Replies: 1
    Last Post: 24th January 2012, 18:39
  2. Adding layout on groupBox
    By kode in forum Newbie
    Replies: 1
    Last Post: 14th December 2010, 15:49
  3. Two groupbox, if checked one, uncheck other
    By webquinty in forum Qt Programming
    Replies: 4
    Last Post: 13th May 2009, 23:40
  4. Groupbox has no borders ?
    By vieraci in forum Qt Programming
    Replies: 12
    Last Post: 30th April 2009, 12:46
  5. A Shadow of my groupBox
    By baray98 in forum Qt Programming
    Replies: 1
    Last Post: 28th June 2008, 21: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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.