Re: [Interest] Which thread implementation is best to trigger external library via timers

2014-04-10 Thread Hugo Drumond Jacob
Why not using an wrapper, a cache to hold IP, port and others worker's members and repassing worker signals... Something like this: class NetworkWorker : public QObject { Q_OBJECT public: NetworkWorker::NetworkWorker() { QTimer *timer = new QTimer(this); connect(timer,

Re: [Interest] Which thread implementation is best to trigger external library via timers

2014-04-10 Thread Thiago Macieira
Em qui 10 abr 2014, às 12:17:15, K. Frank escreveu: > But Thiago -- You, of all people! -- How's he then going to get his > queued-event slot calls to run in the worker thread unless he calls > ThreadClass::moveToThread (this) ?!!? I didn't read the entire email... -- Thiago Macieira - thiago.ma

Re: [Interest] Which thread implementation is best to trigger external library via timers

2014-04-10 Thread K. Frank
Hi Thiago! On Thu, Apr 10, 2014 at 11:13 AM, Thiago Macieira wrote: > 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

Re: [Interest] Which thread implementation is best to trigger external library via timers

2014-04-10 Thread Thiago Macieira
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 infini

Re: [Interest] Which thread implementation is best to trigger external library via timers

2014-04-10 Thread K. Frank
Hi Roland! Just one quick comment, below: On Thu, Apr 10, 2014 at 3:42 AM, Roland Winklmeier wrote: > Hi list, > > for my project I have to use a very old library. > ... > The question is now, which Thread API is best to use. > ... > and the most critical part > - direct function calls synchroni

Re: [Interest] Which thread implementation is best to trigger external library via timers

2014-04-10 Thread Mandeep Sandhu
> A example looks like: > Timer to ping the server on regular basis: > - QTimer::timeout connected to slot sendPing(); > - when the pong is received, the signal void pongReceived is emitted, this > can be evaluated by the application. > > But as said, there are methods in the worker, I need return

Re: [Interest] Which thread implementation is best to trigger external library via timers

2014-04-10 Thread Roland Winklmeier
2014-04-10 10:16 GMT+02:00 Mandeep Sandhu : > > 1. Subclassing QThread: I've read you should avoid that, so I don't > really > > consider it > > Not really. Search the archives, where we've had this discussion > numerous times before! :) The conclusion was that there's no 1 right > or wrong way. I

Re: [Interest] Which thread implementation is best to trigger external library via timers

2014-04-10 Thread Mandeep Sandhu
> 1. Subclassing QThread: I've read you should avoid that, so I don't really > consider it Not really. Search the archives, where we've had this discussion numerous times before! :) The conclusion was that there's no 1 right or wrong way. It has to be taken on a case-by-case basis. > 2. Move it t

[Interest] Which thread implementation is best to trigger external library via timers

2014-04-10 Thread Roland Winklmeier
Hi list, for my project I have to use a very old library. This library is written in C++ and handles high level network and audio stuff. It is not written asynchronous but you have to call a method void DoTask(); every now and then. This will handle all queued jobs. A little bit more background: