本页内容

QPlaceMatchRequest Class

QPlaceMatchRequest 类用于查找一个管理器中与另一个管理器中位置匹配的位置。它表示一组请求参数。更多...

Header: #include <QPlaceMatchRequest>
qmake: QT += location

公共函数

QPlaceMatchRequest()
QPlaceMatchRequest(const QPlaceMatchRequest &other)
QPlaceMatchRequest(QPlaceMatchRequest &&other)
~QPlaceMatchRequest()
void clear()
QVariantMap parameters() const
QList<QPlace> places() const
void setParameters(const QVariantMap &parameters)
void setPlaces(const QList<QPlace> &places)
void setResults(const QList<QPlaceSearchResult> &results)
QPlaceMatchRequest &operator=(const QPlaceMatchRequest &other)

静态公共成员

const QString AlternativeId
bool operator!=(const QPlaceMatchRequest &lhs, const QPlaceMatchRequest &rhs)
bool operator==(const QPlaceMatchRequest &lhs, const QPlaceMatchRequest &rhs)

详细说明

来自另一个管理器的、在当前管理器中可能有对应/匹配位置的位置,使用setPlaces()或setResults()进行分配。指定了一组其他参数,这些参数决定了匹配的标准。

匹配的典型键是QPlaceMatchRequest::AlternativeId ,其值为替代标识符属性类型,格式为 x_id_<提供商名称>,例如 x_id_here。提供商名称是提供给QGeoServiceProvider 实例的名称。

有关如何使用匹配请求的示例,请参阅《管理器之间的位置匹配》。

另请参阅 QPlaceMatchReply 和QPlaceManager 。

成员函数文档

QPlaceMatchRequest::QPlaceMatchRequest()

默认构造函数。用于创建一个新的请求对象。

[noexcept] QPlaceMatchRequest::QPlaceMatchRequest(const QPlaceMatchRequest &other)

创建other 的副本。

[constexpr noexcept default] QPlaceMatchRequest::QPlaceMatchRequest(QPlaceMatchRequest &&other)

通过Move构造一个QPlaceMatchRequest 的实例。

[noexcept] QPlaceMatchRequest::~QPlaceMatchRequest()

销毁请求对象。

void QPlaceMatchRequest::clear()

清除匹配请求。

QVariantMap QPlaceMatchRequest::parameters() const

返回匹配地点的参数。

另请参阅 setParameters()。

QList<QPlace> QPlaceMatchRequest::places() const

返回一个待匹配的位置列表。

另请参阅 setPlaces()。

void QPlaceMatchRequest::setParameters(const QVariantMap &parameters)

设置匹配位置的parameters 。

另请参阅 parameters()。

void QPlaceMatchRequest::setPlaces(const QList<QPlace> &places)

设置一个待匹配的places 列表。

另请参阅 places() 和setResults()。

void QPlaceMatchRequest::setResults(const QList<QPlaceSearchResult> &results)

一个便捷函数,它使用一组搜索表达式results 来指定应进行匹配的位置。

另请参阅 setPlaces()。

[noexcept] QPlaceMatchRequest &QPlaceMatchRequest::operator=(const QPlaceMatchRequest &other)

将other 分配给此搜索请求,并返回对此匹配请求的引用。

成员变量文档

const QString QPlaceMatchRequest::AlternativeId

这是指定应通过替代位置标识符进行匹配的关键。

相关非会员

[noexcept] bool operator!=(const QPlaceMatchRequest &lhs, const QPlaceMatchRequest &rhs)

如果 `lhs ` 不等于 `rhs`,则返回 true;否则返回 false。

[noexcept] bool operator==(const QPlaceMatchRequest &lhs, const QPlaceMatchRequest &rhs)

如果 `lhs ` 等于 `rhs`,则返回 true;否则返回 false。

© 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.