内容表

上一话题

Interfaces between C++ and QML Code in Qt Location

下一话题

Maps and Navigation (QML)

Maps and Navigation (C++)

Provides C++ classes for Geocoding and Navigation.

Maps and Navigation provides C++ utilities for geocoding (finding a geographic coordinate from a street address) and navigation (including driving and walking directions).

Currently it is not possible to interact with maps via C++. Mapping applications must use the Maps and Navigation (QML) API.

Geocoding

In C++, an address-to-coordinate query is performed using the geocode() 方法在 QGeoCodingManager class. For coordinate-to-address queries, the reverseGeocode() method is available on the same class. Instances of QGeoCodingManager are available via QGeoServiceProvider .

Key Classes

QGeoServiceProvider

提供 QGeoCodingManager instance ready for use.

QGeoCodingManager

Accepts queries and produces QGeoCodeReply 对象。

QGeoCodeReply

Contains the results of a geocoding query.