Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How to avoid movility on a QGraphicsItem when it's selected?
Rhadel last edited by
I've two custom classes from QGraphicsItem that it's drawn on a custom QGraphicsScene. One of them is selectable:
//Inicialize all data TYPE A
this->setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
//Inicialize all data TYPE B
The other one is just movable. Ok, then, when the selectable A object is selected (it shows an arrow when it is, drawn in its paint method) and I try to drag an object of the other type ("just movable type", type B), the selected object is also dragged. Only if I deselect it, I can drag only the B object.
What can I do to indicate to Qt to move only if the mouse is clicked on the object?