QT5: QApplication, no such file or directory

时间:2023-03-09 19:32:10
QT5: QApplication, no such file or directory

In QT5, when I use this: #include<QApplication>, QT tells :no such file or directory, even though it is all right for previous version of QT.

It turns out these files QApplication and so on have been moved to other places.

How to correct?

#include <QApplication> --------------------> #include <QWidgets/QApplication>

#include <QDialog> --------------------> #include <QWidgets/QDialog>

#include <QLabel> --------------------> #include <QWidgets/QLabel>

.....................blabla

when I do this, still there are some errors, I dunno...........

another way is to change the .pro file, make it adapt to qt4.

In QT gui, the application is necessary for a program, it is used for managing the program application resources.