[Qt-interest] Basic QThread question

Sean Harmer sean.harmer at maps-technology.com
Fri May 7 12:38:33 CEST 2010


Hi Phil,

On 07/05/2010 11:08, Phil wrote:
> On Fri, 7 May 2010 06:14:02 pm Sean Harmer wrote:
>> Hi Phil,
>>
>> Please try the attached application. Instead of querying your device it
>> simply generates a random number. If you set breakpoints in the
>> DataProcessor::processData(int x) and DevicePoller::poll() methods then
>> look at the Threads debug view in creator you will see that this does
>> work using two threads and that the "polling" is performed in the worker
>> thread as expected. The main thread function simpy prints out the square
>> of the random number generated by the worker thread.
>>
>> Hopefully this will allow you to get it working with your polling code.
>> Just replace the call to qrand() % 10 with your own code.
>>
>
> Thank you Sean, you certainly have gone to quite a bit of trouble.
>
> I have tried the attached programme and of course it does work. I'm about
> to hit the road for a week but I might be able to study your code while I'm
> away. If I look at it now too closely it will keep me awake all night.
>
> Thanks again, I'll get back to after I return.
>

No problem. Have a good trip. If you think of any questions feel free to 
fire them to the list.

Sean



More information about the Qt-interest-old mailing list