Qt6.7发布!

Qt 6.7 Released!

Qt6.7发布!

April 02, 2024 by Volker Hilsheimer | Comments

​2024年4月2日:Volker Hilsheimer |评论

Qt 6.7 is out with lots of large and small improvements for all of us who like to have fun when building modern applications and user experiences.

Qt 6.7为我们所有喜欢在构建现代应用程序和用户体验时获得乐趣的人提供了许多大大小小的改进。

Several additions are released as technology previews, and we are looking forward to your feedback so that we can get everything ready for the next LTS release!

一些新增内容作为技术预览发布,我们期待您的反馈,以便我们为下一个LTS版本做好一切准备!

Check out the highlights here:

点击此处查看精彩内容:

https://www.youtube.com/watch?v=Z1UkQuwY4bk

Use C++20 with Qt

将C++20与Qt一起使用

C++20 is still opt-in and experimental for many compiler toolchains, and for the time being we don't see any reason to require C++20 to build or use Qt. However, we want our users to be able to use the new standard as much as they like in their own code. Some of the changes made between C++17 and C++20 might require adjustments to existing code, and they required adjustments in Qt. For Qt 6.7 we have continued to make adaptations that make Qt feel like a natural part of a modern C++ stack.

对于许多编译器工具链来说,C++20仍然是可选的和实验性的,目前我们看不出有任何理由要求C++20构建或使用Qt。然而,我们希望我们的用户能够在自己的代码中随心所欲地使用新标准。在C++17和C++20之间进行的一些更改可能需要对现有代码进行调整,并且需要在Qt中进行调整。对于Qt 6.7,我们继续进行调整,使Qt感觉像是现代C++堆栈的自然组成部分。

One helpful addition to the C++20 language is the three-way comparison operator<=>(), also known as the "spaceship" operator. When implementing this operator, types are required to specify their ordering category. In Qt 6.7, we have added Qt::{strong,weak,partial}_ordering classes as C++17-compatible implementations of the respective std::*_ordering types. For type authors, Qt 6.7 provides helper macros that can be used to implement relational operators. These macros will expand to operator<=>() in C++20 builds, and fall back to all six operators in C++17 builds.

对C++20语言的一个有益补充是三元比较运算符<=>(),也称为“宇宙飞船”运算符。实现此运算符时,需要类型指定其排序类别。在Qt6.7中,我们添加了Qt::{strong,weak,partial}_ordering类作为相应std::*_ordering类型的C++17兼容实现。对于类型作者,Qt6.7提供了可用于实现关系运算符的辅助宏。这些宏在C++20版本中将扩展到operator<=>(),在C++17版本中将回退到所有六个运算符。

A useful addition to the standard library in C++20 that we wanted to use ourselves, and also make available to Qt users, is std::span. As a non-owning representation of a contiguous sequence of objects, a span is cheap to construct and pass through function calls, and with QSpan we now have a C++17 implementation of that type.

std::span是C++20中标准库的一个有用补充,我们希望自己使用它,也希望Qt用户可以使用它。作为连续对象序列的非所有权表示,跨度在构建和传递函数调用方面很便宜,而有了QSpan,我们现在有了这种类型的C++17实现。

We also continued to add std::chrono support to relevant Qt APIs. Transfer timeouts in Qt Network APIs can now be specified as std::chrono types and literals, such as 5s for 5 seconds.

我们还继续为相关的Qt API添加std::chrono支持。Qt网络API中的传输超时现在可以指定为std::chrono类型和文字,例如5s为5秒。

Qt Graphs with support for 2D and 3D visualizations

支持2D和3D可视化的Qt图形

In Qt 6.6 we introduced a first technology preview of Qt Graphs as a modern Qt 6 framework for visualizing data on top of a hardware accelerated rendering architecture.

在Qt 6.6中,我们介绍了Qt Graphs的第一个技术预览,它是一个现代Qt 6框架,用于在硬件加速渲染架构的基础上可视化数据。

With Qt 6.7, we are adding support for 2D bar, line, and scatter graphs, in addition to the 3D visualizations that have already been available since Qt 6.6. The module integrates with Qt Quick animations and effects, and provides theming, and handler-based interaction APIs.

在Qt 6.7中,除了自Qt 6.6以来已经提供的3D可视化之外,我们还增加了对2D条形图、折线图和散点图的支持。该模块与Qt Quick动画和效果集成,并提供主题化和基于处理程序的交互API。

2d-graphs

Qt Graphs is still under active development, and continues to be a technology preview for this release. We have made some substantial improvements to the data API and architecture to reduce the amount of memory allocations, and to integrate consistently with Qt's abstract item model. We expect additional architectural and API improvements before we take it out of technology preview for Qt 6.8 LTS, and are looking forward to hearing about your use cases and wishes so that we can make sure that we can accommodate them in the best possible way.

