' qmainwindow'找不到文件
该程序有效,但我不喜欢
MainWindow.h:
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow> //'QMainWindow' file not found
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = nullptr);
~MainWindow();
private:
Ui::MainWindow *ui;
};
#endif // MAINWINDOW_H
因此,错误也出现在Main.cpp
:CPP:
#include "mainwindow.h" //In included file: 'QMainWindow' file not found
#include <QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
}
该程序仍然有效,但我仍然想知道问题的解决方案
the program works, but I don't like these errors
in mainwindow.h:
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow> //'QMainWindow' file not found
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = nullptr);
~MainWindow();
private:
Ui::MainWindow *ui;
};
#endif // MAINWINDOW_H
because of this, errors also appear in the main file
main.cpp:
#include "mainwindow.h" //In included file: 'QMainWindow' file not found
#include <QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
}
the program still works, but I would still like to know the solution to the problem
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
那找到答案: https://stackoverflow.com/a/a/58737644/18282426
我已经在 代码> help - &gt; <代码>关于模块... 和禁用
clangcodemodel
I have already found answer there: https://stackoverflow.com/a/58737644/18282426
so, select from above
help
->About modules...
and disableClangCodeModel