Results 1 to 3 of 3

Thread: Why does QWebView sizeHint() return a fixed value?

  1. #1
    Join Date
    Aug 2008
    Posts
    132
    Thanks
    23
    Thanked 3 Times in 3 Posts

    Default Why does QWebView sizeHint() return a fixed value?

    Hi

    I'm wondering what the reason is that QWebView::sizeHint() is implemented to return a fixed value:

    Qt Code:
    1. QSize QWebView::sizeHint() const
    2. {
    3. return QSize(800, 600); // ####...
    4. }
    To copy to clipboard, switch view to plain text mode 

    It makes putting it into a layout pretty useless. On that point, is there a recommended way to let QWebView respect a layout? I've reimplemented the resizeEvent() and got it working, but why is it needed?

    Thanks for any comments.
    Jaco
    Last edited by JPNaude; 4th January 2011 at 09:43.

  2. #2
    Join Date
    Jul 2009
    Location
    Enschede, Netherlands
    Posts
    462
    Thanked 69 Times in 67 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Why does QWebView sizeHint() return a fixed value?

    Try setting the size policy. The size hint is just a hint and usage of it is dependent on the size policy as far as I know.

    Even so, putting the thing into a layout may still be useful whenever other widgets come into play, but that is probably out of scope here.
    Horse sense is the thing that keeps horses from betting on people. --W.C. Fields

    Ask Smart Questions

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

    JPNaude (4th January 2011)

  4. #3
    Join Date
    Aug 2008
    Posts
    132
    Thanks
    23
    Thanked 3 Times in 3 Posts

    Default Re: Why does QWebView sizeHint() return a fixed value?

    Setting the size policy did it thanks.

Similar Threads

  1. Replies: 8
    Last Post: 3rd September 2013, 09:51
  2. How to reimplement sizeHint()?
    By Septi in forum Qt Programming
    Replies: 0
    Last Post: 6th July 2010, 13:07
  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.