Do I need to call installEventFilter(this)?
Solved
General and Desktop
-
Will the filter for this install itself? I tried it, it works in both cases, but I couldn't find any information about self-setting of the filter in the documentation.
class MyClass : public QObject { Q_OBJECT MyClass() { installEventFilter(this); //Do I need this? } protected: bool eventFilter(QObject*, QEvent*) override { } };
-
-
@JobRecrd
you could inspect all events before they are actually processed in the event handlers.
Buts its better practice to override the corresponding event handlers or even the generic event() method instead of doing it this way. -
@raven-worx
That is, installEventFilter allows you to handle events before they arrive in the overridden eventFilter class method? -