Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qplacecategory.cpp
Go to the documentation of this file.
1
// Copyright (C) 2015 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
// Qt-Security score:significant reason:default
4
5
#
include
"qplacecategory.h"
6
#
include
"qplacecategory_p.h"
7
8
QT_BEGIN_NAMESPACE
9
10
QT_DEFINE_QSDP_SPECIALIZATION_DTOR(QPlaceCategoryPrivate)
11
12
13
bool
QPlaceCategoryPrivate::isEmpty()
const
14
{
15
return
categoryId.isEmpty()
16
&& name.isEmpty()
17
&& icon.isEmpty()
18
&& QLocation::UnspecifiedVisibility == visibility;
19
}
20
21
/*!
22
\class QPlaceCategory
23
\inmodule QtLocation
24
\ingroup QtLocation-places
25
\ingroup QtLocation-places-data
26
\since 5.6
27
28
\brief The QPlaceCategory class represents a category that a \l QPlace can be associated with.
29
30
Categories are used to search for places based on the categories they are associated with. The
31
list/tree of available categories can be obtained from \l QPlaceManager. The
32
\l QPlaceSearchRequest::setCategories() function can be used to limit the search results to
33
places with the specified categories.
34
35
If the \l QGeoServiceProvider supports it, categories can be created and removed. This
36
functionality is available in the \l QPlaceManager class.
37
*/
38
39
/*!
40
Constructs a category.
41
*/
42
QPlaceCategory::QPlaceCategory()
43
: d(
new
QPlaceCategoryPrivate)
44
{
45
}
46
47
/*!
48
Constructs a category which is a copy of \a other.
49
*/
50
QPlaceCategory::QPlaceCategory(
const
QPlaceCategory &other)
noexcept
=
default
;
51
52
/*!
53
Destroys the category.
54
*/
55
QPlaceCategory::~QPlaceCategory() =
default
;
56
57
/*!
58
Assigns \a other to this category and returns a reference to this category.
59
*/
60
QPlaceCategory &QPlaceCategory::operator=(
const
QPlaceCategory &other)
noexcept
61
{
62
if
(
this
== &other)
63
return
*
this
;
64
65
d = other.d;
66
return
*
this
;
67
}
68
69
/*!
70
\fn bool QPlaceCategory::operator==(const QPlaceCategory &lhs, const QPlaceCategory &rhs) noexcept
71
72
Returns true if \a lhs is equal to \a rhs; otherwise returns false.
73
*/
74
75
/*!
76
\fn bool QPlaceCategory::operator!=(const QPlaceCategory &lhs, const QPlaceCategory &rhs) noexcept
77
78
Returns true if \a lhs is not equal to \a rhs; otherwise returns false.
79
*/
80
81
bool
QPlaceCategory::isEqual(
const
QPlaceCategory &other)
const
noexcept
82
{
83
return
d->categoryId == other.d->categoryId &&
84
d->name == other.d->name &&
85
(d->visibility == QLocation::UnspecifiedVisibility ||
86
other.d->visibility == QLocation::UnspecifiedVisibility ||
87
d->visibility == other.d->visibility) &&
88
d->icon == other.d->icon;
89
}
90
91
/*!
92
Returns the identifier of the category. The category identifier is a string which uniquely identifies this category
93
within a particular \l QPlaceManager. The identifier is only meaningful to the QPlaceManager
94
that generated it and is not transferable between managers.
95
*/
96
QString QPlaceCategory::categoryId()
const
97
{
98
return
d->categoryId;
99
}
100
101
/*!
102
Sets the \a identifier of the category.
103
*/
104
void
QPlaceCategory::setCategoryId(
const
QString &identifier)
105
{
106
d->categoryId = identifier;
107
}
108
109
/*!
110
Returns the name of category.
111
*/
112
QString QPlaceCategory::name()
const
113
{
114
return
d->name;
115
}
116
117
/*!
118
Sets the \a name of the category.
119
*/
120
void
QPlaceCategory::setName(
const
QString &name)
121
{
122
d->name = name;
123
}
124
125
/*!
126
Sets the \a visibility of the category.
127
*/
128
void
QPlaceCategory::setVisibility(QLocation::Visibility visibility)
129
{
130
d->visibility = visibility;
131
}
132
133
/*!
134
Returns the visibility of the category.
135
*/
136
QLocation::Visibility QPlaceCategory::visibility()
const
137
{
138
return
d->visibility;
139
}
140
141
/*!
142
Returns the icon associated with the category.
143
*/
144
QPlaceIcon QPlaceCategory::icon()
const
145
{
146
return
d->icon;
147
}
148
149
/*!
150
Sets the \a icon of the category.
151
*/
152
void
QPlaceCategory::setIcon(
const
QPlaceIcon &icon)
153
{
154
d->icon = icon;
155
}
156
157
/*!
158
Returns a boolean indicating whether the all the fields of the place category are empty or not.
159
*/
160
bool
QPlaceCategory::isEmpty()
const
161
{
162
return
d->isEmpty();
163
}
164
165
QT_END_NAMESPACE
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
qtlocation
src
location
places
qplacecategory.cpp
Generated on
for Qt by
1.18.0