I commonly write Python scipts to do conversion tasks for me and whenever I write one that takes a while I use this little progress bar to check on it
import sys
import time
from PyQt4 import QtGui
app = QtGui.QApplication(sys.argv)
barra = QtGui.QProgressBar()
barra.show()
barra.setMinimum(0)
barra.setMaximum(10)
for a in range(10):
time.sleep(1)
barra.setValue(a)
app.exec_()
I have 2 questions:
How do I make it close itself when it reaches 100% (It stays open and if you close the python shell before clicking the X button you crash it.)
also, When it loses and regains focus, it stops painting correctly. the process will continue to completion but the progress bar space is all white. How do I handle this?