Answer the question
In order to leave comments, you need to log in
How to execute a function without hanging the main form in qt?
hello, help me figure this out: there is some kind of function (for example, downloading a file from the network or searching on a computer). How to execute such a function in another thread without hanging the main form? (like Dispatcher.BeginInvoke in C#) and with the ability to stop/restart?
Answer the question
In order to leave comments, you need to log in
Take and deal with QThread. To stop / start, use signals / slots (the meaning of QThread is that it can start its own eventLoop, and catch QueuedConnection signals from other threads)
As elsewhere - by executing the GUI in a separate thread (well, or performing heavy calculations in a separate thread, as you like).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question