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

Resizing QGraphicsItems



  • Hi,
    I have a problem when resizing customized QGraphicsItems.
    I am able to resize them by mouse dragging (drag from one of 8 resize handles, on ResizeHandle::mouseMove I actualy resize parentItem() ).
    The handle is a QGraphicsRectItem (4x4).
    The problem is that I want to establish a minimum width and a minimum height for all items ( eg minHeight,minWidth -> 20px).

    How can I restrict for instance the mouse vertical movement when I reach the minimum height ?



  • Take a look at the docs for "QGraphicsItem::itemChange":http://doc.qt.nokia.com/latest/qgraphicsitem.html#itemChange. I think that can help you in this case.


Log in to reply