Q:

How to change tab while progress bar is being updated in QT

I have a Qwidget with a few tabs. In one of the tabs, after clicking a button, a function starts processing data and updates a progress bar. 
I'd like to be able to change tabs while this process is running, currently it does'nt let me do so. Any idea? 

A:

(1) You must use a modeless progressdialog insteal of modal one. Practically, the main event loop must get the control to allow user interaction.
http://www.bogotobogo.com/Qt/Qt5_QProgressDialog_Modal_Modeless_QTimer.php
(2) You should put your data processing function to worker thread and invoke a progress dialog update to main UI thread from that. That way your task would not block UI, so you could interact with the window (like changing tab) meanwhile.

Qt also provides means to implement this, you might want to refer to:

QFuture, QtConcurrent::run(): run a task in separate thread.
QFutureWatcher: help monitor the progress of a task running in worker thread.
Example: 
http://doc.qt.io/qt-5/qtconcurrent-progressdialog-example.html

