void FindWords::getTextFile() {
QFile myFile(":/FindingWords2.txt");
myFile.open(QIODevice::ReadOnly);
QTextStream textStream(&myFile);
QString line = textStream.readAll();
myFile.close();
ui->textEdit->setPlainText(line);
QTextCursor textCursor = ui->textEdit->textCursor();
textCursor.movePosition(QTextCursor::Start, QTextCursor::MoveAnchor, 1);
}
The QTextStream textStream(&myFile)
keeps giving me the error and I can't fix it.
QTextStream textStream(&myFile)一直给我错误,我无法修复它。
1 个解决方案
#1
16
You forgot to include <QTextStream>
or <QFile>
.
您忘记包含
#1
16
You forgot to include <QTextStream>
or <QFile>
.
您忘记包含