Changes in Qt Multimedia

The Qt Multimedia module in Qt 5 combines (and replaces) two older modules, namely the Qt Multimedia module from Qt 4.x, and Qt Multimedia Kit module from Qt Mobility. Existing code that uses Qt Multimedia from Qt 4 can be ported with minimal effort, but porting code that uses Qt Multimedia Kit may be a more involved process. The changed features section highlights changes relevant to porting.

Also, note that widget-based classes, such as QVideoWidget, are now in a separate module called Qt Multimedia Widgets.

New features in Qt 5.0

There are a number of new features in Qt Multimedia:

Removed features

A number of classes or features previously offered in Qt Multimedia or Qt Multimedia Kit have been removed.

Removed featureNotes
QMediaImageViewerThis class (and related controls and services) were removed since their functionality was not suitable for many applications

Changed features

A number of classes previously offered in Qt Multimedia or Qt Multimedia Kit have changed in ways that may affect previously written code. This table highlights such changes.

Changed featureNotes
qmake project file changesPreviously, to use Qt Multimedia Kit, the qmake project file must contain
CONFIG += mobility
MOBILITY += multimedia

Now, you only need to write

QT += multimedia

Or, if you want to use the widget classes,

QT += multimedia multimediawidgets
NamespacesThe QtMultimediaKit namespace has been renamed to QMultimedia. This affects a few enumerations, namely SupportEstimate, EncodingQuality, EncodingMode and AvailabilityStatus. Searching and replacing QtMultimediaKit with QMultimedia will greatly aid porting efforts. Metadata have been split off into their own namespace, QMediaMetaData.
Metadata typesIn Qt Multimedia Kit, pre-defined metadata keys were enumerations in the QtMultimediaKit namespace. These pre-defined keys have been changed to string literals in the QMediaMetaData namespace, for consistency with extended keys.
Metadata accessor methodsIn Qt Multimedia Kit, there were two different families of methods to access metadata. Functions such as QMediaObject::metaData() operated on pre-defined metadata using enumerated keys, while functions such as QMediaObject::extendedMetaData() operated on extended metadata using string keys. Qt 5 combines both families into one (e.g. QMediaObject::metaData()), which can operate on both pre-defined and extended metadata, using string keys.
Qt Metatype registrationQt 5 registers many more classes and types with the meta-object system than before. If you have previously applied Q_DECLARE_METATYPE macros to any Qt Multimedia class, you will probably need to remove them.
QSoundEffect availabilityThe SoundEffect QML type was publicly accessible in Qt Multimeda Kit, and now the C++ version is officially public too. If your code contains the previously undocumented QSoundEffect, you may need to update it.
Camera controlsA large number of the camera controls (QCameraImageProcessingControl, QCameraFocusControl, etc.) have been updated to address a number of design flaws. In particular, a number of discrete accessor methods have been collapsed into parametrized methods, and the ranges or data types of some parameters have been adjusted.

© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.