QQuickItem::mousePressEvent() not called
-
wrote on 12 May 2020, 17:57 last edited by
Hi all,
I'm experiencing an issue with
QQuickItem
objects.
Basically, I have an app with customQMdiSubWindow
.MyMdiSubWindow contains a
QQuickWidget
as its central widget.The
QQuickWidget
holds aMyObjectScene
that inherits from
QQuickItem
. The purpose of this class is to store child items, selected child objects etc.MyObjectScene
managesElementItem
objects.
ElementItem
inherits fromQQuickPaintedItem
.
ElementItem
overridesmousePressEvent()
andmouseReleaseEvent()
.
It works fine.However, sometime, when
ElementItem
rejects amousePressEvent
with
event->ignore()
, I would likeMyObjectScene
to 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::mousePressEvent
ignores the event.What I need to do, is to have
MyObjectScene::mousePressEvent()
called instead ofMySubWindow::mousePressEven
t.Is there something wrong in this scenario ?
Thanks for your feedback.
Karim
1/1