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.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
4#ifndef QPLACERATINGS_H
5#define QPLACERATINGS_H
6
7#include <QtCore/QMetaType>
8#include <QtCore/QSharedDataPointer>
9#include <QtLocation/qlocationglobal.h>
10#include <QtQml/qqml.h>
11
13
16
17class Q_LOCATION_EXPORT QPlaceRatings
18{
20 QML_VALUE_TYPE(ratings)
22
23 Q_PROPERTY(qreal average READ average WRITE setAverage)
25 Q_PROPERTY(int count READ count WRITE setCount)
26
27public:
30 QPlaceRatings(QPlaceRatings &&other) noexcept = default;
32
33 QPlaceRatings &operator=(const QPlaceRatings &other) noexcept;
34 QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_MOVE_AND_SWAP(QPlaceRatings)
35
36 void swap(QPlaceRatings &other) noexcept { d.swap(other.d); }
37
38 friend inline bool operator==(const QPlaceRatings &lhs, const QPlaceRatings &rhs) noexcept
39 { return lhs.isEqual(rhs); }
40 friend inline bool operator!=(const QPlaceRatings &lhs, const QPlaceRatings &rhs) noexcept
41 { return !lhs.isEqual(rhs); }
42
43 qreal average() const;
44 void setAverage(qreal average);
45
46 int count() const;
47 void setCount(int count);
48
49 qreal maximum() const;
50 void setMaximum(qreal max);
51
52 bool isEmpty() const;
53
54private:
55 QSharedDataPointer<QPlaceRatingsPrivate> d;
56
57 bool isEqual(const QPlaceRatings &other) const noexcept;
58};
59
61
63
64#endif
static bool isEqual(const aiUVTransform &a, const aiUVTransform &b)
\inmodule QtLocation
void swap(QPlaceRatings &other) noexcept
friend bool operator==(const QPlaceRatings &lhs, const QPlaceRatings &rhs) noexcept
Returns true if lhs is equal to rhs, otherwise returns false.
friend bool operator!=(const QPlaceRatings &lhs, const QPlaceRatings &rhs) noexcept
Returns true if lhs is not equal to rhs, otherwise returns false.
Combined button and popup list for selecting options.
#define Q_DECLARE_METATYPE(TYPE)
Definition qmetatype.h:1525
GLenum GLenum GLsizei count
#define QML_VALUE_TYPE(NAME)
#define QML_STRUCTURED_VALUE
#define QT_DECLARE_QSDP_SPECIALIZATION_DTOR_WITH_EXPORT(Class, ExportMacro)
#define Q_PROPERTY(...)
#define Q_GADGET
double qreal
Definition qtypes.h:187
QSharedPointer< T > other(t)
[5]
this swap(other)
setMaximum(maximum)