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
Returns a newQGeoCodingManagerEngine instance, initialized withparameters, which implements the location geocoding functionality.
如果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
Returns a newQGeoRoutingManagerEngine instance, initialized withparameters, which implements routing functionality.返回一个新的 实例,用 进行初始化,实现路由功能。
如果error 不是nullptr
,则成功时应设置为QGeoServiceProvider::NoError ,失败时应设置为适当的QGeoServiceProvider::Error 。
如果errorString 不是nullptr
,则应将其设置为一个字符串,描述发生的任何错误。
默认实现返回nullptr
,这会导致QGeoServiceProvider 中出现QGeoServiceProvider::NotSupportedError 。
[virtual]
void QGeoServiceProviderFactory::setQmlEngine(QQmlEngine *engine)
当 qmlengine 准备就绪时通知插件。此时,插件可以使用它来注册图像提供程序。
默认实现不做任何事情。
© 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.