Results 1 to 2 of 2

Thread: Qt Designer: which field corresponds to sizeHint()?

  1. #1
    Join Date
    Oct 2011
    Location
    Australia
    Posts
    29
    Thanks
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Qt Designer: which field corresponds to sizeHint()?

    I'm looking at QtDesigner part of QtCreator 2.5. We have the following size related fields list on the right for a widget. No "sizeHint" is listed. Which if any corresponds to QWidget::sizeHint()?

    • geometry
    • sizePolicy
    • minimumSize
    • maximumSize
    • sizeIncrement
    • baseSize


    A corollary question. I notice QWidget::sizeHint() is a constant method. How do I affect its return value from the outside? Is that possible?

    Thanks.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Qt Designer: which field corresponds to sizeHint()?

    sizeHint() is not a property, it is a QSize value that, toegther with size policy, is used by layout managers to determine the overall size needed for a widget's children.

    Unless the size policy is set to fixed or setFixedSize() was called, the value usually depends in the widget's contents.
    E.g. text length and font height for a label.

    If you change how a widget works by subclassing it and your change affects the needed space, then overwrite sizeHint() to reflect that changed requirements

    Cheers,
    _

Similar Threads

  1. Replies: 3
    Last Post: 4th December 2011, 20:44
  2. Replies: 4
    Last Post: 8th April 2011, 22:17
  3. sizeHint()
    By sm in forum Newbie
    Replies: 11
    Last Post: 22nd January 2008, 03:59
  4. sizeHint
    By eric in forum Newbie
    Replies: 1
    Last Post: 8th January 2008, 16:18
  5. invalid sizeHint()
    By roleroz in forum Qt Programming
    Replies: 2
    Last Post: 25th August 2006, 22:11

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.