[Interest] Never ending thread: blocking GUI
imironchick at gmail.com
Tue Oct 16 15:38:17 CEST 2012
16.10.2012 16:15, Sensei пишет:
> This is quite easy: I want to start a thread that never ends.
Just call exec() in your run() method. And it will start event loop that
will work untill you call exit() or quit() in you thread. And don't
forget to start() your thread.
> Once in a while, when the GUI needs it, it will "wake the thread up",
> and run a method of my QThread subclass, in my case, a "find in files"
> or "rename all files", or any other method.
If you will do it so then this methods will called on that thread from
which they are called. I.e. from GUI thread, for example. You should
create some object that will live in your thread and, for example, will
be connected to some signals where that object will do specific work
and, for example, emit some signal with result.
More information about the Interest