Results 1 to 2 of 2

Thread: Which have I to set to have a right rect() into paintevent of custom widget ?

  1. #1
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Which have I to set to have a right rect() into paintevent of custom widget ?

    I have set Qsize() returning info for sizehint, minimunsizehint, minimumsize, but the rect() I have into my custom widget paintevent() is wrong.
    (And I see - I know that the values at sizehint, etc are right )

    Have I to resize the 'internal' qwidget ?

    My custom widget is a simple text-item. I want to 'resize' it giving a 20% plus for the height I get from fontmetrics.
    Any help would be apprecciated.
    Thanks
    Last edited by tonnot; 3rd May 2012 at 10:20.

  2. #2
    Join Date
    Sep 2011
    Location
    Manchester
    Posts
    538
    Thanks
    3
    Thanked 106 Times in 103 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Which have I to set to have a right rect() into paintevent of custom widget ?

    You're here long enough to know that example (especially compilable) tells a thousand words, so maybe you can show us your problem this way?

Similar Threads

  1. Replies: 1
    Last Post: 11th March 2011, 19:34
  2. Replies: 2
    Last Post: 16th February 2011, 13:59
  3. Incorrect option.rect in custom item delegate
    By Jarvis in forum Qt Programming
    Replies: 0
    Last Post: 16th April 2010, 23:48
  4. How to paint a widget outside paintEvent()
    By wesley in forum Qt Programming
    Replies: 10
    Last Post: 27th February 2008, 03:19
  5. painting a widget outside a paintEvent
    By jayw710 in forum Qt Programming
    Replies: 1
    Last Post: 25th June 2007, 23:18

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.