popup message box upon failed ASSERT (#186)
Old behavior: On failed ASSERT, a message is written to the terminal from which BornAgain was launched.
New behavior: If BornAgain is compiled with a GUI, a message box pops up on failed ASSERT. If BornAgain is compiled without a GUI, behavior is the same as before.
Rationale: Old behavior was adequate for Linux users who tend to launch programs from a terminal. However, it was inadequate under Windows where applications are launched from an icon and have no associated terminal. Typically, for old behavior under Windows, the error message would not be seen by users. With new behavior, all GUI users will see a unified wrapper message which invites them to report the failed assertion to the maintainers.
Technicalities: If BornAgain has a GUI, and build type is not DEBUG, then a failed ASSERT calls qFatal. Handling of Qt messages is set by the statement qInstallMessageHandler(messageHandler); in main.cpp. Our reaction to qFatal() is implemented in MessageHandler.cpp.
A disadvantage of this solution is that our core, under the aforementioned conditions, becomes dependent of the Qt Core library.
Alternative solutions: To prevent any dependence of core on Qt, failed ASSERTs in core would throw a specific exception, which would have to be caught everywhere in the GUI. The catching clause would then call qFatal. I haven't investigated any further. I rather doubt that full coverage can be achieved in reliable and simple ways.
This resolves #186 (closed). This essentially reverses commit f0f8b3c2 of 29oct20.