I would like to use the Python QT6 statusBar to show the progress in a download process. In a loop I request several files to be downloaded. I would like to see the progress for each file downloaded. In the following code I see only the very last message (last file downloaded)
def darkDownloadButtonClicked(self):
self.statusBar.showMessage(“start download”)
url = configs.get("Url").data
files = [self.fileList.item(x).text() for x in range(self.fileList.count())]
selectedDirectory = self.dirCombo.currentText()
xDirectory = selectedDirectory
darkDirectory = "darks"
createDirectory(darkDirectory)
self.statusBar.showMessage("directory dark created")
for f in files:
downloadFile(url, f, darkDirectory)
self.statusBar.showMessage(f)
cursor = QCursor(Qt.CursorShape.ArrowCursor)
QApplication.changeOverrideCursor(cursor)
dlg = QMessageBox(self)
dlg.setWindowTitle(configs.get("downloadLabel").data)
dlg.setText(configs.get("downloadEndedLabel").data)
button = dlg.exec()
button = QMessageBox.StandardButton(button)
self.downLoadButton.setDisabled(True)