Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qplacecontent.cpp
Go to the documentation of this file.
1// Copyright (C) 2022 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
4#include "qplacecontent.h"
5#include "qplacecontent_p.h"
6
8
10{
11 return d_ptr.data();
12}
13
15{
16 return d_ptr.constData();
17}
18
20{
21 return data == other->data;
22}
23
25
26
131
135QPlaceContent::QPlaceContent(const QPlaceContent &other) noexcept = default;
136
142
147
152{
153 d_ptr.detach();
154}
155
160{
161 if (!d_ptr)
162 return NoType;
163 return d_ptr->type();
164}
165
171{
172 // An invalid content object is only equal to another invalid content object
173 if (!d_ptr)
174 return !other.d_ptr;
175
176 if (type() != other.type())
177 return false;
178
179 return d_ptr->compare(other.d_ptr.constData());
180}
181
187{
188 return !(*this == other);
189}
190
195QList<QPlaceContent::DataTag> QPlaceContent::dataTags() const
196{
197 Q_D(const QPlaceContent);
198 return d->data.keys();
199}
200
206{
207 Q_D(const QPlaceContent);
208 return d->data.value(tag);
209}
210
215{
216 detach();
217 Q_D(QPlaceContent);
218 d->data[tag] = value;
219}
void detach()
If the shared data object's reference count is greater than 1, this function creates a deep copy of t...
T * data() const noexcept
Returns a pointer to the shared data object.
const T * constData() const noexcept
Returns a const pointer to the shared data object.
QPlaceContent::Type type() const
bool compare(const QPlaceContentPrivate *other) const
\inmodule QtLocation
bool operator==(const QPlaceContent &other) const
Returns true if this content object is equivalent to other, otherwise returns false.
QVariant value(DataTag tag) const
Returns the value stored for the data tag, or an invalid QVariant if there is no data for that tag.
QPlaceContentPrivate * d_func()
~QPlaceContent()
Destroys the content object.
Type
Defines the type of content.
QPlaceContent(Type type=NoType)
Constructs an content object for type.
QPlaceContent & operator=(const QPlaceContent &other) noexcept
Assigns the other content object to this and returns a reference to this content object.
QPlaceContent::Type type() const
Returns the content type.
bool operator!=(const QPlaceContent &other) const
Returns true if this content object is not equivalent to other, otherwise returns false.
DataTag
Defines the value entry of the content object.
void setValue(DataTag tag, const QVariant &)
Sets the value stored for the data tag to value.
QList< DataTag > dataTags() const
Returns the list of data tags for which values are stored in this content objects.
\inmodule QtCore
Definition qvariant.h:65
AudioChannelLayoutTag tag
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum type
#define QT_DEFINE_QESDP_SPECIALIZATION_DTOR(Class)
QSharedPointer< T > other(t)
[5]
Definition moc.h:23