'How can I push a QGraphicsItem to the top layer?

I have a lot of QGraphicsItems in my scene and when I reposition them according to some algorithm(they get repositioned one by one which is visualized),sometimes it happens that you don't really see where this one QGraphicsItem went, because it is now somewhere behind other QGraphicsItems. Is there a way to push the QGraphicsItem to the top layer?

qt


Solution 1:[1]

Items are drawn in the order they added to the scene. To move item to the front you can removeItem and then addItem back to the scene.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 mugiseyebrows