1
votes

I made a program by using Qt Creator in Qt 4.x on an Ubuntu Linux platform in the last year. Now I don't use linux, instead I use Windows 7. I once again need my program which I made last year. I downloaded and installed Qt Creator onto Windows 7 platform. It came with Qt 5.1. I try to rebuilt it. I got below messages. What should I do?

C1083: Cannot open include file: 'QtGui/QApplication': No such file or directory
C1083: Cannot open include file: 'QDialog': No such file or directory

Thanks

3
<QtGui/QApplication> is now just <QApplication>.Markus Meskanen

3 Answers

2
votes

In Qt5 QApplication is no longer part of QtGui module, it's now in QtWidgets. In your #include directive use <QtWidgets/QApplication>, the same applies to QDialog.

1
votes

Use this in your .pro file.

QT += ...
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

The Qt modules have been rearranged somewhat in Qt5. Also this will teach for leaving Linux!

0
votes

There's a good guide on what has changed from QT 4.x to 5.x http://qt-project.org/wiki/Transition_from_Qt_4.x_to_Qt5