Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qplaceratings.h
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#ifndef QPLACERATINGS_H
6#define QPLACERATINGS_H
7
8#include <QtCore/QMetaType>
9#include <QtCore/QSharedDataPointer>
10#include <QtLocation/qlocationglobal.h>
11#include <QtQml/qqml.h>
12
13QT_BEGIN_NAMESPACE
14
15class QPlaceRatingsPrivate;
16QT_DECLARE_QSDP_SPECIALIZATION_DTOR_WITH_EXPORT(QPlaceRatingsPrivate, Q_LOCATION_EXPORT)
17
18class Q_LOCATION_EXPORT QPlaceRatings
19{
20 Q_GADGET
21 QML_VALUE_TYPE(ratings)
22 QML_STRUCTURED_VALUE
23
24 Q_PROPERTY(qreal average READ average WRITE setAverage)
25 Q_PROPERTY(qreal maximum READ maximum WRITE setMaximum)
26 Q_PROPERTY(int count READ count WRITE setCount)
27
28public:
29 QPlaceRatings();
30 QPlaceRatings(const QPlaceRatings &other) noexcept;
31 QPlaceRatings(QPlaceRatings &&other) noexcept = default;
32 ~QPlaceRatings();
33
34 QPlaceRatings &operator=(const QPlaceRatings &other) noexcept;
35 QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_MOVE_AND_SWAP(QPlaceRatings)
36
37 void swap(QPlaceRatings &other) noexcept { d.swap(other.d); }
38
39 friend inline bool operator==(const QPlaceRatings &lhs, const QPlaceRatings &rhs) noexcept
40 { return lhs.isEqual(rhs); }
41 friend inline bool operator!=(const QPlaceRatings &lhs, const QPlaceRatings &rhs) noexcept
42 { return !lhs.isEqual(rhs); }
43
44 qreal average() const;
45 void setAverage(qreal average);
46
47 int count() const;
48 void setCount(int count);
49
50 qreal maximum() const;
51 void setMaximum(qreal max);
52
53 bool isEmpty() const;
54
55private:
56 QSharedDataPointer<QPlaceRatingsPrivate> d;
57
58 bool isEqual(const QPlaceRatings &other) const noexcept;
59};
60
61QT_END_NAMESPACE
62
63Q_DECLARE_METATYPE(QPlaceRatings)
64
65#endif
\inmodule QtLocation