How installEventFilter and eventFilter works ? why when return true in event filter not load qml ?
-
I want to know why qml not get loaded due to below type of implementation.
calling the below line into class constructor :
pPtr->installEventFilter(this);
And i have written the below function def:
bool Bapplication::eventFilter(QObject *watched, QEvent *event) { return true; }
-
I want to know why qml not get loaded due to below type of implementation.
calling the below line into class constructor :
pPtr->installEventFilter(this);
And i have written the below function def:
bool Bapplication::eventFilter(QObject *watched, QEvent *event) { return true; }
@Qt-embedded-developer
Although I know nothing about QML, ifeventFilter()
always returnstrue
then no events are passed are passed to any object. You need to returnfalse
(at least sometimes) to let the application see any events, at present it does not. I imagine that stops QML working/loading? -
@Qt-embedded-developer
Although I know nothing about QML, ifeventFilter()
always returnstrue
then no events are passed are passed to any object. You need to returnfalse
(at least sometimes) to let the application see any events, at present it does not. I imagine that stops QML working/loading?@JonB Yes this happening. So it's quite difficult to debug this type of code.
-
Can you give reference to avoid this type of problem in code.
-
i also want to understand that why when pass true at that time it not allow to load qml ? If any reference link is there it will helpful.
-
I also want to know when this type of scenario come to not allow loading of qml. any real time example.
-
-
@JonB Yes this happening. So it's quite difficult to debug this type of code.
-
Can you give reference to avoid this type of problem in code.
-
i also want to understand that why when pass true at that time it not allow to load qml ? If any reference link is there it will helpful.
-
I also want to know when this type of scenario come to not allow loading of qml. any real time example.
@Qt-embedded-developer I really wonder what's so hard looking into the documentation ... esp. since you would get an answer much earlier.
RTM: https://doc.qt.io/qt-6/eventsandfilters.html#event-filters -
-