Install The Mouse Event

Mouse events are signals came from qobject when the user send an event by mouse. Forex: click, move, press. vb. We can get many ways these events. The firs one is to override the

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

function. If we want the events to come this function, we must  call this

 this->installEventFilter(this);

function before.

If you want to get mouse or other events from an other element, you can get it’s event by same way (element must be inherited from QObject)

element->installEventFilter(this);

 

Leave a Reply

Your email address will not be published. Required fields are marked *