My 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();
}
#include <QtGui/QApplication>
#include <QMessageBox>
int main(int argc, char *argv[])
{
QApplication *app=new QApplication(argc, argv);
QString localFileName="file.text";
QFile *file=new QFile(localFileName);
if(file->open(QIODevice::ReadWrite))
{
QMessageBox::information(0,"Error: Cannot open["+file->fileName()+"] "+file->errorString());
return 0;
}
return app->exec();
}
To copy to clipboard, switch view to plain text mode
this will output:Error: Cannot open[file.text] Unknow error.
?????? why??
Bookmarks