PDA

View Full Version : QWidget::event() return value question



Mookie
2nd May 2014, 21:35
I'm using Qt 4.8, but I suspect it is applicable to Qt5 also.
I'm particularly interested in the QWidget mouse events, but this question could extend to QObject as well.

In QWidget::event() the QEvent::accept() and QEvent::ignore() functions are pretty clear. Accept() allows the event to continue on to the parent, ignore() causes it not to.

What does the bool return value for the QWidget::event() function mean? The documentation says to "return true if even e was recognized and processed". What exactly does that effectively do?

If we compare it to the QWidget::eventFilter() function, then a true means block the event so the object that the filter is installed on does not receive it, i.e. an event eater. There is no filtered class to block so that doesn't make much sense.