In my Qt application I have to perform some computationally heavy tasks, typically loading huge datasets from disk (single-threaded). The code in the task heavily relies on proper exception handling and is strictly non-Qt.
I offload these tasks from the GUI thread using QtConcurrent::run()
, so that I can show a progress bar. However as I understand from the Qt docs, I can't catch exceptions in the GUI thread. I understand that theoretically this would not make sense. However, in practice I only use threading because of the progress bar. What is the best way to deal with this situation?
Edit: I'd like to emphasize that I do not need fine grained control over the offloaded work. I really only offload it to show a progress bar. This is probably a situation others have encountered as well.