def run(self): file = QtCore.QFile(self.filePath) if not file.open(QtCore.QIODevice.WriteOnly): self.saveFileFinished.emit(SAVE_FILE_ERROR, self.urlStr, self.filePath) file.write(self.fileData) file.close() self.saveFileFinished.emit(0, self.urlStr, self.filePath)