When processing takes place the GUI does not respond until the end of the processing...
-
Hello! So, I have built a GUI with buttons that some of them do a lot of processing, when chosen. For example 20 minutes image processing. During that time I cannot select anything from the rest of the buttons until the 20 min processing stops. Is this normal? How can I handle such kind of situations? A progress bar? Thread level programming? Something else that I miss?
-
Hello! So, I have built a GUI with buttons that some of them do a lot of processing, when chosen. For example 20 minutes image processing. During that time I cannot select anything from the rest of the buttons until the 20 min processing stops. Is this normal? How can I handle such kind of situations? A progress bar? Thread level programming? Something else that I miss?
@john_hobbyist said in When processing takes place the GUI does not respond until the end of the processing...:
Is this normal?
If you do that processing in GUI thread then yes it is notmal.
Solution: move processing to another thread(s). See https://doc.qt.io/qt-6/thread-basics.html -
Hi,
Beside the point made by @jsulm, if you need to stop the processing early, don't forget to add escape points on a regular basis in your image processing code.
@SGaist What do you mean??
-
@SGaist What do you mean??
@john_hobbyist
@SGaist means: the user may not be prepared to sit there for 20 minutes(!). Once your UI is enabled again (by putting the processing into a background thread), you really should allow the user to be able to do something in the UI to indicate he wants it to stop. Such as: in the thread during the processing call bool QThread::isInterruptionRequested() const frequently somewhere, so that something from the UI can call void QThread::requestInterruption() if the user requests it. -
A question a bit irrelevant. Can CUDA cores of my GPU, help somehow? I mean can they accelerate the image process? Instead using the pythreads...
-
You have to use a library that makes use of your GPU(s) for the operations you want.