qt - Child QGraphicsItem move event (ItemIsMovable) to its parent -


how can child qgraphicsitem move parent item ?

i set child item's itemismovable flag , when try move child item, parent item not move, child item moves.

 // child items's mousemoveevent void textdiagram::mousemoveevent(qgraphicsscenemouseevent *event){      parentitem()->moveby(event->pos().x() - lastpos.x() , event->pos().y() -lastpos.y() );      qgraphicsitem::mousemoveevent(event); }

void textdiagram::mousepressevent(qgraphicsscenemouseevent *event){ lastpos.setx( event->pos().x() ); lastpos.sety( event->pos().y() ); qgraphicsitem::mousepressevent(event); }

this works if select more 1 item, moves item under mouse.

how can solve ?

i solved invoking parent's mouse events in child's mouse events .


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -