Stop propagating key event
QML and Qt Quick
5
Posts
3
Posters
6.4k
Views
1
Watching
-
Hi all;
Is there an ability to stop propagating key event to parent item?
By calling event.accepted = true, the default action is no longer working;
For example, i have textEdit element, and when clicking the arrow_up button, cursor moves to the previous line of the text if exists, and if not exists parent item receives event;
Is it possible to leave default action on press and stop propagating event?
Thanks. -
If i have understood correctly your question, on way is to intercept the event directly. For ex in your button, you put some onMouseClicked : {}, but then inside you have to put the code to make the cursor go upper if necessary.
Normally in that case the parent wont have any event propagated. -