[Interest] How to change parent of scaled QGraphicsItem while retaining scene bounding rect?

Patrick Stinson patrickkidd at gmail.com
Wed Aug 8 05:49:24 CEST 2018


Thanks for the reply. I am just particularly dense in this sort of cognitive operation (something about flipping symbolic representations like in fractional arithmetic) and might do well with just a bit of code or pseudo code. Do you think you might provide some?

Thanks!

> On Aug 7, 2018, at 6:24 PM, Christian Gagneraud <chgans at gmail.com> wrote:
> 
> On 8 August 2018 at 11:08, Patrick Stinson <patrickkidd at gmail.com> wrote:
>> Hello!
>> 
>> I am trying to change the parent of a QGraphicsItem without it appearing to move or change size on the scene. Both the item, old parent, and new have arbitrary scale values set. How can this be done?
> 
> If you grab the item's sceneTransform() before re-parenting, you
> should be able to deduce it's new local transform from it's new parent
> sceneTransform().
> 
> 
>> 
>> Thanks!
>> _______________________________________________
>> Interest mailing list
>> Interest at qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/interest




More information about the Interest mailing list