对Qt Location
Qt 6 是我们努力使框架更高效、更易用的结果。
我们努力在每个版本中保持所有公共 API 的二进制和源代码兼容性。但为了使 Qt 成为一个更好的框架,有些改动是不可避免的。
在本专题中,我们总结了Qt Location 中的这些更改,并提供了处理这些更改的指导。
破坏性的公共 API 变动
地图
MapRectangle::backend
,MapCircle::backend
,MapPolyline::backend
, 和MapPolygon::backend
属性已被移除。- 以前与路由相关的 QML 元素类型
Route
,RouteSegment
, 和RouteManeuver
现在是值类型route,routeSegment, 和routeManeuver 。它们不能再作为 QML 中的项实例化,其属性也不能绑定。 - 以前与映射相关的 QML 元素类型
MapType
和CameraCapabilities
现在是值类型mapType 和cameraCapabilities 。它们不能再作为 QML 中的项实例化,它们的属性也不能绑定。 QGeoRouteLeg
类和 QML 对应的RouteLeg
已合并为QGeoRoute (和route 类型)。一个路由可以是多个路由的集合。- Map 类型现在只提供最基本的功能,不处理用户输入。
MapGestureArea
已被删除。MapView 类型可处理基本的用户输入,如点击和拖动事件。
位置
QPlaceImage
、QPlaceEditorial
和QPlaceReview
类已并入QPlaceContent 。- QPlaceContent API 已更改,可访问QVariant 值列表。
- 以前的 QML 元素类型
PlaceUser
,PlaceRatings
,PlaceAttribute
,PlaceIcon
,PlaceSupplier
, 和PlaceContactDetail
现在是值类型user,ratings,placeAttribute,icon,supplier, 和contactDetail 。它们不能再作为项目从 QML 中实例化,也不能绑定它们的属性。
实验性 API
具有 "实验室 "状态的功能已被删除。这包括用于逐向导航的实验性框架以及 MapObjects 抽象。
后台提供程序接口
后端提供程序接口不再受二进制和源代码兼容性保证的限制。
其他 API 变更
本节包含不会破坏源兼容性的 API 改进。不过,它们可能会对应用程序逻辑产生影响,因此了解它们仍然很有用。
© 2025 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.