How how to throw mouseMoveEvent from QGraphicsView to QGraphicsItem
Solved
General and Desktop
-
There is a class
class QDMGraphicsView : public QGraphicsView
It has:void QDMGraphicsView::mouseMoveEvent (QMouseEvent *event) { if (mode == MODE::DRAG_EDGE) { qDebug() << pos(); } QGraphicsView::mouseMoveEvent(event); }
And there is another class:
class Node Edge : public QGraphicsPathItem
And it has:void NodeEdge::mouseMoveEvent (QGraphicsSceneMouseEvent *event) { mousePosition = event->pos(); qDebug() << "zzz" << mousePosition; QGraphicsItem::mouseMoveEvent(event); }
Here I move the mouse over the scene, I have
QDMGraphicsView::mouseMoveEvent
processed. So I clicked somewhere and now I want to be processedNodeEdge::mouseMoveEvent
How I could do that? -
Hi,
Did you set the QGraphicsItem::ItemIsMovable flag on your NodeEdge class ?
-
Hi,
Did you set the QGraphicsItem::ItemIsMovable flag on your NodeEdge class ?