QPlaceCategory Class

QPlaceCategory 类表示QPlace 可关联的类别。更多

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

公共函数

QPlaceCategory()
QPlaceCategory(const QPlaceCategory &other)
~QPlaceCategory()
QString categoryId() const
QPlaceIcon icon() const
bool isEmpty() const
QString name() const
void setCategoryId(const QString &identifier)
void setIcon(const QPlaceIcon &icon)
void setName(const QString &name)
void setVisibility(QLocation::Visibility visibility)
QLocation::Visibility visibility() const
QPlaceCategory &operator=(const QPlaceCategory &other)
bool operator!=(const QPlaceCategory &lhs, const QPlaceCategory &rhs)
bool operator==(const QPlaceCategory &lhs, const QPlaceCategory &rhs)

详细说明

类别用于根据与之相关的类别搜索地点。可用类别列表/树可从QPlaceManager 获取。可使用QPlaceSearchRequest::setCategories() 函数将搜索结果限制为具有指定类别的地点。

如果QGeoServiceProvider 支持,则可以创建和删除类别。该功能在QPlaceManager 类中提供。

成员函数文档

QPlaceCategory::QPlaceCategory()

构建一个类别。

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

构建一个类别,它是other 的副本。

[noexcept] QPlaceCategory::~QPlaceCategory()

摧毁类别。

QString QPlaceCategory::categoryId() const

返回类别的标识符。类别标识符是一个字符串,可在特定QPlaceManager 中唯一标识该类别。标识符只对生成它的QPlaceManager 有意义,不能在管理器之间转移。

另请参阅 setCategoryId()。

QPlaceIcon QPlaceCategory::icon() const

返回与类别相关的图标。

另请参阅 setIcon()。

bool QPlaceCategory::isEmpty() const

返回一个布尔值,表示地点类别的所有字段是否为空。

QString QPlaceCategory::name() const

返回类别名称。

另请参阅 setName()。

void QPlaceCategory::setCategoryId(const QString &identifier)

设置类别的identifier

另请参阅 categoryId().

void QPlaceCategory::setIcon(const QPlaceIcon &icon)

设置类别的icon

另请参阅 icon().

void QPlaceCategory::setName(const QString &name)

设置类别的name

另请参阅 name().

void QPlaceCategory::setVisibility(QLocation::Visibility visibility)

设置类别的visibility

另请参阅 visibility().

QLocation::Visibility QPlaceCategory::visibility() const

返回类别的可见性。

另请参阅 setVisibility()。

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

other 指定为该类别,并返回对该类别的引用。

相关非会员

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

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

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

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

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