QFile Problem~ "Unknow error" in "open(QIODevice::ReadWrite)"
My Code:
Code:
#include <QtGui/QApplication>
#include <QMessageBox>
int main(int argc, char *argv[])
{
{
QMessageBox::information(0,
"Error: Cannot open["+file
->fileName
()+"] "+file
->errorString
());
return 0;
}
return app->exec();
}
this will output:Error: Cannot open[file.text] Unknow error.
?????? why??
Re: QFile Problem~ "Unknow error" in "open(QIODevice::ReadWrite)"
QFile::open returns TRUE on success and false if it fails.
So you're testing wrong there.
Switch to:
Re: QFile Problem~ "Unknow error" in "open(QIODevice::ReadWrite)"
Re-check the if-clause. QFile::open() returns true if successful; otherwise returns false.
Re: QFile Problem~ "Unknow error" in "open(QIODevice::ReadWrite)"
OH!!!!!!!!!!!!!!!!!!!!!!!!! God!!!! :(
is so low problem!!!! :(
I'm a fool!~~~ thank you Sir~ thank you~~ :(