[Qt-interest] Writing file.

Tim W timpie.w at gmail.com
Wed Apr 8 13:30:59 CEST 2009


>goes out of scope. It won't flush though, so that's probably the problem.

The destructor will flush and close the file if necessary.

Is the file opened, is there an error printed to the output?

Try this one ..


QFile filewrite("profile_n.grd");
if( filewrite.open(QIODevice::WriteOnly) )
{
    QTextStream out(&filewrite);
    out << "." << "\n";
}
else
{
    QMessageBox::critical( 0, tr("File Error"), filewrite.errorString() );
}



--
An Apple a day keeps Windows away

ACCU - http://www.accu.org - Professionalism in Programming.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090408/9185df75/attachment.html 


More information about the Qt-interest-old mailing list