Qt Graphs仍在积极开发中,并将继续作为本版本的技术预览。我们对数据API和体系结构进行了一些实质性的改进,以减少内存分配量,并与Qt的抽象项模型保持一致。在我们将其从Qt 6.8 LTS的技术预览中删除之前,我们期待着更多的架构和API改进,并期待着听到您的用例和愿望,以便我们能够确保我们能够以最佳方式适应它们。

Connectivity, protocols, and distributed architectures

连接、协议和分布式体系结构

Developers of distributed systems can now work more efficiently with HTTP and REST APIs with the introduction of QHttpHeadersQRestAccessManager, and QRestReply as new classes for REST-specific use cases.

​随着QHttpHeaders、QRestAccessManager和QRestReply作为REST特定用例的新类的引入,分布式系统的开发人员现在可以更高效地使用HTTP和RESTAPI。

Qt gRPC has introduced new classes for client, server, or bi-directional streaming calls, allowing for seamless messaging that get triggered automatically on value changes. The new Interceptor API makes it possible to add callback functions for selected gRPC messages, for instance to implement caching or logging. With Qt Protobuf in Qt 6.7, developers can now serialize Protobuf-messages to and from JSON, and benefit from generator improvements that support optional fields, and preserve the casing of enum values.

Qt-gRPC为客户端、服务器或双向流式调用引入了新的类,允许在值更改时自动触发无缝消息传递。新的Interceptor API可以为选定的gRPC消息添加回调函数,例如实现缓存或日志记录。使用Qt 6.7中的Qt Protobuf,开发人员现在可以将Protobuf消息序列化到JSON和从JSON序列化Protobuf,并受益于支持可选字段的生成器改进,并保留枚举值的大小写。

These new features make it easier for developers to build robust and scalable applications with Qt. Qt gRPC and Qt Protobuf will graduate from technology preview in the Qt 6.8 release, when the work to complete support for HTTP/2 has been completed.

这些新功能使开发人员更容易使用Qt构建健壮且可扩展的应用程序。当完成对HTTP/2的支持工作时,Qt-gRPC和Qt-Protobuf将从Qt6.8版本的技术预览中毕业。

Vector Graphics

矢量图形

Since it's introduction, Qt SVG has supported the static features of the SVG 1.2 Tiny profile. That particular profile has over the last years become less and less relevant, and authoring tools have for a long time not followed any specific profile. For Qt 6.7, we analyzed which static elements from SVG 1.1 and 2.0 are commonly used in SVG assets, and added support for those features that we encountered most frequently: <symbol><marker><pattern><mask>, and the various <filter> elements. With Qt SVG in 6.7, applications can render the majority of SVG files relevant for UI builders.

​自推出以来,QtSVG一直支持SVG 1.2 Tiny配置文件的静态功能。在过去的几年里,这个特定的概要文件变得越来越不相关,创作工具在很长一段时间里都没有遵循任何特定的概要。对于Qt 6.7,我们分析了SVG 1.1和2.0中哪些静态元素常用于SVG资产,并添加了对我们最常见的功能的支持:<symbol>、<marker>、<pattern>、<mask>和各种<filter>元素。使用6.7中的Qt-SVG,应用程序可以呈现与UI构建器相关的大多数SVG文件。

SVG with mask as rendered by your browserSVG with mask as rendered by Qt SVG

svg-mask

 

If full support for SVG 2.0 is required, then the Qt WebEngine module continues to be the right choice.

如果需要完全支持SVG 2.0,那么Qt-WebEngine模块仍然是正确的选择。

In addition to importing SVGs as pre-rendered pixmaps into Qt UIs, we are also working on importing vector graphics assets directly into the Qt Quick scene graph. The new (and experimental) svgtoqml tool converts SVG to QML, and we have made improvements in the Qt Quick Shapes module to render in higher quality. The curve renderer introduced as technology preview in Qt 6.6 is now fully supported, and can be enabled using the preferredRendererType property.

​除了将SVG作为预渲染的像素图导入Qt UI之外,我们还致力于将矢量图形资源直接导入Qt Quick场景图。新的(实验性的)svgtoqml工具将SVG转换为QML,我们对Qt Quick Shapes模块进行了改进,以实现更高质量的渲染。现在完全支持在Qt 6.6中作为技术预览引入的曲线渲染器,并且可以使用preferredRendererType属性启用。

Improvements to Fonts and Icons

字体和图标的改进

After introducing support for typographic font features in Qt 6.6, we have followed up with support for variable fonts in Qt 6.7. Variable fonts combine variations of a single type face into a single font file, allowing applications to select any value of "weight" or "cursiveness." Depending on what variable axes the font designer creates, a glyph might be animated or show different layers. Read more about the variable font support and other text improvements in Eskil's blog post.

