[Interest] Survey: do you override QCoreApplication::notify? Why?

John Weeks john at wavemetrics.com
Thu Apr 16 03:23:35 CEST 2015


> 4) filter events being delivered (remove from queue / compress)?

We do this.
We also maintain our own z-order window list and use the notify event to intercept WindowActivated and WindowDeactivated events.
The application includes a programming language that users can use to create, destroy and modify objects and do arbitrary computations. It's sufficiently powerful that our customers often implement scientific computations for things that aren't provided as built-ins, and they create their own GUIs for various kinds of scientific endeavors. During user code execution we need fine-grained control of events, and it's not always possible to identify an object to which a filter can be attached.

The decision to use notify() was made very early in our use of Qt- it's conceivable that we would have designed it differently if we were starting from our present knowledge of Qt. But maybe not. It was based in part on reading C++ GUI Programming with Qt 4.

> 2) use it to catch exceptions and continue execution?
>     or use it to catch and abort?

This too.

> And additional question: do you need this for the main thread only, for 
> auxiliary threads only or for all threads?

Main thread only. Much of our use of notify() is for more fine-grained control of event delivery, where QEventLoop::ExcludeUserInputEvents excludes too much.

-John Weeks




More information about the Interest mailing list