Porting C++ Applications to Qt 5
This topic talks about the Qt Widgets and Qt WebKit changes in Qt 5. The following step-by-step instructions take you through the changes required to port the Animated Tiles application to Qt 5:
- Open the Animated Tiles project using Qt Creator.
- Edit
main.cppand replace the#include <QtGui>instance with#include <QtWidgets>. - Edit the
animatedtiles.proand addQT += widgetstowards the end of the file.Note: Qt GUI is included by default in all Qt applications unless excluded using the
QT -= guidirective in theqmakeproject file. - Save the changes and run the application.
Once you see the application running, check whether it behaves as expected.

A similar change is needed to port Qt 4 C++ applications using Qt WebKit. The following step-by-step instructions take you through the changes required to achieve this:
- Open your project using Qt Creator.
- Replace all
#include <QtWebKit>instances with#include <QtWebKitWidgets>in your project source. - Edit the
.profile and addQT += webkitwidgets.Note: If the
QT +=statement already exists, appendwebkitwidgetsto it. - Save changes and run your application.