本页内容

QPlaceMatchReply Class

QPlaceMatchReply 类负责管理由QPlaceManager 实例启动的位置匹配操作。更多内容...

Header: #include <QPlaceMatchReply>
qmake: QT += location
Inherits: QPlaceReply

公共函数

QPlaceMatchReply(QObject *parent = nullptr)
virtual ~QPlaceMatchReply()
QList<QPlace> places() const
QPlaceMatchRequest request() const

重新实现的公共函数

virtual QPlaceReply::Type type() const override

受保护函数

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

详细说明

如果操作成功,则响应中的位置数与请求中的位置数相匹配。如果请求中未找到特定位置,则会在响应中使用一个默认构造的位置作为占位符。这样,请求中的输入位置与响应中的输出位置之间始终保持一对一的关系。

如果操作不成功,位置数始终为零。

有关如何使用匹配响应的示例,请参阅“管理器之间的位置匹配”。

另请参阅 QPlaceMatchRequest 和QPlaceManager 。

成员函数文档

[explicit] QPlaceMatchReply::QPlaceMatchReply(QObject *parent = nullptr)

根据给定的parent 构建一条匹配回复。

[virtual noexcept] QPlaceMatchReply::~QPlaceMatchReply()

删除该匹配的回复。

QList<QPlace> QPlaceMatchReply::places() const

返回一个包含匹配地点的列表;

另请参阅 setPlaces()。

QPlaceMatchRequest QPlaceMatchReply::request() const

返回用于生成此响应的匹配请求。

另请参阅 setRequest()。

[protected] void QPlaceMatchReply::setPlaces(const QList<QPlace> &places)

设置匹配的places 列表。

另请参阅 places()。

[protected] void QPlaceMatchReply::setRequest(const QPlaceMatchRequest &request)

设置生成此响应时所使用的匹配规则request 。

另请参阅 request()。

[override virtual] QPlaceReply::Type QPlaceMatchReply::type() const

重新实现了:QPlaceReply::type() const。

返回回复的类型。

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