Results 1 to 3 of 3

Thread: invalid sizeHint()

  1. #1
    Join Date
    Aug 2006
    Posts
    15
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question invalid sizeHint()

    Is there any reason why the function sizeHint() should return a invalid QSize?

    My code is
    Qt Code:
    1. QTableWidgetItem *header = new QTableWidgetItem("Hello\nWorld");
    2. QSize size = header->sizeHint();
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Aug 2006
    Posts
    44
    Thanked 7 Times in 7 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: invalid sizeHint()

    Are you using a layout? Doesn't look like it, in which case, the QWidget docs state that the function returns an invalid size. QTableWidgetItem::sizeHint() implies that it returns the value from a previous call to setSizeHint().

  3. #3
    Join Date
    Aug 2006
    Posts
    15
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: invalid sizeHint()

    The problem is that QTableWidgetItem isn't a widget in itself, so it cannot be putted inside a QLayout

Similar Threads

  1. Qtopia cross-compile for arm
    By Bitz in forum Qt for Embedded and Mobile
    Replies: 2
    Last Post: 12th June 2006, 12:11
  2. Invalid pixmap
    By munna in forum Newbie
    Replies: 2
    Last Post: 8th June 2006, 08:00
  3. invalid use of undefined type
    By mikro in forum Newbie
    Replies: 2
    Last Post: 9th April 2006, 12:10

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.