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
qplaceratings.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 "qplaceratings.h"
5#include "qplaceratings_p.h"
6
8
10
11bool QPlaceRatingsPrivate::operator==(const QPlaceRatingsPrivate &other) const
12{
13 return average == other.average && maximum == other.maximum && count == other.count;
14}
15
17{
18 return count == 0 && average == 0 && maximum == 0;
19}
20
59
63QPlaceRatings::QPlaceRatings(const QPlaceRatings &other) noexcept = default;
64
69
75{
76 if (this == &other)
77 return *this;
78
79 d = other.d;
80 return *this;
81}
82
95bool QPlaceRatings::isEqual(const QPlaceRatings &other) const noexcept
96{
97 return (*(d.constData()) == *(other.d.constData()));
98}
99
113{
114 return d->average;
115}
116
118{
119 d->average = average;
120}
121
133{
134 return d->maximum;
135}
136
138{
139 d->maximum = max;
140}
141
154{
155 return d->count;
156}
157
159{
160 d->count = count;
161}
162
167{
168 return d->isEmpty();
169}
170
171#include "moc_qplaceratings.cpp"
\inmodule QtLocation
QML_STRUCTURED_VALUEqreal average
\qmlproperty real ratings::average
QPlaceRatings & operator=(const QPlaceRatings &other) noexcept
Assigns other to this ratings object and returns a reference to this ratings object.
int count
\qmlproperty int ratings::count
void setCount(int count)
qreal maximum
\qmlproperty real ratings::maximum
void setMaximum(qreal max)
bool isEmpty() const
Returns true if all fields of the place ratings are 0; otherwise returns false.
void setAverage(qreal average)
QPlaceRatings()
\qmlvaluetype ratings \inqmlmodule QtLocation
~QPlaceRatings()
Destroys the ratings object.
GLenum GLenum GLsizei count
#define QT_DEFINE_QSDP_SPECIALIZATION_DTOR(Class)
double qreal
Definition qtypes.h:187
QSharedPointer< T > other(t)
[5]