New Features in Qt 5.0: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(8 intermediate revisions by 4 users not shown)
Line 1: Line 1:
[[Category:Developing_with_Qt::Qt 5]]<br />h1. Qt 5 Features
{{Cleanup | reason=Auto-imported from ExpressionEngine.}}
 
[[Category:Release]]
[[Category:Developing with Qt::Qt 5]]
= Qt 5 Features =
'''This content should be put in qtdoc/doc/src/qt5-intro.qdoc'''
'''This content should be put in qtdoc/doc/src/qt5-intro.qdoc'''
[toc align_right=&quot;yes&amp;quot;]


'''FIXME PLEASE ADD THE INFORMATION RELATIVE TO YOUR OWN COMPONENT'''
'''FIXME PLEASE ADD THE INFORMATION RELATIVE TO YOUR OWN COMPONENT'''
Line 9: Line 9:
== FIXME To be sorted out ==
== FIXME To be sorted out ==


Also we have: QTemporaryDir, Added a<br />QStringLiteral macro, and C+''11 support, better logging support through qDebug
Also we have: QTemporaryDir, Added a
<br />Some new add-on modules: jsondb, qgraphicseffects
QStringLiteral macro, and C+''11 support, better logging support through qDebug
<br />h2. Qt Essentials
 
<br />h3. Qt Core
Some new add-on modules: jsondb, qgraphicseffects
<br />h4. QStandardPaths
== Porting to Qt5 ==
<br />QStandardPaths is a more powerful version of [[Doc:QDesktopServices]] that was present in Qt 4. Modelled after &lt;a href=&quot;http://api.kde.org/4.x-api/kdelibs-apidocs/kdecore/html/classKStandardDirs.html&amp;quot;&gt;KStandardDirs&amp;lt;/a&amp;gt; from KDE 4, it contains more features, like searching for all occurrences of a given file in the storage locations.
In [http://doc.qt.io/qt-5.6/portingguide.html Porting Guide] basic information is given how to port Qt4 applications to Qt5.
<br />h4. MimeTypes
 
<br />QMimeDatabase offers the functionality of determining the mimetype for a given file<br />or memory buffer, from extension and/or from the contents.
== Qt Essentials ==
<br />The MIME type database is provided by the freedesktop.org shared-mime-info<br />project. If the MIME type database cannot be found on the system, as is the case<br />on most Windows and Mac OS X systems, Qt will use its own copy of it.
=== [http://doc.qt.io/qt-5.6/qtcore-index.html Qt Core] ===
<br />h4. JSON support
==== QStandardPaths ====
<br />QtCore now includes a set of classes for parsing and generating JSON documents. Those classes allow you to convert between in memory binary representation of JSON to standard textual JSON format. The goal is to make common operations on JSON fast.
[http://doc.qt.io/qt-5.6/qstandardpaths.html QStandardPaths] is a more powerful version of [[Doc:QDesktopServices]] that was present in Qt 4. Modelled after [http://api.kde.org/4.x-api/kdelibs-apidocs/kdecore/html/classKStandardDirs.html KStandardDirs] from KDE 4, it contains more features, like searching for all occurrences of a given file in the storage locations.
<br />h4. Compile-time checking for signal-slot connections
 
<br />QObject now supports an additional syntax for connecting signals to slots that forces the compiler to check that both the signal and the receiver exist, and that their arguments are compatible.
==== MimeTypes ====
<br />The syntax allows connecting a signal to any kind of C''+ receiver, including C+''11 lambdas, member functions, or static functions. The receivers no longer need to be declared as slots.
[http://doc.qt.io/qt-5.6/QMimeDatabase.html QMimeDatabase] offers the functionality of determining the mimetype for a given
<br />h4. Perl-Compatible Regular Expressions
file or memory buffer, from extension and/or from the contents.
<br />A new class called QRegularExpression is provided that supports regular expressions compatible with Perl. This class is more powerful and faster than QRegExp, and supports more features, like lazy and possessive quantifiers, lookbehinds, named capturing groups and iteration of matches.
 
<br />h3. Qt GUI
The MIME type database is provided by the freedesktop.org shared-mime-info project. If the MIME type database cannot be
<br />h4. New enabler classes for windowing and rendering
found on the system, as is the case on most Windows and Mac OS X systems, Qt will use its own copy of it.
<br />A new set of enabler classes have been added, most importantly QWindow, QScreen,<br />QSurfaceFormat, and QOpenGLContext. These are now used as backends for the<br />QtWidgets module, and directly by QtQuick 2.
 
<br />h4. A set OpenGL classes mostly equivalent to the ones in Qt 4's QtOpenGL module
==== JSON support ====
<br />Most of the useful Qt OpenGL classes have been polished and moved into<br />Qt GUI. See QOpenGLFramebufferObject, QOpenGLShaderProgram,<br />QOpenGLFunctions, etc.
QtCore now includes a set of classes for parsing and generating [http://doc.qt.io/qt-5.6/json.html JSON] documents. Those classes allow you to convert between in memory binary representation of JSON to standard textual JSON format. The goal is to make common operations on JSON fast.
<br />The replacement for QGLContext, QOpenGLContext, is more generic and decoupled<br />from QWindow, making it support more use cases, such as using the same context<br />for multiple surfaces.
 
<br />h4. QOpenGLPaintDevice
==== Compile-time checking for signal-slot connections ====
<br />Instead of having QWindow and QOpenGLFramebufferObject be subclasses of<br />QPaintDevice, there's now QOpenGLPaintDevice that can be created on the stack,<br />making the use of QPainter to render into the currently bound context easier and<br />more flexible.
QObject now supports an additional syntax for [http://doc.qt.io/qt-5.6/qobject.html#connect-3 connecting] signals to slots that forces the compiler to check that both the signal and the receiver exist, and that their arguments are compatible.
<br />h4. Support for additional mouse buttons, often present on &quot;gamer&amp;quot; mouse devices
 
<br />Qt Applications can now receive Button Events from many more mouse buttons: Up to 27 mouse buttons on XCB, XLIB, or DirectFB; up 16 mouse buttons on Wayland, Evdev, or OS-X; and up to 8 mouse buttons on BlackBerry/QNX. Qt on Windows continues to support only 5 mouse buttons; this is a limitation of the Windows Platform.
The syntax allows connecting a signal to any kind of C''+ receiver, including C+''11 lambdas, member functions, or static functions. The receivers no longer need to be declared as slots.
<br />h3. Qt Network
 
<br />h4. QDnsLookup
==== Perl-Compatible Regular Expressions ====
<br />It is now possible to lookup DNS records using the new QDnsLookup API.<br />This does not replace QHostInfo, which is still the API to use for resolving a host name to an IP address.<br />QDnsLookup is mainly used for other types of DNS record, such as SRV, TXT and MX<br />This replaces the deprecated Q3Dns API.
A new class called [http://doc.qt.io/qt-5.6/qregularexpression.html QRegularExpression] is provided that supports regular expressions compatible with Perl. This class is more powerful and faster than [http://doc.qt.io/qt-5.6/qregexp.html QRegExp], and supports more features, like lazy and possessive quantifiers, lookbehinds, named capturing groups and iteration of matches.
<br />h4. Improved support for IPv6 and dual mode networks
 
<br />Most applications using host names and network layer transparent protocols will gain IPv6 support transparently.<br />QTcpServer &amp; QUdpSocket bound to QHostAddress::Any will be able to receive both IPv4 and IPv6 connections.<br />QHostAddress::AnyIPv4 and QHostAddress::AnyIPv6 can be used to bind to only one protocol.<br />Outgoing http connections using QNetworkAccessManager will attempt both IPv4 and IPv6 connections in parallel, and keep the first to succeed. This will help in environments where one protocol has limited connectivity.
=== [http://doc.qt.io/qt-5.6/qtgui-index.html Qt GUI] ===
<br />h4. Binding of TCP sockets
==== New enabler classes for windowing and rendering ====
<br />QTcpSocket can be bound to an IP address before connecting, which can be used to limit the connection to a specific interface in a multihomed environment.
A new set of enabler classes have been added, most importantly
<br />h4. Removal of QFtp and QHttp APIs
[http://doc.qt.io/qt-5.6/qwindow.html QWindow],
<br />The QHttp API has been removed, due to duplicated functionality.<br />QNetworkAccessManager can be used instead for nearly all cases.<br />The QFtp API has been removed as a public API, due to implementation quality.<br />QNetworkAccessManager can be used to get/put an ftp url.<br />These APIs will be provided in a standalone form to ease migration.
[http://doc.qt.io/qt-5.6/qscreen.html QScreen],
<br />h4. SSL Certificate Extensions
[http://doc.qt.io/qt-5.6/qsurfaceformat.html QSurfaceFormat],
<br />Support for accessing SSL certificate extensions has been added, this is useful both for developers using the Qt framework, and also as a basis for further development of Qt's SSL support.
and [http://doc.qt.io/qt-5.6/qopenglcontext.html QOpenGLContext]. These are now used as backends for the
<br />h4. SSL Certificate Verification
[http://doc.qt.io/qt-5.6/qtwidgets-index.html QtWidgets] module, and directly by  
<br />Support for verifying an SSL certificate chain programatically, not just when connecting to an SSL server was added.
[http://doc.qt.io/qt-5.6/qtquick-index.html QtQuick 2].
<br />h4. Workarounds for Buggy SSL Servers
 
<br />Support for working around buggy SSL servers was added, as can be seen at http://doc.qt.nokia.com/5.0-snapshot/qssl.html#SslOption-enum this allows QSslSocket based code to access legacy systems by enabling bug workarounds etc. This change was backported to Qt 4.8.
==== A set OpenGL classes mostly equivalent to the ones in Qt 4's [http://doc.qt.io/qt-5.6/qtopengl-index.html QtOpenGL] module ====
<br />h4. Support for opaque Private Keys
Most of the useful Qt OpenGL classes have been polished and moved into
<br />This allows applications to read private keys from devices such as PKCS#11 dongles, as illustrated by http://git.iksaif.net/?p=qsslkey-p11.git;a=tree
Qt GUI. See [http://doc.qt.io/qt-5.6/QOpenGLFramebufferObject.html QOpenGLFramebufferObject],
[http://doc.qt.io/qt-5.6/QOpenGLShaderProgram.html QOpenGLShaderProgram],
[http://doc.qt.io/qt-5.6/QOpenGLFunctions.html QOpenGLFunctions], etc.
 
The replacement for QGLContext, QOpenGLContext, is more generic and decoupled
from QWindow, making it support more use cases, such as using the same context
for multiple surfaces.
 
==== QOpenGLPaintDevice ====
Instead of having QWindow and QOpenGLFramebufferObject be subclasses of
QPaintDevice, there's now [http://doc.qt.io/qt-5.6/QOpenGLPaintDevice.html  QOpenGLPaintDevice]
that can be created on the stack, making the use of QPainter to render into the currently bound context easier and
more flexible.
 
==== Support for additional mouse buttons, often present on "gamer" mouse devices ====
Qt Applications can now receive Button Events from many more mouse buttons: Up to 27 mouse buttons on XCB, XLIB, or DirectFB; up 16 mouse buttons on Wayland, Evdev, or OS-X; and up to 8 mouse buttons on BlackBerry/QNX. Qt on Windows continues to support only 5 mouse buttons; this is a limitation of the Windows Platform.


<br />h3. Qt QML
=== [http://doc.qt.io/qt-5.6/qtnetwork-index.html Qt Network] ===
<br />This is a new module in Qt 5 that provides the QML engine and backend infrastructure.
==== QDnsLookup ====
<br />h4. QML Engine
It is now possible to lookup DNS records using the new [http://doc.qt.io/qt-5.6/QDnsLookup.html QDnsLookup] API.
<br />* JavaScript engine has changed to V8.<br />* Various parser and compiler optimizations have been implemented, as well as a new bindings optimizer.<br />* Loading/compilation can now be performed in a separate thread. Enable this by loading a Loader object asynchronously through its source property, or by passing the Component.Asynchronous parameter to Qt.createComponent().<br />* New QQmlEngine::trimComponentCache() which safely discards unused data in the engine's component cache to free memory.
This does not replace QHostInfo, which is still the API to use for resolving a host name to an IP address.
<br />h4. Type System
QDnsLookup is mainly used for other types of DNS record, such as SRV, TXT and MX
<br />* New &quot;var&amp;quot; property type. This is a general-purpose property type which obsoletes the &quot;variant&amp;quot; type. Properties of the &quot;var&amp;quot; type may hold JavaScript references. See &quot;QML Basic Types&amp;quot; for more information.<br />* QML properties of type &quot;var&amp;quot; and &quot;variant&amp;quot; can now hold pixmaps. See &quot;Scarce Resources in JavaScript&amp;quot; for more information.<br />* ValueType improvements:<br />'''''' QColor is now a value type. The red, green, blue and alpha channels of a &quot;color&amp;quot; property can be accessed via &quot;r&amp;quot;, &quot;g&amp;quot;, &quot;b&amp;quot; and &quot;a&amp;quot; properties<br />'''''' Improved support for QVector4D, now constructible in QML via Qt.vector4d()<br />* Support for certain sequence types (QList&amp;lt;int&amp;gt;, QList&amp;lt;qreal&amp;gt;, QList&amp;lt;bool&amp;gt;, QList&amp;lt;QUrl&amp;gt;, QList&amp;lt;QString&amp;gt; and QStringList) has been improved. QObjects can define Q_PROPERTYs of these types which can be accessed transparently from JavaScript.
This replaces the deprecated Q3Dns API.
<br />h4. Modules and Imports
<br />* Arbitrary functionality may be provided in a namespace through a Module API. See &quot;qmlRegisterModuleApi()&quot; for more information.<br />* JavaScript (.js) files may now import QML modules and other JavaScript files using the &quot;.import&amp;quot; syntax.
<br />h4. Other
<br />* QQmlExpression can now be constructed directly (and more efficiently) from a QQmlScriptString.<br />* The component returned by Qt.createComponent() is no longer parented to the engine. Be sure to hold a reference, or provide a parent.


<br />h3. Qt Quick
==== Improved support for IPv6 and dual mode networks ====
<br />This is a new module in Qt 5 which provides the visual canvas and scenegraph backend as well as the QtQuick QML module for QML application development.
Most applications using host names and network layer transparent protocols will gain IPv6 support transparently.
<br />Qt Quick 2 is based on an OpenGL scenegraph. The following C''+ classes replace their QDeclarative* equivalents in Qt Quick 1:
QTcpServer & QUdpSocket bound to QHostAddress::Any will be able to receive both IPv4 and IPv6 connections.
QHostAddress::AnyIPv4 and QHostAddress::AnyIPv6 can be used to bind to only one protocol.
Outgoing http connections using QNetworkAccessManager will attempt both IPv4 and IPv6 connections in parallel, and keep the first to succeed. This will help in environments where one protocol has limited connectivity.
 
==== Binding of TCP sockets ====
QTcpSocket can be bound to an IP address before connecting, which can be used to limit the connection to a specific interface in a multihomed environment.
 
==== Removal of QFtp and QHttp APIs ====
The QHttp API has been removed, due to duplicated functionality.
QNetworkAccessManager can be used instead for nearly all cases.
The QFtp API has been removed as a public API, due to implementation quality.
QNetworkAccessManager can be used to get/put an ftp url.
These APIs will be provided in a standalone form to ease migration.
 
==== SSL Certificate Extensions ====
Support for accessing SSL certificate extensions has been added, this is useful both for developers using the Qt framework, and also as a basis for further development of Qt's SSL support.
 
==== SSL Certificate Verification ====
Support for verifying an SSL certificate chain programatically, not just when connecting to an SSL server was added.
 
==== Workarounds for Buggy SSL Servers ====
Support for working around buggy SSL servers was added, as can be seen at http://doc.qt.nokia.com/5.0-snapshot/qssl.html#SslOption-enum this allows QSslSocket based code to access legacy systems by enabling bug workarounds etc. This change was backported to Qt 4.8.
 
==== Support for opaque Private Keys ====
This allows applications to read private keys from devices such as PKCS#11 dongles, as illustrated by http://git.iksaif.net/?p=qsslkey-p11.git;a=tree
 
 
=== [http://doc.qt.io/qt-5.6/qtqml-index.html Qt QML] ===
This is a new module in Qt 5 that provides the QML engine and backend infrastructure.
 
==== QML Engine ====
* JavaScript engine has changed to V8.
* Various parser and compiler optimizations have been implemented, as well as a new bindings optimizer.
* Loading/compilation can now be performed in a separate thread. Enable this by loading a Loader object asynchronously through its source property, or by passing the Component.Asynchronous parameter to Qt.createComponent().
* New QQmlEngine::trimComponentCache() which safely discards unused data in the engine's component cache to free memory.
 
==== Type System ====
* New "var" property type. This is a general-purpose property type which obsoletes the "variant" type. Properties of the "var" type may hold JavaScript references. See "QML Basic Types" for more information.
* QML properties of type "var" and "variant" can now hold pixmaps. See "Scarce Resources in JavaScript" for more information.
* ValueType improvements:
'''''' QColor is now a value type. The red, green, blue and alpha channels of a "color" property can be accessed via "r", "g", "b" and "a" properties
'''''' Improved support for QVector4D, now constructible in QML via Qt.vector4d()
* Support for certain sequence types (QList<int>, QList<qreal>, QList<bool>, QList<QUrl>, QList<QString> and QStringList) has been improved. QObjects can define Q_PROPERTYs of these types which can be accessed transparently from JavaScript.
 
==== Modules and Imports ====
* Arbitrary functionality may be provided in a namespace through a Module API. See "qmlRegisterModuleApi()" for more information.
* JavaScript (.js) files may now import QML modules and other JavaScript files using the ".import" syntax.
 
==== Other ====
* QQmlExpression can now be constructed directly (and more efficiently) from a QQmlScriptString.
* The component returned by Qt.createComponent() is no longer parented to the engine. Be sure to hold a reference, or provide a parent.
 
 
=== [http://doc.qt.io/qt-5.6/qtquick-index.html Qt Quick] ===
This is a new module in Qt 5 which provides the visual canvas and scenegraph backend as well as the QtQuick QML module for QML application development.
 
Qt Quick 2 is based on an OpenGL scenegraph. The following C''+ classes replace their QDeclarative* equivalents in Qt Quick 1:


* QQuickView
* QQuickView
Line 128: Line 195:
==== Positioners (Row, Column, Grid, Flow types): ====
==== Positioners (Row, Column, Grid, Flow types): ====


* The &quot;add&amp;quot; and &quot;move&amp;quot; transitions can now access a ViewTransition attached property (see the ViewTransition documentation for examples) and can now animate arbitrary item properties (instead of being restricted to animating an item's position).
* The "add" and "move" transitions can now access a ViewTransition attached property (see the ViewTransition documentation for examples) and can now animate arbitrary item properties (instead of being restricted to animating an item's position).
* New Positioner.index, Positioner.isFirstItem and Positioner.isLastItem attached properties for items in positioners.
* New Positioner.index, Positioner.isFirstItem and Positioner.isLastItem attached properties for items in positioners.
* Grid:
* Grid:
Line 165: Line 232:
** This type can now be used as a value source, and will also restore any previously set binding when its ''when'' clause becomes false.
** This type can now be used as a value source, and will also restore any previously set binding when its ''when'' clause becomes false.


=== Qt Multimedia ===
=== [http://doc.qt.io/qt-5.6/qtmultimedia-index.html Qt Multimedia] ===


Qt Multimedia is a new essential module replacing the QtMultimedia library and Qt MultimediaKit mobility API in Qt 4.8. It features full support for Audio and Video playback and recording. Support for web cameras is integrated.
Qt Multimedia is a new essential module replacing the QtMultimedia library and Qt MultimediaKit mobility API in Qt 4.8. It features full support for Audio and Video playback and recording. Support for web cameras is integrated.
Line 175: Line 242:
== Add-ons ==
== Add-ons ==


=== Qt 3D ===
=== [http://doc.qt.io/qt-5.6/qt3d-index.html Qt 3D] ===


Qt 3D is a new Qt 5.0 module, although it has existed as a labs project for a number of years, and has also contributed a lot of code to Qt. For example the classes QMatrix4x4, QGLShaderProgram and QVector3D all come from Qt 3D originally. Qt3D runs on top of QML2 and the Qt OpenGL support.
Qt 3D is a new Qt 5.0 module, although it has existed as a labs project for a number of years, and has also contributed a lot of code to Qt. For example the classes QMatrix4x4, QGLShaderProgram and QVector3D all come from Qt 3D originally. Qt3D runs on top of QML2 and the Qt OpenGL support.


Qt 3D contains two libraries:<br />* Qt 3D Quick - Use QML to code 3D content, accelerated by OpenGL<br />* Qt 3D - C++ classes which support Qt 3D Quick, and can also be used directly
Qt 3D contains two libraries:
* Qt 3D Quick - Use QML to code 3D content, accelerated by OpenGL
* Qt 3D - C++ classes which support Qt 3D Quick, and can also be used directly


Current Feature Set for Qt 3D includes:<br />* GL renderer including basic lighting<br />* 3D Scene management<br />* Loading of 3D assets such as .obj and .3ds files<br />* Stock shapes and geometry<br />* Geometry loading and management<br />* Textures and materials<br />* Simple geometric animations<br />* Cameras and Views
Current Feature Set for Qt 3D includes:
* GL renderer including basic lighting
* 3D Scene management
* Loading of 3D assets such as .obj and .3ds files
* Stock shapes and geometry
* Geometry loading and management
* Textures and materials
* Simple geometric animations
* Cameras and Views


The above features are all exposed by the QML API. Additionally in QML you can:<br />* Create inline or from source file shaders which automatically bind to QML properties<br />* Create 3D scenes by using QML scoping<br />* Mix declarative code such as animation easing curves and states with 3D
The above features are all exposed by the QML API. Additionally in QML you can:
* Create inline or from source file shaders which automatically bind to QML properties
* Create 3D scenes by using QML scoping
* Mix declarative code such as animation easing curves and states with 3D


=== Qt Location ===
=== [http://doc.qt.io/qt-5.6/qtlocation-index.html Qt Location] ===


Qt Location is a new Qt 5.0 module although it has existed as part of Qt Mobility for a number of years. Compared to the feature set provided by the Qt Mobility version of the Location API the following changes have been made:
Qt Location is a new Qt 5.0 module although it has existed as part of Qt Mobility for a number of years. Compared to the feature set provided by the Qt Mobility version of the Location API the following changes have been made:
Line 192: Line 272:
* Arbitrary QML2 items on the map are supported using MapQuickItem
* Arbitrary QML2 items on the map are supported using MapQuickItem
* Model-view support for creating map objects from a QML model
* Model-view support for creating map objects from a QML model
* Built-in support for pinch-to-zoom gestures, flicking and &quot;kinetic&amp;quot; panning
* Built-in support for pinch-to-zoom gestures, flicking and "kinetic" panning
* Vast performance improvements over Mobility 1.2, especially for large map polylines and objects in general
* Vast performance improvements over Mobility 1.2, especially for large map polylines and objects in general
* Full QML API now available for routing and geocoding — compatible with standard QML model-view design
* Full QML API now available for routing and geocoding — compatible with standard QML model-view design
* Service provider feature detection without having to open all the available plugins
* Service provider feature detection without having to open all the available plugins
* Unified &quot;Plugin&amp;quot; QML element used by routing/geocoding/maps etc with easy-to-set PluginParameters
* Unified "Plugin" QML element used by routing/geocoding/maps etc with easy-to-set PluginParameters
* Landmarks API is replaced by the Places API:
* Landmarks API is replaced by the Places API:
** Both C++ and QML APIs have been reworked to be simpler to use.
** Both C++ and QML APIs have been reworked to be simpler to use.
Line 203: Line 283:
** There is a REST Plugin which allows access to a Places REST service
** There is a REST Plugin which allows access to a Places REST service
** There is a JsonDb Plugin which allows saving of locally stored favorites
** There is a JsonDb Plugin which allows saving of locally stored favorites
{{Release Information}}

Latest revision as of 05:45, 25 February 2017

This article may require cleanup to meet the Qt Wiki's quality standards. Reason: Auto-imported from ExpressionEngine.
Please improve this article if you can. Remove the {{cleanup}} tag and add this page to Updated pages list after it's clean.

Qt 5 Features

This content should be put in qtdoc/doc/src/qt5-intro.qdoc

FIXME PLEASE ADD THE INFORMATION RELATIVE TO YOUR OWN COMPONENT

FIXME To be sorted out

Also we have: QTemporaryDir, Added a QStringLiteral macro, and C+11 support, better logging support through qDebug

Some new add-on modules: jsondb, qgraphicseffects

Porting to Qt5

In Porting Guide basic information is given how to port Qt4 applications to Qt5.

Qt Essentials

Qt Core

QStandardPaths

QStandardPaths is a more powerful version of Doc:QDesktopServices that was present in Qt 4. Modelled after KStandardDirs from KDE 4, it contains more features, like searching for all occurrences of a given file in the storage locations.

MimeTypes

QMimeDatabase offers the functionality of determining the mimetype for a given file or memory buffer, from extension and/or from the contents.

The MIME type database is provided by the freedesktop.org shared-mime-info project. If the MIME type database cannot be found on the system, as is the case on most Windows and Mac OS X systems, Qt will use its own copy of it.

JSON support

QtCore now includes a set of classes for parsing and generating JSON documents. Those classes allow you to convert between in memory binary representation of JSON to standard textual JSON format. The goal is to make common operations on JSON fast.

Compile-time checking for signal-slot connections

QObject now supports an additional syntax for connecting signals to slots that forces the compiler to check that both the signal and the receiver exist, and that their arguments are compatible.

The syntax allows connecting a signal to any kind of C+ receiver, including C+11 lambdas, member functions, or static functions. The receivers no longer need to be declared as slots.

Perl-Compatible Regular Expressions

A new class called QRegularExpression is provided that supports regular expressions compatible with Perl. This class is more powerful and faster than QRegExp, and supports more features, like lazy and possessive quantifiers, lookbehinds, named capturing groups and iteration of matches.

Qt GUI

New enabler classes for windowing and rendering

A new set of enabler classes have been added, most importantly QWindow, QScreen, QSurfaceFormat, and QOpenGLContext. These are now used as backends for the QtWidgets module, and directly by QtQuick 2.

A set OpenGL classes mostly equivalent to the ones in Qt 4's QtOpenGL module

Most of the useful Qt OpenGL classes have been polished and moved into Qt GUI. See QOpenGLFramebufferObject, QOpenGLShaderProgram, QOpenGLFunctions, etc.

The replacement for QGLContext, QOpenGLContext, is more generic and decoupled from QWindow, making it support more use cases, such as using the same context for multiple surfaces.

QOpenGLPaintDevice

Instead of having QWindow and QOpenGLFramebufferObject be subclasses of QPaintDevice, there's now QOpenGLPaintDevice that can be created on the stack, making the use of QPainter to render into the currently bound context easier and more flexible.

Support for additional mouse buttons, often present on "gamer" mouse devices

Qt Applications can now receive Button Events from many more mouse buttons: Up to 27 mouse buttons on XCB, XLIB, or DirectFB; up 16 mouse buttons on Wayland, Evdev, or OS-X; and up to 8 mouse buttons on BlackBerry/QNX. Qt on Windows continues to support only 5 mouse buttons; this is a limitation of the Windows Platform.

Qt Network

QDnsLookup

It is now possible to lookup DNS records using the new QDnsLookup API. This does not replace QHostInfo, which is still the API to use for resolving a host name to an IP address. QDnsLookup is mainly used for other types of DNS record, such as SRV, TXT and MX This replaces the deprecated Q3Dns API.

Improved support for IPv6 and dual mode networks

Most applications using host names and network layer transparent protocols will gain IPv6 support transparently. QTcpServer & QUdpSocket bound to QHostAddress::Any will be able to receive both IPv4 and IPv6 connections. QHostAddress::AnyIPv4 and QHostAddress::AnyIPv6 can be used to bind to only one protocol. Outgoing http connections using QNetworkAccessManager will attempt both IPv4 and IPv6 connections in parallel, and keep the first to succeed. This will help in environments where one protocol has limited connectivity.

Binding of TCP sockets

QTcpSocket can be bound to an IP address before connecting, which can be used to limit the connection to a specific interface in a multihomed environment.

Removal of QFtp and QHttp APIs

The QHttp API has been removed, due to duplicated functionality. QNetworkAccessManager can be used instead for nearly all cases. The QFtp API has been removed as a public API, due to implementation quality. QNetworkAccessManager can be used to get/put an ftp url. These APIs will be provided in a standalone form to ease migration.

SSL Certificate Extensions

Support for accessing SSL certificate extensions has been added, this is useful both for developers using the Qt framework, and also as a basis for further development of Qt's SSL support.

SSL Certificate Verification

Support for verifying an SSL certificate chain programatically, not just when connecting to an SSL server was added.

Workarounds for Buggy SSL Servers

Support for working around buggy SSL servers was added, as can be seen at http://doc.qt.nokia.com/5.0-snapshot/qssl.html#SslOption-enum this allows QSslSocket based code to access legacy systems by enabling bug workarounds etc. This change was backported to Qt 4.8.

Support for opaque Private Keys

This allows applications to read private keys from devices such as PKCS#11 dongles, as illustrated by http://git.iksaif.net/?p=qsslkey-p11.git;a=tree


Qt QML

This is a new module in Qt 5 that provides the QML engine and backend infrastructure.

QML Engine

  • JavaScript engine has changed to V8.
  • Various parser and compiler optimizations have been implemented, as well as a new bindings optimizer.
  • Loading/compilation can now be performed in a separate thread. Enable this by loading a Loader object asynchronously through its source property, or by passing the Component.Asynchronous parameter to Qt.createComponent().
  • New QQmlEngine::trimComponentCache() which safely discards unused data in the engine's component cache to free memory.

Type System

  • New "var" property type. This is a general-purpose property type which obsoletes the "variant" type. Properties of the "var" type may hold JavaScript references. See "QML Basic Types" for more information.
  • QML properties of type "var" and "variant" can now hold pixmaps. See "Scarce Resources in JavaScript" for more information.
  • ValueType improvements:

' QColor is now a value type. The red, green, blue and alpha channels of a "color" property can be accessed via "r", "g", "b" and "a" properties ' Improved support for QVector4D, now constructible in QML via Qt.vector4d()

  • Support for certain sequence types (QList<int>, QList<qreal>, QList<bool>, QList<QUrl>, QList<QString> and QStringList) has been improved. QObjects can define Q_PROPERTYs of these types which can be accessed transparently from JavaScript.

Modules and Imports

  • Arbitrary functionality may be provided in a namespace through a Module API. See "qmlRegisterModuleApi()" for more information.
  • JavaScript (.js) files may now import QML modules and other JavaScript files using the ".import" syntax.

Other

  • QQmlExpression can now be constructed directly (and more efficiently) from a QQmlScriptString.
  • The component returned by Qt.createComponent() is no longer parented to the engine. Be sure to hold a reference, or provide a parent.


Qt Quick

This is a new module in Qt 5 which provides the visual canvas and scenegraph backend as well as the QtQuick QML module for QML application development.

Qt Quick 2 is based on an OpenGL scenegraph. The following C+ classes replace their QDeclarative* equivalents in Qt Quick 1:

  • QQuickView
  • QQuickCanvas
  • QQuickItem
  • QQuickPaintedItem

The QtQuick 2.0 QML module is a major update. Below are the additions and changes for the QtQuick 2.0 QML Module:

Visual and Graphic types

  • New Canvas type for drawing. This provides a HTML5 canvas like API along with some additional features.
    • Supports two render targets: Canvas.Image and Canvas.FramebufferObject.
    • Supports background thread rendering.
    • Supports tiled canvas rendering.
    • Supports most of the HTML5 context2d APIs.
  • Image:
    • New horizontalAlignment and verticalAlignment properties.
    • New Image.Pad enum value for fillMode that does not transform the image, unlike the other fillMode enum values.
    • Setting Image sourceSize.width and sourceSize.height now fits the image to the size, maintaining aspect ratio.

Animations

  • New SpriteSequence type renders animated sprites and can transition between animations.
  • New Sprite type which represents each animation in a SpriteSequence.
  • New AnimatedSprite type for drawing single sprite animations.

Text

  • Text:
    • With AutoText format, a Text item now automatically switches to StyledText instead of RichText.
    • New onLineLaidOut handler is called for every line during the layout process to give the option of positioning and/or resizing lines as they are laid out.
    • New doLayout() method will trigger the text layout from Javascript.
    • RightElide is now supported where text spans multiple lines.
    • New fontSizeMode property allows text to be fitted to the item size.
    • New minimumPixelSize and minimumPointSize properties can be used to specify a lower bound when auto-fitting.
  • TextEdit:
    • textFormat property now defaults to PlainText instead of AutoText.
  • TextInput:
    • New wrapMode property.
    • New verticalAlignment properties.
    • positionAt() function now takes a y parameter.

User Input

  • New MultiPointTouchArea type.
    • Processes multi-point touches and provides information on touch points including position, pressure and velocity.
  • MouseArea:
    • Wheel events are now propagated.
    • The clicked, doubleClicked and pressAndHold events are now propagated differently to pressed. These will now be propagated to the highest-stacking-order enabled MouseArea which has a handler for them. You can still ignore these events in the handler to let them pass through. This behavior is triggered with the new property propagateComposedEvents.
    • New propagateComposedEvents property sets whether composed events are propagated to other mouse areas.

Specialised Containers

  • Flickable:
    • New rebound property allows a transition to be specified for a flickable's bounce back animation.
    • New topMargin, bottomMargin, leftMargin, rightMargin allow extra margin space to be specified for a flickable. This can be used, for example, to implement the pull-to-refresh functionality for a list.
    • New xOrigin and yOrigin properties provide the top left position of the content item.
    • New dragging, draggingHorizontally and draggingVertically properties provide information on whether a flickable is currently being dragged.

Positioners (Row, Column, Grid, Flow types):

  • The "add" and "move" transitions can now access a ViewTransition attached property (see the ViewTransition documentation for examples) and can now animate arbitrary item properties (instead of being restricted to animating an item's position).
  • New Positioner.index, Positioner.isFirstItem and Positioner.isLastItem attached properties for items in positioners.
  • Grid:
    • New rowSpacing and columnSpacing properties.
    • All spacing properties on positioners now use real numbers instead of integers.

Models and Views

  • ListView and GridView:
    • Transitions can now be specified to animate the adding, removing and moving of items in a view. See the documentation for ViewTransition and ListView.add, ListView.addDisplaced, GridView.add, GridView.addDisplaced etc. for details.
    • New verticalLayoutDirection property enables items to be laid out from bottom-to-top using the BottomToTop enum value.
    • The cacheBuffer property now has a non-zero default and delegates in the cacheBuffer are created asynchronously.
    • New headerItem and footerItem properties provide access to the instantiated header and footer items.
    • RightToLeft layout now also reverses the preferredHighlightBegin and preferredHighlightEnd.
  • ListView only:
    • New section.labelPositioning property can fix the current section label to the start of the view, and the next section label to the end of the view, so that labels do not scroll while section items are still in view.
  • PathView:
    • New currentItem property.
    • New maximumFlickVelocity property.

Particles System Support

The new QtQuick.Particles 2.0 module provides support for the composition of a variety of 2D particle systems. See the QtQuick.Particles documentation for comprehensive details.

Utility types

  • New PathArc, PathCurve and PathSvg types:
    • PathArc and PathCurve support the construction of arcs and catmull-rom curves, respectively. PathSvg supports the construction of a path from a SVG string.
  • Loader:
    • New asynchronous property allows components to be instantiated with lower chance of blocking.
      • If source is used with asynchonous: true the component will be compiled in a background thread.
    • New active property delays instantiation of a Loader object's item.
    • New setSource(JSObject) method for specifying initial property values for the loaded item, similar to Component.createObject().
    • sourceChanged signal is now only emitted when the source is changed and the sourceComponentChanged signal is now only emitted when the sourceComponent is changed. (Previously Loader emitted both signals when only one of the properties had changed.)
  • Binding:
    • This type can now be used as a value source, and will also restore any previously set binding when its when clause becomes false.

Qt Multimedia

Qt Multimedia is a new essential module replacing the QtMultimedia library and Qt MultimediaKit mobility API in Qt 4.8. It features full support for Audio and Video playback and recording. Support for web cameras is integrated.

Qt Multimedia uses the system's native multimedia engine as a backend, and does not come with it's own audio or video codecs. Thus the supported list of codecs is equivalent to the ones supported by the underlying OS.

Qt Multimedia uses DirectShow and WMF on Windows, AVFoundation on Mac and gstreamer on Linux. An implementation for Blackberry 10 is also available.

Add-ons

Qt 3D

Qt 3D is a new Qt 5.0 module, although it has existed as a labs project for a number of years, and has also contributed a lot of code to Qt. For example the classes QMatrix4x4, QGLShaderProgram and QVector3D all come from Qt 3D originally. Qt3D runs on top of QML2 and the Qt OpenGL support.

Qt 3D contains two libraries:

  • Qt 3D Quick - Use QML to code 3D content, accelerated by OpenGL
  • Qt 3D - C++ classes which support Qt 3D Quick, and can also be used directly

Current Feature Set for Qt 3D includes:

  • GL renderer including basic lighting
  • 3D Scene management
  • Loading of 3D assets such as .obj and .3ds files
  • Stock shapes and geometry
  • Geometry loading and management
  • Textures and materials
  • Simple geometric animations
  • Cameras and Views

The above features are all exposed by the QML API. Additionally in QML you can:

  • Create inline or from source file shaders which automatically bind to QML properties
  • Create 3D scenes by using QML scoping
  • Mix declarative code such as animation easing curves and states with 3D

Qt Location

Qt Location is a new Qt 5.0 module although it has existed as part of Qt Mobility for a number of years. Compared to the feature set provided by the Qt Mobility version of the Location API the following changes have been made:

  • Maps are now part of the QML2 scenegraph, and rendered using hardware- accelerated OpenGL
  • Arbitrary QML2 items on the map are supported using MapQuickItem
  • Model-view support for creating map objects from a QML model
  • Built-in support for pinch-to-zoom gestures, flicking and "kinetic" panning
  • Vast performance improvements over Mobility 1.2, especially for large map polylines and objects in general
  • Full QML API now available for routing and geocoding — compatible with standard QML model-view design
  • Service provider feature detection without having to open all the available plugins
  • Unified "Plugin" QML element used by routing/geocoding/maps etc with easy-to-set PluginParameters
  • Landmarks API is replaced by the Places API:
    • Both C++ and QML APIs have been reworked to be simpler to use.
    • The new API supports viewing of richer content such as reviews, images and editorials
    • The new API also supports locale handling, sponsored search results and supplier attribution
    • There is a REST Plugin which allows access to a Places REST service
    • There is a JsonDb Plugin which allows saving of locally stored favorites
Release Information [edit]
Qt Version Overview Tools and Versions New Features Changes Known Issues
Qt 6.8 Qt 6.8 Release Qt 6.8 Tools and Versions New Features in Qt 6.8 Qt 6.8.0 Release Note Qt 6.8 Known Issues
Qt 6.7 Qt 6.7 Release Qt 6.7 Tools and Versions New Features in Qt 6.7 Qt 6.7.0 Release Note

Qt 6.7.1 Release NoteQt 6.7.2 Release Note

Qt 6.7 Known Issues
Qt 6.6 Qt 6.6 Release Qt 6.6 Tools and Versions New Features in Qt 6.6 Qt 6.6.0 Release NoteQt 6.6.1 Release NoteQt 6.6.2 ReleaseQt 6.6.3 Release Qt 6.6 Known Issues
Qt 6.5 Qt 6.5 Release Qt 6.5 Tools and Versions New Features in Qt 6.5 Qt 6.5.0 Release NoteQt 6.5.1 Release NoteQt 6.5.2 Release NoteQt 6.5.3 Release Note Qt 6.5 Known Issues
Qt 6.4 Qt 6.4 Release Qt 6.4 Tools and Versions New Features in Qt 6.4 Qt 6.4.0 Release NoteQt 6.4.1 Release NoteQt 6.4.2 Release NoteQt 6.4.3 Release Note Qt 6.4 Known Issues
Qt 6.3 Qt 6.3 Release Qt 6.3 Tools and Versions New Features in Qt 6.3 Qt 6.3.0 Release NoteQt 6.3.1 Release Note Qt 6.3 Known Issues
Qt 6.2 Qt 6.2 Release Qt 6.2 Tools and Versions New Features in Qt 6.2 Qt 6.2.0 Release NoteQt 6.2.1 Release NoteQt 6.2.2 Release Note Qt 6.2 Known Issues
Qt 6.1 Qt 6.1 Release Qt 6.1 Tools and Versions New Features in Qt 6.1 Qt 6.1.0 Release NoteQt 6.1.1 Release NoteQt 6.1.2 Release NoteQt 6.1.3 Release Note Qt 6.1.0 Known IssuesQt 6.1.1 Known issues in release noteQt 6.1.2 Known issues in release noteQt 6.1.3 Known issues in release note
Qt 6.0 Qt 6.0 Release Qt 6.0 Tools and Versions New Features in Qt 6.0 Qt 6.0.0 Change FilesQt 6.0.1 Release NoteQt 6.0.2 Release NoteQt 6.0.3 Release NoteQt 6.0.4 Release Note Qt 6.0.0 Known IssuesQt 6.0.1 Known IssuesQt 6.0.2 Known IssuesQt 6.0.3 Known IssuesQt 6.0.4 Known Issues
Qt 5.15 Qt 5.15 Release Qt 5.15 Tools and Versions New Features in Qt 5.15 Qt 5.15.0 Change FilesQt 5.15.1 Change FilesQt 5.15.2 Change Files Qt 5.15.0 Known IssuesQt 5.15.1 Known IssuesQt 5.15.2 Known IssuesQt 5.15.4 Known Issues
Qt 5.14 Qt 5.14 Release Qt 5.14 Tools and Versions New Features in Qt 5.14 Qt 5.14.0 Change FilesQt 5.14.1 Change FilesQt 5.14.2 Change Files Qt 5.14.0 Known IssuesQt 5.14.1 Known IssuesQt 5.14.2 Known Issues
Qt 5.13 Qt 5.13 Release Qt 5.13 Tools and Versions New Features in Qt 5.13 Qt 5.13.0 Change FilesQt 5.13.1 Change FilesQt 5.13.2 Change Files Qt 5.13.0 Known IssuesQt 5.13.1 Known IssuesQt 5.13.2 Known Issues
Qt 5.12 Qt 5.12 Release Qt 5.12 Tools and Versions New Features in Qt 5.12 Qt 5.12.0 Change FilesQt 5.12.1 Change FilesQt 5.12.2 Change FilesQt 5.12.3 Change FilesQt 5.12.4 Change FilesQt 5.12.5 Change FilesQt 5.12.6 Change FilesQt 5.12.7 Change FilesQt 5.12.8 Change FilesQt 5.12.9 Change FilesQt 5.12.10 Change FilesQt 5.12.11 Release NoteQt 5.12.12 Release Note Qt 5.12.0 Known IssuesQt 5.12.1 Known IssuesQt 5.12.2 Known IssuesQt 5.12.3 Known IssuesQt 5.12.4 Known IssuesQt 5.12.5 Known IssuesQt 5.12.6 Known IssuesQt 5.12.7 Known IssuesQt 5.12.8 Known IssuesQt 5.12.9 Known IssuesQt 5.12.10 Known IssuesQt 5.12.11 Known issues in release noteQt 5.12.12 Known issues in release note
Qt 5.11 Qt 5.11 Release Qt 5.11 Tools and Versions New Features in Qt 5.11 Qt 5.11.0Qt 5.11.1Qt 5.11.2 Change FilesQt 5.11.3 Change Files Qt 5.11.0Qt 5.11.1Qt 5.11.2 Known IssuesQt 5.11.3 Known Issues
Qt 5.10 Qt 5.10 Release Qt 5.10 Tools and Versions New Features in Qt 5.10 Qt 5.10.0Qt 5.10.1 Change Files Qt 5.10.0Qt 5.10.1 Known Issues
Qt 5.9 Qt 5.9 Release Qt 5.9 Tools and Versions New Features in Qt 5.9 Qt 5.9.0Qt 5.9.1Qt 5.9.2Qt 5.9.3Qt 5.9.4Qt 5.9.5Qt 5.9.6 Change FilesQt 5.9.7 Change FilesQt 5.9.8 Change FilesQt 5.9.9 Change Files Qt 5.9.0Qt 5.9.1Qt 5.9.2Qt 5.9.3Qt 5.9.4Qt 5.9.5Qt 5.9.6 Known IssuesQt 5.9.7 Known IssuesQt 5.9.8 Known IssuesQt 5.9.9 Known Issues
Qt 5.8 Qt 5.8 Release Qt 5.8 Tools and Versions New Features in Qt 5.8 Qt 5.8.0 Change Files Qt 5.8.0 Known Issues
Qt 5.7 Qt 5.7 Release Qt 5.7 Tools and Versions New Features in Qt 5.7 Qt 5.7.0Qt 5.7.1 Change Files Qt 5.7.0Qt 5.7.1 Known Issues
Qt 5.6 Qt 5.6 Release Qt 5.6 Tools and Versions New Features in Qt 5.6 Qt 5.6.0Qt 5.6.1Qt 5.6.2Qt 5.6.3 Change Files Qt 5.6.0Qt 5.6.1Qt 5.6.2Qt 5.6.3 Known Issues
Qt 5.5 Qt 5.5 Release Qt 5.5 Tools and Versions New Features in Qt 5.5 Qt 5.5.0Qt 5.5.1 Change Files Qt 5.5.0Qt 5.5.1 Known Issues
Qt 5.4 Qt 5.4 Release Qt 5.4 Tools and Versions New Features in Qt 5.4 Qt 5.4.0Qt 5.4.1Qt 5.4.2 Change Files Qt 5.4.0Qt 5.4.1Qt 5.4.2 Known Issues
Qt 5.3 Qt 5.3 Release Qt 5.3 Tools and Versions New Features in Qt 5.3 Qt 5.3.0Qt 5.3.1Qt 5.3.2 Change Files Qt 5.3.0 Beta 1Qt 5.3.0 RC 1
Qt 5.3.0Qt 5.3.1Qt 5.3.2 Known Issues
Qt 5.2 Qt 5.2 Release New Features in Qt 5.2 Qt 5.2.0Qt 5.2.1 Change Files Qt 5.2.0 Beta 1Qt 5.2.0 RC 1
Qt 5.2.0Qt 5.2.1 Known Issues
Qt 5.1 Qt 5.1 Release New Features in Qt 5.1 Qt 5.1.0 Change Files Qt 5.1.0 Beta 1Qt 5.1.0 RC 1
Qt 5.1.0Qt 5.1.1 Known Issues
Qt 5.0 Qt 5.0.0Qt 5.0.1 Release New Features in Qt 5.0 Qt 5.0 Changes Qt 5.0.0 Beta 1Qt 5.0.0 Beta 2Qt 5.0.0 RC 1Qt 5.0.0 RC 2
Qt 5.0.0Qt 5.0.1Qt 5.0.2 Known Issues