​在Qt 6.6中介绍了对排版字体功能的支持之后,我们又在Qt 6.7中支持了可变字体。可变字体将单个字体的变体组合到一个字体文件中,允许应用程序选择任何“权重”或“草书”值。根据字体设计者创建的可变轴,字形可能会被动画化或显示不同的层。在Eskil的博客文章中阅读更多关于可变字体支持和其他文本改进的信息。

The API is now stable and consistently uses the new QFont::Tag class for specifying font features and axis names in a type-safe fashion.

​API现在是稳定的,并且始终使用新的QFont::Tag类来以类型安全的方式指定字体特征和轴名称。

The improved support for modern fonts has enabled us to add support for native icon libraries, which are often provided through fonts. The QIcon::fromTheme implementation now maps the XDG icon name to the corresponding symbol in the native icon libraries on Apple, Windows, and Android platforms. For the future we plan to use the new capabilities of our font API to add support for more icon features, such as outlined or filled versions of an icon.

对现代字体的改进支持使我们能够添加对本地图标库的支持,这些图标库通常通过字体提供。QIcon::fromTheme实现现在将XDG图标名称映射到苹果、Windows和安卓平台上的本地图标库中的相应符号。对于未来,我们计划使用字体API的新功能来添加对更多图标功能的支持,例如图标的轮廓或填充版本。

variable-fonts

Hybrid applications with native UI elements and rendering

具有原生UI元素和渲染的混合应用程序

On both desktop and mobile platforms, applications often need to combine UI elements from different technologies and frameworks. Qt uses and integrates tightly with the native technologies on each platform to create basic UI elements such as windows, and it has for a long time been possible to use UI elements from other frameworks within a Qt Widgets application.

在桌面和移动平台上,应用程序通常需要组合来自不同技术和框架的UI元素。Qt使用每个平台上的本地技术并与之紧密集成,以创建基本的UI元素,如窗口,长期以来,在Qt-Widgets应用程序中使用其他框架中的UI元素一直是可能的。

With Qt 6.7, we are now adding support for embedding native windows into a Qt Quick scene as well. This allows use of native controls such as AppKit's MapView or a Windows media player inside a Qt Quick UI, with correct positioning and stacking. By layering windows, Qt Quick UI elements can be overlaid on top of the native components as well.

​使用Qt 6.7,我们现在也添加了对将原生窗口嵌入Qt Quick场景的支持。这允许在Qt Quick UI中使用本地控件,如AppKit的MapView或Windows媒体播放器,并具有正确的定位和堆叠。通过对窗口进行分层,QtQuick UI元素也可以覆盖在本地组件的顶部。

foreign-windows

In addition, applications can now add rendering code, using any of the graphics APIs supported by Qt, to a Qt Quick or Qt Widgets application, by using the QRhiQuickItem and QRhiWidget classes, respectively. While such code might often not be fully cross-platform (as Vulkan, OpenGL, Direct3D, or Metal are not equally well supported on all possible target platforms), it makes it possible to integrate 3rd party frameworks that use those technologies, or to write highly optimized rendering code for any specific platform.

此外,应用程序现在可以使用Qt支持的任何图形API,通过分别使用QRhiQuickItem和QRhiWidget类,将渲染代码添加到Qt-Quick或Qt-Widgets应用程序中。虽然这样的代码通常可能不是完全跨平台的(因为Vulkan、OpenGL、Direct3D或Metal在所有可能的目标平台上都没有得到同样好的支持),但它可以集成使用这些技术的第三方框架,或为任何特定平台编写高度优化的渲染代码。

Updated Platform support

更新的平台支持

As with every minor release we have updated the list of supported platforms to include the latest stable versions of relevant operating systems. On desktop and mobile, Qt 6.7 fully supports macOS 14 and iOS 17, Windows 11 23H2, and Android 14. RedHat 9.2, Open Suse 5.15, SUSE Linux Enterprise Server 15 are the latest supported Linux distributions (Ubuntu remains on 22.04). Prebuilt binaries for Windows using the LLVM-based MinGW toolchain are available from the installer, and Windows and Linux on ARM are both available as technology preview.

与每一个次要版本一样,我们都更新了受支持平台的列表,以包括相关操作系统的最新稳定版本。在台式机和移动设备上,Qt 6.7完全支持macOS 14和iOS 17、Windows 11 23H2和Android 14。RedHat 9.2、Open Suse 5.15、Suse Linux Enterprise Server 15是最新支持的Linux发行版(Ubuntu仍在22.04版本)。安装程序提供了使用基于LLVM的MinGW工具链的Windows预构建二进制文件,ARM上的Windows和Linux都可以作为技术预览。

On embedded, the Boot2Qt reference images support Yocto 4.3 Nanbield. As real-time operating systems, Qt 6.7 now includes a source-only technology preview for VxWorks 7 using SR 24.03 on iMX6 hardware, and pre-built binaries for QNX 7.1 are available from the online installer.

