Vous êtes sur la page 1sur 1

11/5/2014

Porting C++ Applications to Qt 5 | QtDoc 5.2 | Documentation | Qt Project


Register | Sign in

Qt Project
Downloads

Docs

Qt 5

Documentation

Forums

Wiki

Groups

Blogs

Qt Digia

Porting C++ Applications to Qt 5 | QtDoc 5.2

Docmark
Sharing

Tags
Contents
Related topics

w hat is this?

Ratings

w hat is this?

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.cpp and replace the #include <QtGui> instance with #include <QtWidgets>.
Edit the animatedtiles.pro and add QT += widgets towards the end of the file.
Note: Qt GUI is included by default in all Qt applications unless excluded using the QT -= gui directive in the qmake
project file.
Save the changes and run the application.
Once you see the application running, check whether it behaves as expected.

Qt 5.2
API Lookup
Class index
Function index
QML Types
Qt Modules
C++ Classes by Module
QML APIs by Module
All Qt references
Getting Started
Getting Started with Qt
What's New in Qt 5
Examples and Tutorials
Qt Licensing
Supported Platforms
Android
BlackBerry
iOS
Linux/X11
Mac OS X
Windows
Windows CE
All Supported Platforms
Overviews
All Qt Overviews

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 .pro file and add QT += webkitwidgets.
Note: If the QT += statement already exists, append webkitwidgets to it.
Save changes and run your application.

Core Internals

Related topics

Tools

C++ API Changes

Data Storage
Graphics
Mobile APIs
Multimedia
Networking and Connectivity
User Interfaces
QML Applications

Porting QML Applications to Qt 5 Example


Qt Examples And Tutorials

Copyright 2013 Digia Plc and/or it's subsidiaries. Documentation contributions included herein are the
copyrights of their respective owners. Information about Qt licenses are available in the Qt Licensing page.

Hide Notes

Not registered?
What are you waiting for? Just
register and start collecting points.
It's fun!

Notes provided by the Qt Community

No notes
Community Notes are available under
Attribution-Share Alike 2.5 Generic

http://qt-project.org/doc/qt-5/portingcppapp.html

1/1

Vous aimerez peut-être aussi