QT5: QApplication, no such file or directory

it2025-06-01  12

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.

转载于:https://www.cnblogs.com/bhlsheji/p/5328883.html

最新回复(0)