Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Getting hypothetical QGraphicsItem.sceneBoundingRect() based on different pos?



  • I have a set of QGraphicsItems which will animate from their current position to a new position, and want to calculate the post-animation bounding rect for all of the items prior to the animation taking actually place.

    The bounding rects of some items are dependent on the bounding rect of other items. For example some items are nodes on a graph and some are edges. All are top-level items.

    Can anyone suggest a trick how to do this? I suppose I could move all the items to their new positions, calculate the total bounding rect, then move them back all in the same code block, but I am afraid this will cause frame buffer flicker. Maybe that fear is unfounded.

    Thoughts? Thanks!


Log in to reply