Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

fatal error: QtGui/QApplication: No such file or directory

Tags:

c++

qt

I'm using Qt Creator, and this line is generated automatically by the Qt Creator:

#include <QtGui/QApplication>

But, why am I getting this message?

QtGui/QApplication: No such file or directory

like image 344
Simplicity Avatar asked Apr 04 '11 07:04

Simplicity


2 Answers

Depending on the Qt-version (5) QtGui was moved to QtWidgets; so it becomes

#include <QtWidgets/QApplication>
like image 91
Miguel Rodriguez Avatar answered Sep 19 '22 11:09

Miguel Rodriguez


You can try to add 'declarative' to the Project file:

QT += gui declarative

then

#include <QApplication>

It helps me

like image 44
VeroLom Avatar answered Sep 20 '22 11:09

VeroLom