S
S
scoped2015-07-31 01:41:17
Qt
scoped, 2015-07-31 01:41:17

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

4 answer(s)
S
Stanislav Makarov, 2015-07-31
@Nipheris

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)

A
Antony, 2015-07-31
@RiseOfDeath

As elsewhere - by executing the GUI in a separate thread (well, or performing heavy calculations in a separate thread, as you like).

L
LittleFatNinja, 2015-07-31
@LittleFatNinja

kuri cancarensi

C
cthulhudx, 2015-07-31
@cthulhudx

QThread

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question