Results 1 to 3 of 3

Thread: mirror for QGraphicsItem

  1. #1
    Join Date
    Feb 2007
    Posts
    28
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default mirror for QGraphicsItem

    QGraphicsItem has the functions rotate, translate, shear. But i need the function mirror.
    This function should mirror the graphic at the x-axis and/or the y-axis.
    E.g. if "/ " is a graphic and it is mirrored to the y-axis it becomes "\".
    Is such a function implemented or how can i implement it.

  2. #2
    Join Date
    Jan 2006
    Posts
    128
    Thanked 28 Times in 27 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: mirror for QGraphicsItem

    Quote Originally Posted by jobrandt View Post
    Is such a function implemented or how can i implement it.
    Try scale with a negative value? ;-)

    Or if you like to control everything, you can create the matrix yourself and call QGraphicsItem::setMatrix. See also The Graphics view Coordinate System

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

    jobrandt (14th March 2007)

  4. #3
    Join Date
    Feb 2007
    Posts
    28
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: mirror for QGraphicsItem

    scale() works very good.
    I have used scale(-1,1) to mirror to the x-axis and scale(1,-1) for the y-axis.
    scale(-1,-1) should mirror to the origin, but i have not tried this.

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.