Results 1 to 12 of 12

Thread: sizeHint()

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2006
    Location
    Bangalore,India
    Posts
    419
    Thanks
    37
    Thanked 53 Times in 40 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: sizeHint()

    Quote Originally Posted by sm View Post
    I have a basic question about sizeHint. I have read thru the Qt documentation but I still don't know how to use sizeHint. Never have I been able to compile anything that has sizeHint() in it. I'd like to know what is the proper use of sizeHint.
    For example if I want sizeHint to take care of the size of my application's window, how do I use it? Let's assume that I want the size always to be between 200x200 and 300x300 but as small as possible at the same time. What does the command look like when in action? I have not been able to find any relevant exaples online either. Thanks for help.
    You can use QWidget::minimumSizeHint() to return the minimum recommended size for your window and QWidget::sizeHint() to return the recommended size.

    These properties are used by QLayout's to take care of the geometry of the widgets. QLayout won't resize widgets lesser than it's min size hint.

    Also you can control how the widgets should behave in various circumstances(eg when there is extra space ) by using QSizePolicy.
    See also QWidget::sizePolicy
    The biggest difference between time and space is that you can't reuse time.
    -- Merrick Furst

  2. The following user says thank you to Gopala Krishna for this useful post:

    sm (21st January 2008)

Similar Threads

  1. sizeHint
    By eric in forum Newbie
    Replies: 1
    Last Post: 8th January 2008, 16:18
  2. How to set the sizehint for treeWidget
    By santosh.kumar in forum Qt Programming
    Replies: 1
    Last Post: 12th June 2007, 11:35
  3. QTextEdit, sizeHint, QWidget
    By TheKedge in forum Qt Programming
    Replies: 1
    Last Post: 3rd February 2007, 08:25
  4. 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
  •  
Qt is a trademark of The Qt Company.