The event filter is a virtual function of QObject. If overrided the event filter function like this example:

virtual bool eventFilter(QObject *object, QEvent *ev) override;

and then called “installEventFilter” function like this:

 this->installEventFilter(this);

the events could get in eventFilter function. For more, you can glance theese posts:

Install The Mouse Event

Mouse Move Example

Mouse Move Wıthout Mouse Pressed

Mouse Press-Release Event

Mouse Buttons on Mouse Events

Key Press Event

Key Release Event