QGeoServiceProviderFactory Class
QGeoServiceProviderFactory 类是一个工厂类,用作与地理信息相关的服务的插件接口。更多内容...
| Header: | #include <QGeoServiceProviderFactory> |
| qmake: | QT += location |
| Status: | Deprecated |
该类已弃用。我们强烈建议不要在新代码中使用它。
公共函数
| virtual | ~QGeoServiceProviderFactory() |
| virtual QGeoCodingManagerEngine * | createGeocodingManagerEngine(const QVariantMap ¶meters, QGeoServiceProvider::Error *error, QString *errorString) const |
| virtual QPlaceManagerEngine * | createPlaceManagerEngine(const QVariantMap ¶meters, QGeoServiceProvider::Error *error, QString *errorString) const |
| virtual QGeoRoutingManagerEngine * | createRoutingManagerEngine(const QVariantMap ¶meters, QGeoServiceProvider::Error *error, QString *errorString) const |
| virtual void | setQmlEngine(QQmlEngine *engine) |
详细说明
注意:不保证 后端类的源代码或二进制兼容性。仅保证该 API 可在其开发所基于的 Qt 版本上正常工作。不过,API 的更改仅会在次要版本(如 6.6、6.7 等)中进行。
实现者必须为每个插件提供 providerName() 和 providerVersion() 的唯一组合。
如果插件支持相关功能集,则应重写其他函数。
成员函数文档
[virtual noexcept] QGeoServiceProviderFactory::~QGeoServiceProviderFactory()
销毁此QGeoServiceProviderFactory 实例。
[virtual] QGeoCodingManagerEngine *QGeoServiceProviderFactory::createGeocodingManagerEngine(const QVariantMap ¶meters, QGeoServiceProvider::Error *error, QString *errorString) const
返回一个新的QGeoCodingManagerEngine 实例,该实例由parameters 初始化,并实现了位置地理编码功能。
如果 `error ` 不是 `nullptr `,则在成功时应将其设置为 `QGeoServiceProvider::NoError `,失败时应设置为相应的 `QGeoServiceProvider::Error `。
如果errorString 不是nullptr ,则应将其设置为描述所发生错误的字符串。
默认实现会返回nullptr ,这会在QGeoServiceProvider 中引发QGeoServiceProvider::NotSupportedError 。
[virtual] QPlaceManagerEngine *QGeoServiceProviderFactory::createPlaceManagerEngine(const QVariantMap ¶meters, QGeoServiceProvider::Error *error, QString *errorString) const
返回一个新的QPlaceManagerEngine 实例,该实例由parameters 初始化,并实现了位置搜索功能。
如果 `error ` 不是 `nullptr `,则在成功时应将其设置为 `QGeoServiceProvider::NoError `,在失败时应设置为相应的 `QGeoServiceProvider::Error `。
如果errorString 不是nullptr ,则应将其设置为描述所发生错误的字符串。
默认实现会返回nullptr ,这会在QGeoServiceProvider 中引发QGeoServiceProvider::NotSupportedError 。
[virtual] QGeoRoutingManagerEngine *QGeoServiceProviderFactory::createRoutingManagerEngine(const QVariantMap ¶meters, QGeoServiceProvider::Error *error, QString *errorString) const
返回一个新的QGeoRoutingManagerEngine 实例,该实例使用parameters 进行初始化,并实现了路由功能。
如果 `error ` 不是 `nullptr `,则在成功时应将其设置为 `QGeoServiceProvider::NoError `,在失败时应设置为相应的 `QGeoServiceProvider::Error `。
如果errorString 不是nullptr ,则应将其设置为描述所发生错误的字符串。
默认实现会返回nullptr ,这会在QGeoServiceProvider 中引发QGeoServiceProvider::NotSupportedError 。
[virtual] void QGeoServiceProviderFactory::setQmlEngine(QQmlEngine *engine)
当 QMLengine 准备就绪时,通知插件。此时,插件可以使用它来注册图像提供程序。
默认实现不执行任何操作。
© 2026 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.