Can't import QApplication?
-
Heyya!
I was just kicking of a new project so started by writing the usual basic code, nothing fancy:
#include <QApplication> int main(int argc, char *argv[]) { QApplication app(argc, argv); return app.exec(); }
And I get an error telling me " 'QApplication' file not found ". I have absolutely no idea why it would do that, it's the first time is does that.
I tried opening a qt project with MSVC recently, I doubt that would be the reason, but who knows?I know I could include it from my c:\Qt file, but IDK where it is, and it would be very anoying to have to do that for every #include.
Please help!
Do ask away for any info needed! I thank you already for the help you might provide!
-
Hi,
Do you have
QT += widgets
In your .pro file ?
-
Did you re-run qmake after modifying the .pro file ?
It's part of the widgets module.
-
It is not a widget, it is part of the widgets module because it is responsible of setting the connection with the window manager and other stuff like that.
Being in the widgets module does not mean that every class in there is a QWidget.