Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
#include <QtGui> doesn't work
user001 last edited by
By running the example of FindDialog of C++ GUI Programming with Qt4, I found it wouldn't compile if only include <QtGui>. I have to #include individual widgets. I am using latest Qt (version 5.0.2). Qt cannot backward compatible with older version?
In Qt 5, widgets have been moved in the QtWidget module.
Qt 5 has many major changes compared to Qt 4. The code is mostly backwards compatible, but you need to change your configurations and headers.
Add this line to the .pro file...
QT += widgets
...and use #include <QtWidgets> instead of #include <QtGui>