Qt progress bar not updating
That function is not running in a separate thread it is running on the main event loop and the main event loop waits to run until you exit that function.Update progress sleeps for 1 second and keeps looping.
SIGNAL('THREAD_VALUE'), max Val) Establisment Commands(connection) class progress Thread(QThread): def __init__(self): QThread.__init__(self) def __del__(self): self.wait() def run(self): # your logic here while 1: max Val = 100 self.emit(SIGNAL('PROGRESS'), max Val) class Main(Qt Gui. QMain Window.__init__(self) = Ui_Main Window() setup Ui(self) connect Button.clicked.connect(self.connect To SESM) def connect To SESM(self): ## Function called when pressing connect button, input are being taken from edit boxes. QApplication(sys.argv) main = Main() main.show() sys.exit(app.exec_()) There are really two problems. But sometimes, il blocks the update of the progress bar, and after a few seconds it jumps to 100% directly at the end. I'm trying to update a QProgress Dialog (owned by a QMain Window class) along the execution of a QThread who process some time consuming operations. The main one with the GUI and the work thread which do all the background job so as the ap is working on background the user can see it on the GUI with a label with info and a progress bar.something like this Load 2tpbbkj2but inside the progress bar.... I've search and some forums say that you can get movement with: @ QProgress Bar bar; Minimum(0); Maximum(0);@ But I've not be able to make it run, it just stops my app.