Clausen
19th April 2015, 14:08
Hi.
I am trying to open a file with the following code:
QFile* file = new QFile(filename);
QDataStream* stream;
if (file->open(QIODevice::ReadOnly))
{
stream = new QDataStream(file);
}
else
{
PRINT("Error opening file");
return;
}
And the program outputs:
QIODevice::open: File access not specified . 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.
I am trying to open a file with the following code:
QFile* file = new QFile(filename);
QDataStream* stream;
if (file->open(QIODevice::ReadOnly))
{
stream = new QDataStream(file);
}
else
{
PRINT("Error opening file");
return;
}
And the program outputs:
QIODevice::open: File access not specified . 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.