Upon failed assertion in threaded computation, message box is not shown correctly
To reproduce, manipulate e.g. the ASSERT in Base/Progress/ProgressHandler.cpp, and run a simulation.
The message box will pop up so briefly that it cannot be read, then the GUI will terminate. The following is written to the terminal:
FATAL: Assertion m_inform failed in /G/sw/ba/Base/Progress/ProgressHandler.cpp, line 21
QObject::setParent: Cannot set parent, new parent is in a different thread
WARNING: QBackingStore::endPaint() called with active painter; did you forget to destroy it or call QPainter::end() on it?
TODO: Upon launching a computation thread, call qInstallMessageHandler to install an appropriate message handler.
One possibility: Wrap the threaded computation by a try block. Let the message handler throw a standard exception.
Threads appear in
- single calculation
- fit
- saving data field