Qt 5.15 的新功能
Qt 5.15 中的新特征
Qt 3D 模块
Qt Core 模块
-
引入
QFile::moveToTrash
() 以提供跨平台 API,用于把文件移至 Windows、macOS 及 Linux 桌面的 trash/recycling (垃圾桶/回收站) bin。这实现
freedesktop.org specification
.
-
引入
QFileInfo::isJunction
() 去检测文件系统条目是否为 Windows NTFS 结。
-
QRunnable
instances can now be created from
std::function
without having to subclass
QRunnable
.
-
QThreadPool::start
() 和
tryStart
() can now take
std::function
and thereby also anonymous lambda functions as arguments.
-
Added static template QDebug::toString() function, which streams the given object into a
QDebug
instance that operates on a string, and then returns that string. This is useful for cases where you need the textual representation of an object for debugging, but cannot use
operator<<
, such as when passing a failure message to
QVERIFY2
().
Qt GUI 模块
Qt Network 模块
Qt QML 模块
-
引入内联组件;可以在同一文件中声明多个 QML 组件。
-
引入所需特性。
-
添加向 QML 注册类型的声明方式。
-
qmllint
now has a better understanding of the code and warns about deprecated QML features.
-
添加
qmlformat
tool to automatically format any QML file according to the
QML 编码约定
.
-
添加支持
Nullish Coalescing Operator
.
-
添加
colorspace
property on image nodes, making it possible to read color spaces and transform images into a specific color space.
Qt Quick 模块
-
添加
PathText
type which can be used together with Qt Quick Shapes to render text as geometry, without relying on distance fields or pre-rendered textures. This is useful for rendering large font sizes which would otherwise consume a lot of texture memory.
-
添加
Image.sourceClipRect
property to request the image plugin to render a portion of an image source.
-
添加
cursorShape
property to pointer handlers. Most pointer handlers (for example
DragHandler
) will change the cursor when in active state.
HoverHandler
will change the cursor when the mouse is hovering over the Item that contains the handler.
-
Added support for Metal on iOS for the opt-in preview of the
Graphics API Independent Rendering Architecture
.
Qt Quick Controls 模块
Qt WebEngine 模块
-
QDoc
can now generate DocBook.
-
QDoc
now generates output for C++ class and function template parameters.
-
QDoc
now generates correct output for scoped enums (enum classes).
Android
-
引入默认使用 Android 本机文件对话框用于打开 (文件、多个文件、目录) 和保存操作。
Wayland
Embedded Linux (eglfs)
-
eglfs_viv
backend: Added support for Vulkan, via VK_KHR_display, on NXP i.MX8 based devices.
新模块
Qt Quick 3D
-
引入后期处理效果。
-
引入自定义几何图形 API (C++ 网格)。
-
引入用于节点旋转的四元数 API。
-
切换到使用右手坐标系统 (以前是右或左)。
-
改进在 3D 场景中对 Qt Quick 2D 的支持。
-
添加支持聚光灯。
-
性能改进。
Qt Lottie
-
引入
Bodymovin
JSON 渲染器为 Adobe After Effects 动画。
-
改进性能和稳定性。
Qt PDF
-
Based on a version of
Pdfium
that is shared with Qt
WebEngine
.
-
Available on the same platforms as Qt
WebEngine
, and also on iOS.
弃用模块
To help preparing for the transition to Qt 6, numerous classes and member functions that will be removed from Qt 6.0 have been marked as deprecated in the Qt 5.15 release. Unless you define
QT_NO_DEPRECATED_WARNINGS
in your project, you will get compiler warnings for code that uses any deprecated APIs. Those warnings will explain which API to use instead. To disable any deprecated APIs completely, use the
QT_DISABLE_DEPRECATED_BEFORE
宏。
下列模块是 Qt 5.15 发行的一部分,但被弃用且在后续 Qt 发行中考虑移除:
-
Qt Script
-
Qt Quick Controls 1
-
Qt XML Patterns
API 变化列表
以下页面包含 Qt 5.15 中的 API 变化列表:
其它 Qt 5 发行的补充