Results 1 to 8 of 8

Thread: Rotate QGraphicsPixmapItem

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2006
    Location
    Germany
    Posts
    84
    Thanks
    5
    Thanked 5 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Rotate QGraphicsPixmapItem

    Thank you jpn, but I've already read that article and tried lots of examples from TT Labs but they all only work for the usual Z-Axis (which is not a problem and not really hard).

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Rotate QGraphicsPixmapItem

    The QGraphicsScene class provides a surface for managing a large number of 2D graphical items.
    Keyword: 2D.

    I believe you'll have to do more computations than that to get a rotation around X. Like obtaining a projection on XY plane of the rotated image rect and then map the image on the resulting shape. Then you'll get a trapezoid.

  3. #3
    Join Date
    Oct 2006
    Location
    Germany
    Posts
    84
    Thanks
    5
    Thanked 5 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Rotate QGraphicsPixmapItem

    Well, I know. But I assumed since it also just uses QPainter with QTransform that wouldn't be a problem.
    TT Labs also created examples to achieve that:


    I looked into it but they all don't use QGraphicsView, they just use QWidget and paint the items on it with QPainter and QTransform (with similar code to mine above).

  4. #4
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Rotate QGraphicsPixmapItem

    Are you sure they don't do any extra things to the pixmaps once they have the transforms?

Similar Threads

  1. Rotate QLabel
    By shader76 in forum Newbie
    Replies: 9
    Last Post: 24th December 2007, 12:31
  2. GraphicsView rotate problem
    By forrestfsu in forum Qt Programming
    Replies: 7
    Last Post: 21st November 2007, 20:20
  3. QPolygon rotate
    By xgoan in forum Qt Programming
    Replies: 3
    Last Post: 8th May 2007, 11:18
  4. Can QPicture scale and rotate ?
    By igor in forum Qt Programming
    Replies: 6
    Last Post: 25th January 2007, 22:48
  5. QPainter rotate function
    By ir210 in forum Newbie
    Replies: 3
    Last Post: 17th January 2006, 04:31

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.