1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
| class Player(QtGui.QMovie):
def __init__(self, filename):
super(Player, self).__init__()
self.label = QLabel()
main_layout = QVBoxLayout()
main_layout.addWidget(self.label)
ui.throbberTab2.setLayout(main_layout)
byteF = QByteArray()
gif = "D:\Images\loader1.gif"
movie = QMovie(gif, byteF)
movie.setCacheMode(QMovie.CacheAll)
movie.setSpeed(100)
self.label.setMovie(movie)
layout = QtWidgets.QVBoxLayout()
layout.addWidget(self.label)
class Projet(object):
def startThrobber(self):
gif = "D:\Images\loader1.gif"
self.player = Player(gif)
self.player.start()
def stopThrobber(self):
self.player.stop()
QMessageBox.information(self.popup(), "Information", "Fini!")
def go(self):
if ui.chkbox.isChecked():
self.startThrobber()
script = subprocess.Popen(r'"C:\Program Files\FME\fme.exe" ', shell=False)
while script.poll() == None:
time.sleep(1)
self.stopThrobber()
else:
QMessageBox.information(self.popup(), "Erreur", "Erreur !") |