QFile(Qt5)を使って簡単なテキストファイルを読み込もうとしているのですが、不思議なことにうまくいきません。以下は私のコードです。
QFile*file = new QFile("gh.txt");
if(file->open(QIODevice::ReadOnly))
{
QByteArray array;
array = file->readLine();
qDebug() << array;
}
file->close();
QDebug は常に空の文字列を取得します。#