What's New in Qt 6.8
New and Restored Modules in Qt 6.8
Qt 6.8 adds the following modules and tools:
- The svgtoqml tool, used to generate QML code from SVG documents, is now out of tech preview. The tool supports a static subset of the
SVG Tiny 1.2
profile. - The Qt Graphs, Qt HTTP Server, Qt Protobuf, and Qt GRPC modules are all promoted out of tech preview state.
Removed Modules in Qt 6.8
The following module(s) is deprecated. We strongly advise against using them in new code.
- Qt 3D is deprecated. It remains part of the licensed software and is fully supported. It also remains part of the Qt Project and continues to be integrated with other modules for future releases. Critical bugs and security vulnerabilities will be addressed by the module maintainers at KDAB.
- Regarding new features and functionality, users should contact KDAB by emailing info@kdab.com.
New Features in Qt 6.8
Qt Core Module
- QChronoTimer is a replacement for QTimer using std::chrono durations throughout.
- QTimer::id() returns a Qt::TimerId, introduced and accepted in place of int timer IDs in new overloads of various methods that take one.
- More support for std::chrono durations to replace integral nanosecond parameters in QAbstractEventDispatcher.
- QString, QByteArray, and QList gain resizeForOverwrite().
- QString, QByteArray gain slice() equivalent to
*this = sliced()
. - QString, QByteArray, QList, QVarLengthArray gain max_size() for compatibility with the Standard Template Library (STL).
- QList supports construction with uninitialized entries to a specified size, where the content-type permits.
- QVarLengthArray::PreallocatedSize tells you the Prealloc parameter.
- QLatin1StringMatcher::indexOf() can now take a QStringView.
- QCollatorSortKey now supports move-construction.
- QStringEncoder and QStringDecoder can now take the encoding name as a QString.
- QThread gains isMainThread(), isCurrentThread().
- QThreadPool::waitForDone() now accepts a QDeadlineTimer in place of int milliseconds.
- QDirListing provides stl-style iteration over directory entries.
- QVersionNumber can now be constructed from a QSpan; it can also be iterated over.
- qHash() now accepts quint128 and qint128.
- QMap::qHash() tells you a key's hash value.
- QHash can now hash different types from its key, if they are marked as having the equivalent hash result for equivalent values (C++20 only). This works for QString/QStringView and QByteArray/QByteArrayView pairs. On all systems except on ARM processors, the QLatin1StringView also participates in the QString and QStringView hashing.
- QPointF, QLineF, QRectF, and QMarginsF now support fuzzy comparison and null-checks.
- Define QT_ENABLE_STRICT_MODE_UP_TO to opt out of various APIs, documented by which version it cuts them out at.
- Define QT_NO_QASCONST to disable qAsConst().
- Define QT_(NO_)USE_NODISCARD_FILE_OPEN to control
[[nodiscard]]
onopen()
methods of I/O classes. - QLibraryInfo::paths() returns all relevant paths.
- QCryptographicHash and QMessageAuthenticationCode gain hashInto() to compute the hash of data into a provided buffer.
- More QtCore types with
operator<()
now also supportoperator<=>()
when compiled with C++20 (andcompareThreeWay()
even for C++17). These types now consistently support all six relational operators (as hidden friends) and the reverse of each mixed-type comparison they supported. At Qt 6.8, this applies to:- qfloat16
- QAnyStringView
- QByteArray
- QByteArrayView
- QCborArray
- QCborMap
- QCborValue
- QChar
- QDate
- QDateTime
- QDeadlineTimer
- QElapsedTimer
- QLatin1Char
- QLatin1StringView
- QModelIndex
- QOperatingSystemVersion
- QPersistentModelIndex
- QString
- QStringView
- QTime
- QTypeRevision
- QUrl
- QUtf8StringView
- QUuid
- QVersionNumber
Qt Graphs Module
- Qt Graphs is promoted out of tech preview.
- The module is split into two submodules, QtGraphs and QtGraphsWidgets, to remove the requirement for including widgets into pure QML applications.
Qt GRPC Module
- Qt GRPC is promoted out of tech preview.
- Added streaming support to the GrpcQuick module.
- Removed QGrpcInterceptor, QGrpcInterceptorManager and QGrpcInterceptorContinuation.
- Added the
writesDone()
method to QGrpcClientStream and QGrpcBidirStream to half-close a stream from the client side.
Qt GUI Module
- QStyleHints::colorScheme now has a setter function that allows applications to try to override the system setting with an explicit Dark or Light scheme.
- Added QFont::ContextFontMerging, which can be used to enable a new font merging algorithm that takes the full string into account when selecting fallback fonts. This may come at some more cost, but in certain cases, it will give better results.
- Added QFont::PreferTypoLineMetrics style strategy, which can be set to always prefer the typographical line metrics in OpenType fonts, even if the font does not manually set the USE_TYPO_METRICS flag.
- Added QFontDatabase::addApplicationFallbackFontFamily(), which provides a means to override the default system fallback fonts for specific scripts.
- Added QDesktopServices custom and https URL scheme support for macOS, similar to what iOS has.
- QImage::Format_CMYK8888 32bit CMYK image format has been added.
- QColorSpace support for ICC A2B color spaces processing has been added, along with explicit support for grayscale and CMYK color spaces.
- Added support for QColorSpace::Bt2020, QColorSpace::Bt2100Pq, and QColorSpace::Bt2100Hlg HDR color spaces.
- QColorSpace::transformModel() returns the underlying processing model.
- QColorSpace::colorModel() returns which color model the color space is made for.
- QImage::colorTransformed() and QImage::applyColorTransform() variants with three arguments has been added to support converting both image format and color space at the same time.
- QStyleHints::contextMenuTrigger is a writable property that allows applications to control whether context menus should be opened via button press or release.
- Qt Accessibility interfaces now can support reporting of attributes as key/value pairs to clients.
- QAccessibleAnnouncementEvent can be raised by applications to request the announcement of a message by assistive technologies.
- QPageLayout::setMargins now can take an optional OutOfBoundsPolicy parameter to indicate whether margins that are out of bounds should be rejected or clamped.
- QPdfWriter gained CMYK support for pens/fills.
- QFontDatabase gained addApplicationFallbackFontFamily to specify the override default fallback font families for specific scripts.
- Completed multiview rendering support in QRhi. Multiview is now also supported with Vulkan 1.1 implementations, instead of requiring Vulkan 1.2. This is relevant in particular for Android-based devices such as the Meta Quest 3.
- Introduced QRhi support for automatically resolving multisample depth (depth/stencil) rendering into a non-multisample depth (depth/stencil) texture, on platforms and APIs where this can be supported. See QRhiTextureRenderTargetDescription::setDepthResolveTexture() and QRhi::ResolveDepthStencil for details.
Qt Network Module
- QNetworkAccessManager gained support for sending HTTP requests over a local socket using the unix+http: or local+http: scheme.
- QDnsLookup now supports sending DNS over TLS and can inform whether the DNS server has performed verification on data authenticity.
- QDnsLookup gained support for TLS Association records.
- QNetworkCacheMetaData, QNetworkProxy, QNetworkRequest, and QNetworkReply can now get and set headers.
- QNetworkRequestFactory allows setting the priority as well as attributes for future requests.
- Added classes QFormDataPartBuilder and QFormDataBuilder to ease the creation of QHttpMultipart messages.
Qt Network Auth Module
- Added QOAuthUriSchemeReplyHandler class, which handles private/custom and https URI scheme redirects (on supported platforms).
- Added Proof of Key Code Exchange (PKCE) support to the QOAuth2AuthorizationCodeFlow class. PKCE is a recommended security measure to mitigate authorization code interception attacks.
Qt Positioning Module
- The Qt Positioning Android backend can now provide altitude in MSL format on Android 14 and later.
Qt Protobuf Module
- The Qt Protobuf module is promoted out of tech preview.
Qt Quick Module
- Added font.contextFontMerging, which can be used to enable a new font merging algorithm that takes the full text into account when selecting fallback fonts. This may come at some more cost, but in certain cases it will give better results.
- Added font.preferTypoLineMetrics property, which can be set to always prefer the typographical line metrics in OpenType fonts, even if the font does not manually set the USE_TYPO_METRICS flag.
- Added the retainWhileLoading property to Image and BorderImage. When set to
true
on images that load asynchronously, the current image data will be retained until the new image is fully loaded. This can avoid flickering. - Added PlanarTransform, a utility object providing simple functions for specifying 2D transformation matrices.
- Added PathRectangle, an optionally rounded rectangle path for Shape and PathView.
- Added the Drag.imageSourceSize property to control the size of the image representing the data being dragged.
- Added QQuickRenderTarget::depthTexture as a way to set a custom depth texture.
- Added QQuickRenderTarget::Flag enumerator to allow specifying a view format when constructing through the named constructors.
- TableView now has support for programmatically and interactively moving columns and rows.
- All standard Qt Quick items and materials are made compatible with Multiview Rendering. This is utilized transparently to the applications when 2D content is embedded into an Qt Quick 3D XR scene and multiview rendering is enabled. Multiview rendering can improve rendering performance and decrease power consumption of AR/VR devices.
- Creating multiview-compatible custom materials (QSGMaterial, QSGMaterialShader) is made possible via QSGMaterial::viewCount().
- Added support for directing Qt Quick rendering into a 2D texture array with Multiview Rendering in QQuickRenderTarget. This is realized via new overloads of functions such as QQuickRenderTarget::fromVulkanImage(), and forms the foundation of multiview rendering support for XR applications built with Qt Quick 3D.
- Added support for automatically performing multisample resolve at the end of a render pass in QQuickRenderTarget. Previously multisample rendering of redirected Qt Quick scenes was only possible by targeting multisample textures, leaving resolving up to the application or its shaders. When enabled, Qt Quick will now automatically create intermediate, multisample textures for use as a color buffer, performing the resolve into the application-provided non-multisample texture automatically. This allows making Qt Quick rendering target textures provided by an external engine, framework, or API (e.g., OpenXR) that only provides and consumes non-multisample textures.
- Added support for setting a depth texture in QQuickRenderTarget. This allows specifying the application's own texture (or texture array, when using multiview rendering) where depth data is written, instead of using Qt's own intermediate buffers. Useful in particular when depth data must be written to a depth texture provided by an external engine, framework, or API (e.g., OpenXR).
- Added support for specifying a texture view format in QQuickRenderTarget. This is specified via the
viewFormat
argument in the new overloads for QQuickRenderTarget::fromVulkanImage() and similar. This feature is provided specifically to allow dropping or adding the sRGB qualifier from or to the texture format, and is useful when having to work with textures provided by an external engine, framework, or XR compositor, where control over the texture format is not available, yet the 3D APIs' implicit linear->sRGB conversion on shader writes is not acceptable (e.g., because the Qt Quick 3D material pipeline already performs the same operation). - QQuickRenderTarget's internal management of intermediate buffers for depth/stencil and multisample color data has been redesigned. Calling QQuickWindow::setRenderTarget() no longer invalidates all internal temporary buffers, but rather attempts reuse as long as the size, format, and other parameters match. This is expected to lead to performance improvements in applications and libraries that have to pass in a different native texture to the QQuickWindow on every frame (e.g, because the texture comes from a buffer pool maintained by an external engine, framework, or XR compositor).
Qt Quick Shapes Module
- Added the ShapePath.fillItem property. This can be used to take any texture provider item (such as layered items and images) and use them as fill for the shape.
- Added the ShapePath.fillTransform property, which can be used to set an arbitrary transform on the shape's fill, whether it is an item or a gradient.
Qt Quick 3D Module
- Technology Preview of XR support for Qt Quick 3D
- Support for Head Mounted Displays (HMD) using OpenXR such as the Meta Quest 2 and 3.
- Support for Apple Vision Pro.
- Multi-view rendering (render both eyes in a single pass).
- Spatial input support via hand tracking or controllers.
- Support for spatial anchors.
- Improved Shadow Rendering
- Overall quality improvements.
- Enhanced shadow debug tooling.
- Cascading Shadow Maps.
- Percentage-closer filtering (PCF) soft shadows.
- PrincipledMaterial Enhancements
- Additional parameters for adjusting Fresnel.
- Support for property masking based on the vertex color attribute.
- CustomMaterial: expose remaining properties from PrincipledMaterial.
Qt Quick VectorImage Module
- Introduced the VectorImage: A component which can be used to render vector graphics directly Qt Quick with hardware acceleration and no pre-rasterization. It currently supports the SVG format (a static subset of the
SVG Tiny 1.2
profile.)
Qt Shader Tools Module
- Completed support for shaders compatible with multiview rendering. Added the
MULTIVIEW
keyword to the Qt Shader Tools Build System Integration. - Added depfile support for shaders processed at build time via qt_add_shaders(). Touching a file included via the
#include
directive in a shader will now trigger a recompilation of that shader file when building the project the next time.
Qt Sql Module
- QSqlDatabase, QSqlQuery, and QSqlDriver gained numericalPrecisionPolicy.
- QSqlDatabase got a new function moveToThread() to change the thread affinity of the database connection.
- The PostgreSQL and MySQL/MariaDB drivers now correctly handle dates/times when the server is in a different timezone than the client.
- All logging is now done through categorized loggers, qt.sql, to improve debugging.
- QSqlField::defaultValue, value, readOnly, requiredStatus, length, precision, generated, autoValue, and tableName are now properties.
- QSqlIndex::name and cursorName, QSqlQuery::forwardOnly, and positionalBindingEnabled are now properties.
Qt Test Module
- Added QTEST_THROW_ON_FAIL and QTEST_THROW_ON_SKIP C++ macros and environment variables that, when defined, change how QCOMPARE()/QVERIFY()/QSKIP() etc exit the test function on failure. Instead of a return, exiting only the immediately-surrounding function, they throw a special exception instead, thereby exiting from sub-functions of the test function, all the way to QtTestLib.
- The QTRY_*_WITH_TIMEOUT macros now also accept chrono literals (was:
int
milliseconds). - QTest::failOnWarning() now has a no-parameter overload to support the common case of fail-on-any-warning, without needing to construct a match-everything regular expression.
- QSignalSpy no longer inherits from QObject. If your code uses the fact that QSignalSpy is-a QObject, you need to redesign around this now.
- The QSignalSpy::signal() method no longer necessarily returns an empty byte array when the connection failed. Use the existing isValid() method to determine whether a given QSignalSpy object listens to a valid signal on a valid object.
- The QCOMPARE_xx macros can now only find QTest::toString() expansions that are either found via Argument Dependent Lookup on the type in question or are an instantiation of the QTest::toString<T>() template. This matches the behavior of the QCOMPARE() macro.
Qt WebEngine Module
- QWebEngineFrame added for frame specific API, such as running javascript on specific frames, or printing specific frames.
- QWebEngineClientHints added to better control the browser identification to web pages using client hints DOM api.
- QWebEnginePermission added to manage new and existing website permissions. The existing permissions API in QWebEnginePage has been deprecated, and replaced by QWebEngineProfile::getPermission() and QWebEngineProfile::listPermissions()
- Added QWebEngineProfile::setPersistentPermissionsPolicy() to control how website permissions persist across browsing sessions. By default, incoming permissions are saved to disk.
- Added QWebEnginePermission::ClipboardReadWrite and QWebEnginePermission::LocalFontsAccess permission types.
- QWebEngineCertificateError::isMainFrame() indicates the certificate error is from a main or sub frame.
- QWebEngineNavigationRequest::hasFormData() added to indicate a navigation request sending form data.
- QWebEngineSettings::imageAnimationPolicy() added to control image animation policy.
Platform Changes
Desktop Platforms
Windows
- Changed the font system to use DirectWrite as the default backend. This enables some modern features which were not available with the legacy GDI backend. The previous backend is still available and can be enabled by passing
fontengine=gdi
as parameter to the QPA plugin.
Wayland Client on Linux
- Added a new window decoration style that is used on GNOME and uses similar styling as GNOME.
- Modal status of dialogs is now forwarded to the compositor via the new xdg-dialog-v1 protocol.
- Showing a window will now also request activation from the compositor (except when Qt::WA_ShowWithoutActivating is set).
- Added support to qtwaylandscanner to send null for null QString.
- Added options
PUBLIC_CODE
andPRIVATE_CODE
to qt6_generate_wayland_protocol_client_sources that control the options that are passed towayland-scanner
.
Mobile Platforms
Android
- Bumped the minimum supported version to Android 9.
- Added support for build.gradle namespace property.
- Added a CMake property QT_ANDROID_PACKAGE_NAME to set the package name.
- Updated Gradle to 8.7 and AGP to 8.4.0.
- Added support for building AAR library packages.
- Deprecated the native Android backend in Qt Multimedia.
- When opening libraries with QLibrary, JNI_OnLoad is no longer called by default.
- QtQuickView and QML Embedding:
- Added strong typing support for QtQuickView API.
- Added API to manage QML Components, under this Java classes under QtQuickView were moved to own classes. This includes:
- QtQuickView.SignalListener to QtSignalListener.
- QtQuickView.StatusChangeListener to QtQmlStatusChangeListener.
- QtQuickView Status to QtQmlStatus.
- Added Java classes QtAbstractItemModel, QtAbstractListModel, and QtModelIndex, that wraps QAbstractItemModel, QAbstractListModel, and QModelIndex, respectively.
- Added support for QML embedding from a Service.
visionOS
- Qt, and Qt applications can now be built for visionOS.
Embedded Platforms
List of API Changes
These pages contain an overview of API changes in Qt 6.8:
© 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.