Results 1 to 2 of 2

Thread: Painter rotation origin

  1. #1
    Join Date
    Jan 2012
    Location
    Iran, Tehran
    Posts
    308
    Thanks
    75
    Thanked 24 Times in 21 Posts
    Qt products
    Qt4 Qt5 PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Default Painter rotation origin

    I've drawn a pixmap by QPainter and i want to rotate it relative to a specific point. How can i change its rotation origin?
    Last edited by high_flyer; 10th March 2012 at 13:17.

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Painter rotation origin

    You translate it to the rotation point, rotate, and translate back to the original point.
    See an example here:
    http://qt-project.org/doc/qt-4.8/pai...ormations.html
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. QwtsSlider Scale Origin
    By fruzzo in forum Qwt
    Replies: 3
    Last Post: 23rd November 2011, 11:23
  2. Replies: 0
    Last Post: 28th September 2011, 23:18
  3. background-origin not working with svg?
    By Vadi in forum Qt Programming
    Replies: 0
    Last Post: 27th September 2010, 20:16
  4. QwtThermo: origin of the fill
    By Marco Trapanese in forum Qwt
    Replies: 0
    Last Post: 31st May 2010, 14:50
  5. Rotating a rectangle about its origin
    By babu198649 in forum Newbie
    Replies: 5
    Last Post: 25th October 2008, 12: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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.