[Interest] Showing progress while doing "background" GUI work
ijbrewster at alaska.edu
Tue May 10 18:28:20 CEST 2022
I have a Qt/PySide 5.15 application with an option to export an image to PDF. The function to create and export this image takes around 12 seconds or so to run, so I would like to display a “please wait” dialog with an indefinite progress bar or the like to let the user know things are still being processes.
Normally I would accomplish this by running the long-running process in a thread, so the GUI can update the progress bar, but since I am creating and painting widgets and the like I believe this to not be an option. I also considered peppering my code with calls to QApplication.processEvents() (though I know that’s frowned upon), but that doesn’t work anyway because the bulk of the time is spent in the QPainter.end() call, as it actually writes out the PDF.
Given that my heavy function works with GUI elements/painters, is there any way I can indicate to the user - other than just a static message with no indication of progress - that the application is still working?
Alaska Volcano Observatory
Geophysical Institute - UAF
2156 Koyukuk Drive
Fairbanks AK 99775-7320
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Interest