notify
returns whatever QObject::event
would return. If the event was processed and you don't want to propagate the event any further, you should return true, otherwise return false. Those are Qt's semantics.
When there is an exception thrown by the event handler, it's generally anyone's guess as to whether the event should be handled further or not.
There are two lines of reasoning, of course at odds with each other:
The thrown exception indicates that the event was not handled. So you should return false.
The exception was thrown because the event was being handled - it's likely to come from nontrivial code. So it was simply a handling of event, but it failed, so you should return true.
Qt's semantics seem to line up better with the first answer - that of returning false. In practice it probably doesn't matter at all unless the events are handled by widgets, where you can run into misbehavior if events vanish too early. So, false is probably overall a better choice.
Recall event propagation in widgets. If a child widget doesn't consume (handle) an event, the event
method, and thus notify
, will return false, and the event will be passed to the widget's parent. If you return true where a successful call to event
would return false, you're effectively filtering the event out from the underlying parent widget. This is the source of possible misbehavior.