Results 1 to 2 of 2

Thread: SizeHint problem

  1. #1
    Join Date
    Dec 2011
    Posts
    9
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Maemo/MeeGo

    Default SizeHint problem

    Hi
    I'm learning Qt.
    I was trying a test program from a book, but I've got an error:

    Qt Code:
    1. QWidget::setMinimumSize: (/findDialog) Negative sizes (0,-1) are not possible
    2. QWidget::setMaximumSize: (/findDialog) Negative sizes (16777215,-1) are not possible
    To copy to clipboard, switch view to plain text mode 

    the code's in attachment

    How to fix it?
    Attached Files Attached Files

  2. #2
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: SizeHint problem

    The attached project works if you have the following statement added in ctor
    Qt Code:
    1. ...
    2. main -> addLayout(l);
    3. main -> addLayout(r);
    4.  
    5.  
    6. setWindowTitle(tr("Find"));
    7. setLayout(main); //<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Add this
    To copy to clipboard, switch view to plain text mode 
    When you know how to do it then you may do it wrong.
    When you don't know how to do it then it is not that you may do it wrong but you may not do it right.

  3. The following user says thank you to Santosh Reddy for this useful post:

    marmistrz (7th December 2011)

Similar Threads

  1. How to reimplement sizeHint()?
    By Septi in forum Qt Programming
    Replies: 0
    Last Post: 6th July 2010, 14:07
  2. sizeHint() and heightForWidth(int) problem
    By nifei in forum Qt Programming
    Replies: 1
    Last Post: 12th March 2009, 14:36
  3. sizeHint()
    By sm in forum Newbie
    Replies: 11
    Last Post: 22nd January 2008, 04:59
  4. sizeHint
    By eric in forum Newbie
    Replies: 1
    Last Post: 8th January 2008, 17:18
  5. invalid sizeHint()
    By roleroz in forum Qt Programming
    Replies: 2
    Last Post: 25th August 2006, 23: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.