Results 1 to 4 of 4

Thread: setTransformOriginPoint changes the Item after transofrmation

  1. #1
    Join Date
    Nov 2010
    Posts
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Symbian S60

    Default setTransformOriginPoint changes the Item after transofrmation

    Hi again,
    I want to transform a QGraphicsItem , but I want to transform it around custom transformOriginPoint. That's why I made a class witch sends new transformOriginPoint to my Item. But when there are transformations already made, the change of transformOriginPoint, causes my transofrmation to be recalculated around the new transformOriginPoint and my Item hops. Can You help me to avoid this behavior?

  2. #2
    Join Date
    Sep 2010
    Posts
    46
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: setTransformOriginPoint changes the Item after transofrmation

    I have exactly same problem ...

  3. #3
    Join Date
    Sep 2014
    Posts
    1
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: setTransformOriginPoint changes the Item after transofrmation

    I'm facing the same issue. In my opinion, changing transformOriginPoint should not affect the current graphic state but should only be applicable for only subsequent transformations. Can somebody explain why the transformation is recalculated and how can it be prevented?

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: setTransformOriginPoint changes the Item after transofrmation

    The transformation is not really "recalculated". Each item has an internal transformation matrix that is used to transform it. If you add a new transformation then it modifies the transformation matrix and then the transformation is applied to the item using the set transform origin. Thus changing the origin affects all transformations as all operate on the same transformation matrix. A solution is to apply a translate operation to the item which moves the origin to where you want it to be, then apply the actual transformation you want to perform and then another translate operation that will reverse the effect of the first one. Alternatively you can probably set your operation on a separate transformation matrix and then multiply the two matrices.
    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.


Similar Threads

  1. setTransformOriginPoint
    By brianc in forum Newbie
    Replies: 2
    Last Post: 17th August 2010, 00:26
  2. Replies: 1
    Last Post: 20th January 2010, 08:38
  3. Replies: 1
    Last Post: 26th August 2009, 15:47
  4. Replies: 5
    Last Post: 10th August 2009, 10:50
  5. Replies: 14
    Last Post: 9th November 2006, 08:35

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.