Hi.
I am trying to open a file with the following code:
{
}
else
{
PRINT("Error opening file");
return;
}
QFile* file = new QFile(filename);
QDataStream* stream;
if (file->open(QIODevice::ReadOnly))
{
stream = new QDataStream(file);
}
else
{
PRINT("Error opening file");
return;
}
To copy to clipboard, switch view to plain text mode
And the program outputs:
QIODevice::open: File access not specified
To copy to clipboard, switch view to plain text mode
. I would assume that the file access is ReadOnly. What am I doing wrong.
I am using Qt 5.2.1 and Qt Creator 3.0.1.
Bookmarks