Qt 6.10 的新功能
Qt 6.10 的新模块和还原模块
Qt 6.10 添加了下列模块和工具:
Qt 6.10 的新特征
Qt Core 模块
-
QLocale
现在更新到 CLDR (公共区域设置数据存储库) 第 47 版
-
QLocale::uiLanguages
() now includes truncated entries and is better-ordered
-
QLocale::toString
() overloads for integral type now accept precision and width
-
The system locale is now distinguished in
qDebug
() output from the CLDR-derived one for the same language, script and territory
-
QLocale::toString
(double, ...)'s exponent separator now again matches the case requested
-
QCalendar::daysInMonth
() for unspecified year now gives the maximal value
-
新的
QRangeModel
class provides an implementation of
QAbstractItemModel
that can operate on any C++ range.
-
QXmlStreamReader::readRawInnerData
() for retrieving the raw inner XML content of an element.
-
Error handling API for
QXmlStreamWriter
with
Error
enum,
error
(),
errorString
(),和
raiseError
() 函数。
-
QXmlStreamWriter::stopWritingOnError
() property, allowing users to control whether output halts immediately after encountering an error.
-
添加
QFuture::cancelChain
() to cancel the entire continuation chain using any non-finished
QFuture
from the chain.
-
新的
qEnvironmentVariableIntegerValue
returns the numerical value of an environment variable, or
std::nullopt
if the variable is not set or doesn't hold an integer.
-
QFileInfo::isOther
() returns true for file system entries that are neither a directory, regular file, or symbolic link.
-
添加
QSortFilterProxyModel::endFilterChange
() taking a
Direction
parameter, to balance a previous call to
endFilterChange
(). These APIs replace
invalidateFilter
(), which will be deprecated starting from Qt 6.13.
-
Two new overloads of
QMetaObject::connect
() make it possible to connect the
QMetaMethod
of a signal to a slot function or lambda.
-
QCborValue::toStringView
() 和
QJsonValue::toStringView
() return a view of the string stored in the value, without any allocations.
-
使用
QDataStream::operator bool()
and
QTextStream::operator bool()
to check whether the stream is in an error state.
-
使用
nullTerminate
() to add a null terminator to a
QByteArray
or
QString
, e.g. after constructing them via
QByteArray::fromRawData
(). Test whether the array or string is null terminated with isNullTerminated().
-
QByteArray
can now implicitly convert to a std::string_view.
Qt DBus 模块
Qt Graphs 模块
Qt GRPC 模块
Qt GUI 模块
-
QStyleHints::accessibility
provides access to user accessibility preferences, such as whether the system has enabled a setting for increased contrast.
-
添加
QAccessibilityHints
to access individual accessibility settings.
-
QRhi
: Added support for enumerating 3D graphics adapters (physical devices), when running on Direct 3D 11, 12, or Vulkan, via the
enumerateAdapters
() 函数。
-
QPainterPath::setCachingEnabled
() can be used to turn on the caching of calculated values, increasing performance for certain operations at the expense of additional memory use.
-
添加
QPainterPath::trimmed
() to return a section of the path.
Qt HttpServer 模块
Qt Lottie Animation
-
Added support for solid, null and precomposition layers.
-
添加
lottietoqml
tool. This is an equivalent tool to
svgtoqml
and it converts Lottie files to Qt Quick scenes described in QML. It is currently in tech preview.
-
Added a plugin for
VectorImage
which enables it to load Lottie files in addition to SVG. This feature is tech preview and requires
assumeTrustedSource
to be set to
true
.
-
Added lottietoqml example and qtlottieviewer example to demonstrate usage of
Qt Lottie Animation
.
-
Added a native PipeWire audio backend.
-
Audio pitch compensation for the FFmpeg-based
QMediaPlayer
based on the excellent
Signalsmith Stretch library
. The behavior can be customized via the
pitchCompensation
特性。
-
QCapturableWindow
can now be constructed from
QWindow
in both C++ and QML.
-
Added a new class
QPlaybackOptions
that allows users to control low-level FFmpeg media playback options, for example, playback intent, network timeout, and probe size.
-
在
QAudioSink
and
QAudioSource
, added methods that allow users to operate with the underlying audio buffer in frame count instead of byte count.
Qt Network 模块
-
Added fromFile() method to
QSslCertificate
.
-
Added setDateTimeValue() to
QHttpHeaders
, a convenience method for setting date and time values in HTTP headers.
-
Added convenience methods to
QHttpHeaders
to retrieve values as
QDateTime
, integers, or lists of these types.
Qt Protobuf 模块
Qt QML 模块
-
添加新
TreeModel
QML type that allows the definition of a tree structure in the QML file and works with
TreeView
.
-
添加
SortFilterProxyModel
QML type to sort and filter model data. This feature is in tech preview.
-
Added the delegateModelAccess property to
DelegateModel
and all views. You can now write through required properties into the model.
-
添加
Synchronizer
QML type. Synchronizer keeps two or more properties in sync without using bindings. This feature is in tech preview.
-
Added semicolon customization rules to qmlformat. You can now control whether semicolons are added to the end of JS statements.
-
Added new qmllint warnings focused on improving compatibility with Qt Creator, including checks for Qt Design Studio-specific limitations, additional JavaScript-related warnings, and several new warnings related to QML enums and imports.
-
Removed support for manipulation of complex row structures from
TableModel
.
-
Changed the order of the role and value parameters in
TableModel::setData
to resolve ambiguity.
Qt Quick 模块
-
添加
FlexboxLayout
QML type to arrange the quick items in flexible way as similar to
CSS Flexbox
. This feature is in tech preview.
Qt Quick Controls 模块
-
The FluentWinUI3 style has improved support for contrast themes on Windows 11.
-
添加
SearchField
Control
Qt Quick Dialogs 模块
-
Added property
popupType
which can be used to control whether a non-native dialog should open in a separate window or as an item in the existing scene. This has no effect when using native dialogs.
Qt Quick Effects Module
Qt Quick 3D 模块
-
Added emit-mode to shaped emitters to allow particles to be emitted based on the surface normals of the shape.
-
实现
reversed
emitters to enable particles to run from end time to begin time.
-
Several lightmap-related improvements and changes:
-
Introduced texels-per-unit based lightmap sizes, adding the
Model::texelsPerUnit
and
Lightmapper::texelsPerUnit
properties and replacing the now deprecated
Model::lightmapBaseResolution
特性。
-
引入
Lightmapper::source
property to set one lightmap source for the whole scene, replacing and deprecating
BakedLightmap::loadPrefix
.
-
Added a builtin GPU-based Non-local Means (NLM) denoising for baked lightmaps, controlled via the
Lightmapper::denoiseSigma
特性。
-
The lightmap baking window has been improved to show a progress bar and an estimation of time remaining.
-
Baking is now done in its own RHI context and does not block rendering of the running application.
-
RAM and VRAM usage has been decreased when baking certain scenes.
-
Added a lightmap viewer tool for debugging baked lightmap files via GUI or command-line.
-
Fixed color import for glTF2 baseColorFactor by correctly converting from linear to sRGB, aligning it with the spec.
-
添加
CapsuleGeometry
to
QtQuick3D
.Helpers with fixed textures, async creation support, and exposed uvProfile property.
Qt Quick 3D XR 模块
-
暴露
method
for requesting room scanning for spatial anchors.
Qt Quick 3D Physics 模块
Qt Quick VectorImage 模块
-
Added support for animated SVGs that matches animation support in Qt SVG.
-
添加
API
to indicate whether source file is trusted or not.
-
添加
API
to control animation behavior.
-
By including a plugin provided by
Qt Lottie Animation
,
VectorImage
can now also show Lottie files. This feature is regarded as tech preview and requires
assumeTrustedSource
to be set to
true
.
Qt Serial Port 模块
Qt Serial Bus 模块
Qt Sql 模块
Qt SVG 模块
-
Added support for CSS animations for fill-opacity, stroke-opacity, and opacity properties.
-
Added an example that demonstrates how to view SVG files.
Qt Test 模块
-
Data-driven benchmarks now identify both global and local data in plaintext names
-
Backtraces from lldb are now disabled on Apple Silicon
-
当
QTest
prints floating-point values in a comparison, it now gives full precision and includes a hexfloat version
Qt VirtualKeyboard 模块
-
Added PURL and CPE information to the attribution files of 3rd party sources.
-
添加拉脱维亚语键盘布局。
Qt WebEngine 模块
Qt WebView 模块
-
Added WebView2 plugin for the Windows platform. The new backend uses a native COM API from the Chromium based Edge browser called
WebView2
. Therefore, you can now provide web content without shipping Qt
WebEngine
.
Qt XML 模块
Qt Mqtt 模块
-
添加对 WebSockets/Secure WebSockets 的支持
QDoc 文档编制生成器
-
QDoc can now automatically add “view source” links to every C++ API declaration. Enable the feature with the new
url.sources
family of configuration variables (
url.sources.enabled
,
url.sources.rootdir
,
url.sources.linktext
).
-
QDoc now detects circular inheritance in QML types using Floyd’s cycle-finding algorithm and reports the problem instead of getting stuck in an infinite loop.
-
QML property groups defined in
.qml
files are recognised and shown as a single grouped property when you document them with
\qmlproperty
命令。
-
Source files generated by Qt tools (
moc_
,
uic_
,
qrc_
, etc.) are now skipped automatically, which shortens QDoc build times on large projects.
-
The data type shown for a QML property inside a
.qml
file can now be overridden directly in the
\qmlproperty
command, even for non-aliased properties.
-
The
documentationinheaders
option is no longer offered as a technical preview; rather, it is considered stable. It was first introduced in Qt 6.9.
-
When generating DocBook output, QDoc now includes overload notes.
-
Overloaded signals and slots now include a contextual snippet to show their use.
-
QDoc can link against Clang libraries from LLVM 21.
-
The .index-files include the declared return type from \fn-commands. This is useful for multi-project builds, when authors override the return type of a function with
auto
.
-
You can now document your QML enumerations with the new
\qmlenum
command. QDoc creates a new section, QML Enumerations, in the generated documentation.
-
Code snippets indentation is now normalized, stripping out excess left margin whitespace. This means that snippets from source that is heavily indented (e.g. in a deeply nested series of
if
-statements) will present as if not nested.
-
QDoc now correctly parses template aliases with default parameters.
-
QDoc no longer auto-links to deprecated functions if there are non-deprecated alternatives.
-
You can prevent machine translation of strings using the new
\notranslate-command
.
Qt Linguist
-
Added support for organizing ID-based translations with custom labels in Qt Linguist and lupdate.
-
Introduced a QML form preview feature in Qt Linguist for visual validation of translations in context.
-
Updated Qt Linguist with a refreshed UI, including new icons, improved color palette, and better handling of dark mode.
-
lupdate and lrelease now support mixing ID-based and text-based translations within the same document.
-
Removed the Clang-based parser from lupdate.
-
Unified support for meta strings (comments like //: and //~) across different programming languages in lupdate.
-
Added new i18n examples to the documentation.
-
lrelease now provides the -fail-on-unfinished option to fail the build if there are unfinished translations.
-
弃用
//=
metastring comments to set IDs for text-based translations.
构建系统变化
-
Usage of a private Qt module Foo now requires a call to
find_package(Qt6 COMPONENTS FooPrivate)
to make the
Qt6::FooPrivate
目标可用。
-
添加
DISCARD_FILE_CONTENTS
选项到
qt_add_resources()
.
-
The
FILENAME_VARIABLE
option of
qt6_generate_deploy_[app_]script
, which was deprecated in Qt 6.6.0, has been removed.
-
添加
NO_PLUGINS
自变量对于
qt_deploy_runtime_dependencies
. This turns off plugin deployment altogether.
-
Added the arguments
INCLUDE_PLUGIN_TYPES
,
EXCLUDE_PLUGIN_TYPES
,
INCLUDE_PLUGINS
,和
EXCLUDE_PLUGINS
to
qt_deploy_runtime_dependencies
.
-
Added arguments for selecting Qt plugins to
qt_generate_deploy_app_script
.
-
qt6_import_plugins
doesn't have any effect anymore on plugin deployment with the CMake deployment API on Linux.
-
qt6_deploy_runtime_dependencies
now supports the following plugin selection flags on Linux:
INCLUDE_PLUGINS
,
INCLUDE_PLUGIN_TYPES
,
EXCLUDE_PLUGINS
,
EXCLUDE_PLUGIN_TYPES
.
-
添加
DISCARD_QML_CONTENTS
选项到
qt_add_qml_module()
, that removes original QML and JS file contents from the target's resource system.
Windows
macOS
-
Windows that opt into extended dynamic range (EDR) now trigger expose event on screen brightness change
-
The titleUIElement accessibility property is now supported
-
Service menu integration is now rich-text aware
-
QOperatingSystemVersion::MacOSTahoe
represents macOS 26
-
Mappings for WhatsThisCursor and BusyCursor have been added
-
QImage::toCGImage
() now propagates the image's color space
Linux 中的 Wayland 客户端
Android
Qt for Android
-
Updated Gradle to version 8.14.2 and Android Gradle Plugin AGP to version 8.10.1.
-
Added support for Android 12 Splash Screen.
-
Added support for Android 16KB page sizes.
-
Added an example (QtJennyDemo) for accessing Android APIs via C++ wrappers produced by a code generator (QtJenny).
-
Changed Android 16 (API 36) as maximum supported platform version.
Qt Quick for Android
-
Added multiple arguments support for signals under QtQuickView.
-
Added support to register signal listeners before QML is fully loaded.
-
Public Java APIs in javadoc format.
iOS
-
添加
QPointingDevice
support for Apple Pencil
-
Fixed rotation for standard Apple Pencil
-
Added support for hover feature for Apple Pencil 2nd gen or later
-
Windows that opt into extended dynamic range (EDR) now trigger expose event on screen brightness change
-
Update requests will now be paused when the app moves out of active state
-
QScreen
now also reports inverted screen orientations
-
RLIMIT_STACK now reflects the effective stack size
-
QImage::toCGImage
() now propagates the image's color space
Boot to Qt
-
Support was added for Yocto 5.2 (Walnascar).
-
目标硬件的支持级别
was updated with supported boards for Tier 2:
-
NXP i.MX 93 11x11 LPDDR4X EVK.
-
目标硬件的支持级别
was updated with supported boards for Tier 3:
-
Toradex Colibri iMX6 ULL.
实时操作系统
-
Real-time operating system support is provided only for LTS releases. For non-LTS releases, support is available exclusively through Professional Services.
Qt 6.10 弃用的模块
下列模块已弃用。强烈建议新代码不要使用它们。
The Qt Charts and Qt DataVisualization modules are deprecated. They continue to be part of the licensed software, and remain part of the Qt Project. However, for new code we recommend that you use
Qt Graphs
. Also, consult the documentation for {Qt Graphs Migration from Qt Charts}{migrating from Qt Charts} and
migrating from Qt Data Visualization
.
Qt 模块生命周期的更多有关信息,见
QUIP-14
.
API 变化列表
这些页面包含 Qt 6.10 的 API 变化概述:
已知问题
Qt 6.10 已知问题的有关信息,见
Qt Wiki
.