在嵌入式上,Boot2Qt参考图像支持Yocto 4.3 Nanfield。作为实时操作系统,Qt 6.7现在包括在iMX6硬件上使用SR 24.03的VxWorks 7的纯源代码技术预览,并且可以从在线安装程序中获得QNX 7.1的预构建二进制文件。

New and improved examples and demos

新的和改进的示例和演示

In addition to improvements in the framework, we have curated the examples and demo applications that ship with Qt, and refreshed the UI and coding style. We also created a few new applications that showcase what is possible when designers and developers work together to combine the UI, visualization, and backend capabilities of Qt.

除了在框架中进行改进外,我们还策划了Qt附带的示例和演示应用程序,并刷新了UI和编码风格。我们还创建了一些新的应用程序,展示了当设计师和开发人员合作将Qt的UI、可视化和后端功能相结合时可能发生的事情。

The Lightning Viewer example uses Qt Location and Qt Quick Controls to visualize simulated lightning data, received via Qt WebSocket. The style for the controls was entirely created in Figma.

​Lightning Viewer示例使用Qt Location和Qt Quick Controls来可视化通过Qt WebSocket接收的模拟闪电数据。控件的样式完全是在Figma中创建的。

lightningviewer-1

The completely recreated StocQt example uses Qt Graphs to visualize stock data based on the NASDAQ-100. The example's UI was created using Qt Design Studio, and if an API key is provided through the settings dialog, then the data is real-time information as received from the Financial Modeling Prep service.

​完全重新创建的StocQt示例使用Qt Graphs来可视化基于NASDAQ-100的股票数据。示例的UI是使用Qt Design Studio创建的,如果通过设置对话框提供了API键,则数据是从财务建模准备服务接收的实时信息。

stocqt

The new OSM Buildings example combines Qt Quick 3D with Qt Positioning and Qt Network to implement a 3D viewer of buildings map data as received from the OpenStreetMap service.

​新的OSM Buildings示例将Qt Quick 3D与Qt Positioning和Qt Network相结合,以实现从OpenStreetMap服务接收的建筑物地图数据的3D查看器。

Virtual assistants are becoming increasingly popular in user interfaces, and the new Virtual Assistant example shows how easy it is to bring a 3D model to life through timeline animations.

​虚拟助理在用户界面中越来越受欢迎,新的虚拟助理示例显示了通过时间轴动画将3D模型栩栩如生是多么容易。

virtual-assistant

And last but not least, the new Volumetric rendering example uses the new support for 3D textures in Qt Quick 3D to implement volume ray casting.

​最后但同样重要的是,新的“体积”渲染示例使用Qt Quick 3D中对3D纹理的新支持来实现体积光线投射。

volumetric-rendering

Qt for Python

Python的Qt

Once new functionality is added to Qt, our Python offering needs to adapt those in order to enable them for our Python users. Besides what's described here, many other changes were made to PySide and Shiboken that will be described in a follow-up post. Stay tuned!

​一旦向Qt添加了新功能,我们的Python产品就需要调整这些功能,以便为我们的Python用户启用它们。除了这里描述的内容,PySide和Shiboken还进行了许多其他更改,这些更改将在后续文章中描述。敬请期待!

The many small things that make a big difference

许多小事会带来巨大的不同

The above is a list of the larger new features, and like every minor release, Qt 6.7 brings many small improvements to existing classes and tools. Those additions are too numerous for this post, but you can find a comprehensive list of all additions in the documentation of What's New in Qt 6.7.

​上面列出了更大的新功能,和每个小版本一样,Qt6.7对现有的类和工具进行了许多小的改进。对于这篇文章来说,这些新增内容太多了,但你可以在Qt 6.7的新增内容文档中找到所有新增内容的全面列表。

Thanks

感谢

I’d like to thank all the contributors who have helped with making Qt 6.7 a reality. You can find a full list of all community members that landed a patch to the Qt source code at the end of the release notes. And a special Thanks goes to all of you who have helped making Qt better by reporting bugs, sending us your feedback, or by telling us about your use cases. And last but not least, I'd like to thank everyone involved in getting the release out of the door!

​感谢所有帮助实现Qt 6.7的贡献者。可以在发行说明的末尾找到所有获得Qt源代码补丁的社区成员的完整列表。特别感谢所有通过报告错误、向我们发送反馈或告诉我们用例帮助Qt变得更好的人。最后但同样重要的是,我要感谢所有参与发布的人!

As always, the new release will be available in the Qt installer. You can also get the release from our download page or your Qt Account page, and - as mentioned above - through Debian repositories.

​一如既往,新版本将在Qt安装程序中提供。也可以从我们的下载页面或您的Qt帐户页面获得发布,如上所述,还可以通过Debian存储库获得发布。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值