现在要做一个需要在父item上添加控制点(子item)来调整父item形状的功能。
关键是子item移动之后,要把自己的位置信息交给父item,让父item更新自己的形状。
查看了很久Qt的document,需要在父ITEM中用setFiltersChildEvents(true)来设置允许拦截所有给子item的消息,然后再重载这个函数:
bool sceneEventFilter ( QGraphicsItem * watched, QEvent *
现在要做一个需要在父item上添加控制点(子item)来调整父item形状的功能。
关键是子item移动之后,要把自己的位置信息交给父item,让父item更新自己的形状。
查看了很久Qt的document,需要在父ITEM中用setFiltersChildEvents(true)来设置允许拦截所有给子item的消息,然后再重载这个函数:
bool sceneEventFilter ( QGraphicsItem * watched, QEvent *