Q ++ Qt中的错误:具有初始化程序但类型不完整

use*_*294 5 c++ qt

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);
}
Run Code Online (Sandbox Code Playgroud)

QTextStream textStream(&myFile)不断给我的错误,我不能修复它.

Tyl*_*eau 18

你忘了包括<QTextStream><QFile>.