Porting C++ Applications to Qt 5 _ QtDoc 5

1
11/5/2014 Porting C++ Applications to Qt 5 | QtDoc 5.2 | Documentation | Qt Project http://qt-project.org/doc/qt-5/portingcppapp.html 1/1 Qt Project Downloads Documentation Forums Wiki Groups Blogs Qt Digia Register | Sign in Not registered? What are you waiting for? Just register and start collecting points. It's fun! Sharing 1 Tags what is this? Ratings what is this? 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 Core Internals Data Storage Graphics Mobile APIs Multimedia Networking and Connectivity Tools User Interfaces QML Applications Docs Qt 5 Porting C++ Applications to Qt 5 | QtDoc 5.2 Docmark Contents Related topics 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. 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. Related topics C++ API Changes 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 Notes provided by the Qt Community No notes Community Notes are available under Attribution-Share Alike 2.5 Generic

description

Porting C++

Transcript of Porting C++ Applications to Qt 5 _ QtDoc 5

  • 11/5/2014 Porting C++ Applications to Qt 5 | QtDoc 5.2 | Documentation | Qt Project

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

    Qt Project

    Downloads Documentation Forums Wiki Groups Blogs Qt Digia

    Register | Sign in

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

    Sharing

    1

    Tags what is this?

    Ratings what is this?

    Qt 5.2

    API LookupClass index

    Function index

    QML Types

    Qt Modules

    C++ Classes by Module

    QML APIs by Module

    All Qt references

    Getting StartedGetting Started with Qt

    What's New in Qt 5

    Examples and Tutorials

    Qt Licensing

    Supported PlatformsAndroid

    BlackBerry

    iOS

    Linux/X11

    Mac OS X

    Windows

    Windows CE

    All Supported Platforms

    OverviewsAll Qt Overviews

    Core Internals

    Data Storage

    Graphics

    Mobile APIs

    Multimedia

    Networking and Connectivity

    Tools

    User Interfaces

    QML Applications

    Docs Qt 5 Porting C++ Applications to Qt 5 | QtDoc 5.2 Docmark

    Contents

    Related topics

    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 thechanges 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 instance with #include .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 qmakeproject 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 throughthe changes required to achieve this:

    Open your project using Qt Creator.Replace all #include instances with #include 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.

    Related topics

    C++ API Changes

    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 thecopyrights of their respective owners. Information about Qt licenses are available in the Qt Licensing page.

    Hide Notes

    Notes provided by the Qt Community

    No notes

    Community Notes are available underAttribution-Share Alike 2.5 Generic