qlands
3rd May 2011, 13:04
Hi,
I have this code inside the run() of a QThread:
outfile.setFileName(outputFile);
if (!outfile.open(QIODevice::WriteOnly | QIODevice::Text))
return;
outStream.setDevice(&outfile);
outStream << "Some data here!" << "\n";
outfile.close();
Both outfile and outStream are private members of the thread class:
QFile outfile;
QTextStream outStream;
When I ran it. The out file is created but it has 0 bytes.
Funny thing is that when I use QFile.Write() it works.
Any idea why?
Thanks,
Carlos.
I have this code inside the run() of a QThread:
outfile.setFileName(outputFile);
if (!outfile.open(QIODevice::WriteOnly | QIODevice::Text))
return;
outStream.setDevice(&outfile);
outStream << "Some data here!" << "\n";
outfile.close();
Both outfile and outStream are private members of the thread class:
QFile outfile;
QTextStream outStream;
When I ran it. The out file is created but it has 0 bytes.
Funny thing is that when I use QFile.Write() it works.
Any idea why?
Thanks,
Carlos.