[Qt-interest] QSettings created in one thread, accessed from another

Patric userqt at gmail.com
Thu Jun 18 09:46:35 CEST 2009


I see. Thank you, 

Patric


"Girish Ramakrishnan" <girish at forwardbias.in> wrote in message news:4A39B34C.8080100 at forwardbias.in...
> Patric wrote:
>> Hello all,
>> I have noticed one interesting thing, which I can't explain to myself.
>> I have a GUI application with one worker thread. I was working around
>> with QSettings recently, my QSettings settings object was initialized in
>> the constructor of my worker thread. And when I was trying to use it
>> from that thread... it was not working. Anyway, I moved the creation of
>> my settings object in my run method. Now it works.
>> But does anyone have an idea why it was not working when it was
>> initialized in the main thread ? QSettings is not event driven.
>> Also I have another object initialized in the constructor of the worker
>> thread (it's an instance of a class created by me), which I'm accessing
>> from it and there is no problem.
>>  
> 
> QSettings is event driven. The writes/flush are asynchronous; changes
> are committed using an event posted to itself.
> 
> And you should not create QSettings in one thread, and use it in another.
> 
> Girish
> 
> 
> __________ Information from ESET NOD32 Antivirus, version of virus signature database 4098 (20090522) __________
> 
> The message was checked by ESET NOD32 Antivirus.
> 
> http://www.eset.com
> 
> 
>



__________ Information from ESET NOD32 Antivirus, version of virus signature database 4098 (20090522) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090618/0c404f64/attachment.html 


More information about the Qt-interest-old mailing list