Results 1 to 5 of 5

Thread: Rotating QGraphicsTextItem

  1. #1
    Join Date
    Mar 2011
    Posts
    63
    Thanks
    11
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Rotating QGraphicsTextItem

    Hello peeps.

    Got a quick question. I am trying to rotate a subclass of QGraphicsTextItem. And the thing is when I rotate the text it gets deformed. (Se attachments).

    In my QGraphicsView these flags are set.
    Qt Code:
    1. view->setRenderHints(QPainter::SmoothPixmapTransform | QPainter::Antialiasing | QPainter::TextAntialiasing);
    To copy to clipboard, switch view to plain text mode 
    .

    The way I rotate the item is simple by calling the QGraphicsItem::rotate.

    Dont really know what else I can do.
    Attached Images Attached Images

  2. #2
    Join Date
    Nov 2010
    Location
    Budapest, Hungary
    Posts
    125
    Thanks
    17
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Rotating QGraphicsTextItem

    is it not simply because you cannot draw anything with the set of a pixel grid? 180 degrees, if it is nice then this is the soulition.
    Szilvi

  3. #3
    Join Date
    Mar 2011
    Posts
    63
    Thanks
    11
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Rotating QGraphicsTextItem

    Quote Originally Posted by szisziszilvi View Post
    is it not simply because you cannot draw anything with the set of a pixel grid? 180 degrees, if it is nice then this is the soulition.
    What? Sorry but didn't understand a thing here.

  4. #4
    Join Date
    Nov 2010
    Location
    Budapest, Hungary
    Posts
    125
    Thanks
    17
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Rotating QGraphicsTextItem

    if you have a line with 1 pixel width, than it will be nice horizontally, it will be nice vertically, but it will be ugly at any other angel because the pixel grid on that you draw is made of squares. that is the raster image. see the border of the quote bulb, it is nice at the horisontal and vertical parts but not really the best at the corners.
    Szilvi

  5. #5
    Join Date
    Mar 2011
    Posts
    63
    Thanks
    11
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Rotating QGraphicsTextItem

    Okej, understand that now. But isn't antialiasing supposed to fix the ugly corners?

Similar Threads

  1. Rotating Gradient
    By JeffC in forum Newbie
    Replies: 3
    Last Post: 3rd June 2012, 11:11
  2. Replies: 51
    Last Post: 26th November 2010, 13:24
  3. Rotating a QGraphicsProxyWidget
    By Luc4 in forum Qt Programming
    Replies: 3
    Last Post: 16th June 2010, 13:53
  4. rotating a widget
    By oguzy in forum Qt Programming
    Replies: 2
    Last Post: 23rd November 2008, 00:08
  5. Rotating QGraphicsItem
    By Gopala Krishna in forum Qt Programming
    Replies: 3
    Last Post: 21st December 2006, 11:50

Tags for this Thread

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.