Important: Please read the Qt Code of Conduct -

Treatment of rotated items in QGraphicsLayout

  • I am trying to create an editor based on GraphicsView, where the user is able to do two things (among others):

    1. rotate items
    2. put items into layouts

    Initial tests show that this does not look to be a happy combination. When I simply call "rotate" on the item, it will be placed inside the layout like it was unrotated, and is THEN rotated for display.

    Now, if I rotate a rectangle by 45°, it's resulting bounding rectangle will be larger, and I had hoped the layout would take that into account.

    Am I missing something? Is there a way to make the layout respect item rotation (other than reimplementing geometry(), setGeometry(), minimumSize, ... for every single item)?

Log in to reply