本页内容

QPlaceIdReply Class

QPlaceIdReply 类负责管理返回标识符的操作,例如位置和类别的保存及删除操作。更多内容...

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

公共类型

enum OperationType { SavePlace, RemovePlace, SaveCategory, RemoveCategory }

公共函数

QPlaceIdReply(QPlaceIdReply::OperationType operationType, QObject *parent = nullptr)
virtual ~QPlaceIdReply()
QString id() const
QPlaceIdReply::OperationType operationType() const

重新实现的公共函数

virtual QPlaceReply::Type type() const override

受保护函数

void setId(const QString &identifier)

详细说明

QPlaceIdReply 可以被视为一种多功能回复,因为它可用于保存地点、保存类别、删除地点以及删除类别。在每种情况下,它都会返回所添加、修改或删除的地点或类别的标识符。

有关如何使用标识符响应的示例,请参阅“保存地点”。

另请参阅 QPlaceManager 。

成员类型文档

enum QPlaceIdReply::OperationType

定义了用于生成此响应的操作类型。

常量值描述
QPlaceIdReply::SavePlace0该响应是为“保存位置”操作生成的
QPlaceIdReply::RemovePlace2该回复是为“删除位置”操作生成的。
QPlaceIdReply::SaveCategory1该回复是为“保存位置”操作生成的
QPlaceIdReply::RemoveCategory3该响应是为“删除位置”操作生成的。

成员函数文档

[explicit] QPlaceIdReply::QPlaceIdReply(QPlaceIdReply::OperationType operationType, QObject *parent = nullptr)

构建一个包含被操作对象标识符的响应。该响应针对给定的operationType ,并采用parent 。

[virtual noexcept] QPlaceIdReply::~QPlaceIdReply()

销毁该回复。

QString QPlaceIdReply::id() const

返回该操作的相关标识符。例如,对于“保存位置”操作,标识符即为已保存位置的标识符;对于“删除类别”操作,标识符即为被删除的类别的标识符。

另请参阅 setId()。

QPlaceIdReply::OperationType QPlaceIdReply::operationType() const

返回回复的操作类型。这表示该标识符回复是用于“保存位置”操作、删除类别操作等。

[protected] void QPlaceIdReply::setId(const QString &identifier)

设置响应的identifier 。

另请参阅 id()。

[override virtual] QPlaceReply::Type QPlaceIdReply::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.