What's New in Qt 6.2

New and Restored Modules in Qt 6.2

Qt 6.2 adds the following module:

  • QtQuick.Dialogs - A QML module that provides native dialogs with a Qt Quick fallback on platforms where Qt does not provide a native one. FileDialog and FontDialog are available in this release.

Qt 6.2 reintroduces the following modules that were not present in Qt 6.1. All listed modules were ported to Qt 6 and the CMake build system.

New Features in Qt 6.2

Qt Core Module

  • Added functionality:
    • Added QByteArrayView::compare().
    • Added methods QFlags::test(Any)Flag(s).
    • Added QHashSeed to control hashing (seeds are now size_t); this shall replace qGlobalQHashSeed and qSetGlobalQHashSeed.
    • Added PRIxQTDATATYPE macros to facilitate printf()-style formatting without casts or warnings.
    • Added a permissions API to QCoreApplication for controlling access to camera, file system, network devices, and so on.
  • Made many properties bindable.
  • Grapheme clusters can now handle emojis.
  • UNC paths and network shares on Windows are now handled consistently.
  • QCalendar now supports construction from the ID of a custom backend.
  • QChar, QPoint, and QPointF are now primitive rather than merely relocatable.
  • QCoreApplication::exit() is now, like quit(), a slot (as the documentation long claimed); same for QEventLoop and QThread.
  • QDateTime now takes account of time-zones throughout time_t's range (in so far as the platform supplies such information), rather than artificially limiting the range to 1970 - 2037.
  • Fleshed out the value-type behavior of QFlags, and it is now used more systematically.
  • When building for C++20, QList (hence also QVector) is now a contiguous_iterator, satisfying contiguous_range.
  • QLocalSocket::waitFor*() methods were made to support duplex operations on Windows (as they already did on Unix).
  • Added std::chrono overloads to QLockFile methods, avoiding needless conversions between UTC and local time.
  • QString can now be built from char8_t (when available).
  • Made QThreadPool's thread priority configurable; the threads share the pool's name if it has one.
  • Lots of Bug-fixing, clean up, and documentation improvements.

Qt GUI Module

  • Added floating point image formats to QImage for both 16-bit and 32-bit floats.
  • Converting RGB images to, or painting RGB colors onto, gray-scale images is now gamma corrected and produces the luminance values of the input color space.

Qt Quick Module

Qt Quick Controls Module

  • Added a new control; SelectionRectangle. This control can be used to select cells in a TableView by using a styled selection rectangle.

Qt Network Module

  • QSslSocket
    • TLS backends that were previously (in Qt 6.1) converted into plugin-like classes, were moved out of QtNetwork and implemented as real plugins.
    • Several TLS backends may now co-exist at runtime, for example, OpenSSL and Schannel, or OpenSSL and SecureTransport.
  • QNetworkInformation
    • Introduced isBehindCaptivePortal, a new property that can be used to determine whether the user is connected to a network with a captive portal.

Qt QML Module

  • Core language
    • Added support for optional chaining.
    • Added as casts: these mostly help tooling but can also be used to replace code such as return (obj instanceof Item) ? obj.width : 42 with (obj as Item)?.width ?? 42.
  • Added a public CMake API for QML modules: qt_add_qml_module().
    • Takes care of generating qmldir and qmltypes.
    • Can automatically create a plugin if a plugin only registers types.
    • Has built-in support for a linting target.
  • QML tooling
    • qmllint
      • Added a granular setting for the warning severity; warnings can be disabled entirely, make them informational only, or make them lead to a non-zero exit code.
      • Added a settings file (.qmllint.ini) for configuring warning levels on a directory-by-directory basis. A default settings file can be generated using qmllint --write-defaults.
      • Warnings can now be disabled in blocks via comments; //qmllint enable/disable <warning-type1> <warning-type2...>
      • Greatly improved performance when linting files, especially when linting multiple files with lots of imports.
      • Added support for JSON output for use in tooling.
    • qmlformat
      • qmlformat now utilizes our new qmldom library and should generally produce better output.

Qt Quick 3D Module

  • Added support for instanced rendering, an optimized way of drawing multiple instances of the same objects with different transformations.
  • Added 3D Particles, an API for adding particle effects to 3D scenes. This includes a technology preview of model blend particles.
  • Added Qt Quick Input events for 2D items in 3D, both in scene and in textures.
  • Added an API for ray-based picking from arbitrary points in the scene.
  • Added RuntimeLoader, making it possible to load glTF2 files at runtime.
  • Implemented parallax occlusion mapping: Enables the use of height maps without the cost of adding geometry.
  • Implemented depth draw mode on materials: Enables fine control over depth rendering for a material.

Qt Data Visualization Module

  • Fixed background rendering mode.
  • RenderDirectToBackground_NoClear was deprecated as opting to not clear the window is no longer an option in Qt 6.
  • Lots of minor bug fixes.

Qt Charts Module

  • Added more marker shapes to pick from in QScatterSeries and QLegend.
  • Added a light marker feature to QXYSeries and QLegend. This is a lighter weight rendering of points.
  • Added an ability to select points in a series via method calls to QXYSeries and QBarSet.
  • Added an ability to set a color or use a custom light marker to be used for selected points in QXYSeries.
  • Added an ability to set a color to be used for selected bars in QBarSet.
  • Added a feature to display a best fit line in a QXYSeries.
  • Added an ability to customize the look of individual points in a QXYSeries. This feature allows setting the visibility, label visibility, and the size of each point.
  • Added a method sizeBy() to QXYSeries that adjusts the size of the points in a series according to passed values.
  • Added a method colorBy() to QXYSeries that adjusts color of the points in a series according to passed values and a gradient.
  • Added a new axis class QColorAxis to support the colorBy() feature, displaying a color scale.
  • Added an ability to disable label truncation in axes.
  • Improved performance by caching recently used text bounds.
  • Added interactive support to QLegend via a setInteractive() method. Once enabled, allows the legend to be detached with a double-click. Once detached, the legend can be dragged and resized, and reattached to a side of the chart by dragging it off the edge.
  • Added attachedToChartChanged() signal to QLegend.
  • Updated the legend example.

Platform Changes

Android

  • Some of the methods previously under the QtAndroid namespace in QtAndroidExtras (for example, sdkVersion() and context()), were moved to QNativeInterface::QAndroidApplication.
  • Implemented a new permissions API in QCoreApplication.
  • The remaining QtAndroidExtras APIs were left as private APIs in qtbase until cross-platform alternatives (for Intents, Services, etc.) are in place.
  • Removed obsolete Ministro code as it's now unsupported by Android.
  • Simplified AndroidManifest.xml to only contain tags relevant to the user, helping maintainability and reducing clutter.
  • QCDebug() and friends now use the category as a tag in Android logcat.
  • Updated Android Gradle plugin to 4.1.3.

List of API Changes

These pages contain an overview of API changes in Qt 6.2:

Additions to Other Qt 6 Releases