How do I display a “please wait” message during a long operation in Qt Python?I am using Ubuntu 12.04
2 Answers
My answer is plain. You never leave a "please wait" message - this is a "previous-millenium" practice. You display a progressbar.
Should you have problem with the progress bar timing - that happens! - just update it with approximate timing. But do not leave your user uninformed about time. This is an essential information. 2 secs, 5 secs... Or 60 secs. That's essential to know

- 1
I'm assuming you want your GUI to remain responsive during this time. In that case you would create a class Worker that derives from QObject, instantiate it, instantiate a QThread, move the Worker to the QThread (via moveTo), create a custom signal sig_progress in the Worker that your ProgressWidget connects to. Your Worker class does the "long running task" and emits signal every so often, thus the progress updates. The signal could be a percentage of work done, of estimated time required, etc. Look up the above, try things, and if you still have issues you can add code to your post and I can add code based on what you post.
Update 2022/10:
Checkout this answer https://stackoverflow.com/a/41605909/869951 which provides details / example of the above.

- 27,510
- 9
- 72
- 103
-
there are only few examples out there. especially in python. and it is hard to implement also hard to understand. god i missed tkinter. give us reference. a real answer. – greendino Jun 24 '20 at 15:25