2021年3月10日星期三

QImage save file while program is running

I am working with PyQt5 and I am using QMainWindow and open a QDialog. Inside of this dialog I am trying to save a picture like this.

    image = QImage()      image.loadFromData(requests.get(image_link).content)      image.save("test.png")  

And the images are saved already, but only when I close the program.

main.py

if __name__ == "__main__":  app = QApplication(sys.argv)  win = MainWindow()  win.show()  sys.exit(app.exec())  

So do you have any suggestions how to save the images, while the app is running?

https://stackoverflow.com/questions/66575076/qimage-save-file-while-program-is-running March 11, 2021 at 09:04AM

没有评论:

发表评论