QQuickItem::mousePressEvent() not called
-
Hi all,
I'm experiencing an issue with
QQuickItemobjects.
Basically, I have an app with customQMdiSubWindow.MyMdiSubWindow contains a
QQuickWidgetas its central widget.The
QQuickWidgetholds aMyObjectScenethat inherits from
QQuickItem. The purpose of this class is to store child items, selected child objects etc.MyObjectScenemanagesElementItemobjects.
ElementIteminherits fromQQuickPaintedItem.
ElementItemoverridesmousePressEvent()andmouseReleaseEvent().
It works fine.However, sometime, when
ElementItemrejects amousePressEventwith
event->ignore(), I would likeMyObjectSceneto intercept the event afterward in its
mousePressEvent()handler.
But it never happens.However, if I override
MySubWindow::mousePressEvent(), I can catch the event.
It means that,MySubWindow::mousePressEvent()is called whenElementItem::mousePressEventignores the event.What I need to do, is to have
MyObjectScene::mousePressEvent()called instead ofMySubWindow::mousePressEvent.Is there something wrong in this scenario ?
Thanks for your feedback.
Karim