Em qui 10 abr 2014, às 09:42:25, Roland Winklmeier escreveu:
> 1. Subclassing QThread: I've read you should avoid that, so I don't really
> consider it
> 2. Move it to thread: networkWorker->moveToThread(thread);
> 3. High level API's: QtConcurrent/QRunning
> 
> The requirements are:
> - Run infinite - stop only when requested
> - Needs to run threads event loop
> - Able to call slots via queued events
> and the most critical part
> - direct function calls synchronized via Mutexes from main thread

Go for option 1:

void ThreadClass::run()
{
        forever {
                DoTask();
                sleep(1);
        }
}

It's horrible, but not because of QThread.
-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to