Results 1 to 6 of 6

Thread: QGraphicsTextItem Paint()

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QGraphicsTextItem Paint()

    Quote Originally Posted by scascio View Post
    Why is it perfeclty normal? The painter cannot draw it correctly?

    Isn't it a question of antialiasing?
    It's a question of interpreting QRect. For historical reasons its bottom and right values are decreased by 1. Antialiasing is another thing but GV should compensate for it automatically.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


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

    scascio (18th September 2009)

  3. #2
    Join Date
    Apr 2008
    Posts
    45
    Thanks
    3
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QGraphicsTextItem Paint()

    A box of height and width of 40 at 0,0 takes pixels 0-39 to draw. Now, if you draw a box that fits in that, and you measure, you'll get pixels 1-38 as the difference between the lines. This creates a problem, because your drawn with is no where near the 40 width your rect indicated. What you have to do is pic the next-highest pixel. So you end up drawing on 0 and 40. But the 40th pixel is clipped. I've seen this done in many different packages and it is "right".

Similar Threads

  1. Drawing standard widgets using a custom paint engine
    By Waywocket in forum Qt Programming
    Replies: 26
    Last Post: 21st October 2010, 20:40
  2. Problem on set QGraphicsTextItem write protect.
    By patrik08 in forum Qt Programming
    Replies: 1
    Last Post: 22nd July 2007, 20:53
  3. QGraphicsTextItem: handling cursor position change
    By Angelo Moriconi in forum Qt Programming
    Replies: 2
    Last Post: 30th January 2007, 10:42
  4. QGraphicsTextItem size
    By Angelo Moriconi in forum Qt Programming
    Replies: 1
    Last Post: 26th January 2007, 08:34
  5. paint QTreeView item !!
    By mcenatie in forum Qt Programming
    Replies: 2
    Last Post: 19th March 2006, 14:24

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.