On quarta-feira, 27 de março de 2013 11.20.32, Michael Dougras Silva wrote:
> I am a newbie in QT, and I have difficulties in using QThreads. What occurs
> is that i created one class named Logger what functions like a stream to a
> log file.
> This class maintains some static attributes (QFile and QTextStream) what
> refers to a log file. I use this class always I want to write logs, but
> when I try to use
> a Logger inside a QThread, the application crash. I cannot use this class
> Logger inside a Thread? How can I fix this?

You can use QFile and QTextStream in a thread. What you can't do is use the
same *objects* from two threads at the same time.

See Qt's definition of "thread-safe" and "reentrant". Those two classes are
reentrant.

--
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

Attachment: signature.asc
Description: This is a digitally signed message part.

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

Reply via email to