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
qgeoshape.h
Go to the documentation of this file.
1// Copyright (C) 2016 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 QGEOSHAPE_H
5#define QGEOSHAPE_H
6
7#include <QtCore/QSharedDataPointer>
8#include <QtPositioning/QGeoCoordinate>
9
11
12class QDebug;
14class QGeoRectangle;
15
16class Q_POSITIONING_EXPORT QGeoShape
17{
20 Q_PROPERTY(bool isValid READ isValid)
21 Q_PROPERTY(bool isEmpty READ isEmpty)
22 Q_PROPERTY(QGeoCoordinate center READ center)
24
25public:
26 QGeoShape();
28 ~QGeoShape();
29
37
38 ShapeType type() const;
39
40 bool isValid() const;
41 bool isEmpty() const;
42 Q_INVOKABLE bool contains(const QGeoCoordinate &coordinate) const;
43 Q_INVOKABLE QGeoRectangle boundingGeoRectangle() const;
44 QGeoCoordinate center() const;
45
46 friend bool operator==(const QGeoShape &lhs, const QGeoShape &rhs)
47 {
48 return equals(lhs, rhs);
49 }
50 friend bool operator!=(const QGeoShape &lhs, const QGeoShape &rhs)
51 {
52 return !equals(lhs, rhs);
53 }
54
55 QGeoShape &operator=(const QGeoShape &other);
56
58protected:
60
61 QSharedDataPointer<QGeoShapePrivate> d_ptr;
62
63private:
64 static bool equals(const QGeoShape &lhs, const QGeoShape &rhs);
65 inline QGeoShapePrivate *d_func();
66 inline const QGeoShapePrivate *d_func() const;
67#ifndef QT_NO_DEBUG_STREAM
68 friend QDebug operator<<(QDebug dbg, const QGeoShape &shape)
69 {
70 return debugStreaming(dbg, shape);
71 }
72 static QDebug debugStreaming(QDebug dbg, const QGeoShape &shape);
73#endif
74#ifndef QT_NO_DATASTREAM
76 {
77 return dataStreamOut(stream, shape);
78 }
80 {
81 return dataStreamIn(stream, shape);
82 }
83 static QDataStream &dataStreamOut(QDataStream &stream, const QGeoShape &shape);
84 static QDataStream &dataStreamIn(QDataStream &stream, QGeoShape &shape);
85#endif
86 friend Q_POSITIONING_EXPORT size_t qHash(const QGeoShape &key, size_t seed) noexcept;
87};
88
89Q_POSITIONING_EXPORT size_t qHash(const QGeoShape &shape, size_t seed = 0) noexcept;
90
92
94
95QT_DECL_METATYPE_EXTERN(QGeoShape, Q_POSITIONING_EXPORT)
96
97#endif
\inmodule QtCore\reentrant
Definition qdatastream.h:46
\inmodule QtCore
\inmodule QtPositioning
\inmodule QtPositioning
\inmodule QtPositioning
Definition qgeoshape.h:17
friend bool operator==(const QGeoShape &lhs, const QGeoShape &rhs)
Returns true if the lhs geo shape is equivalent to the rhs geo shape, otherwise returns false.
Definition qgeoshape.h:46
QSharedDataPointer< QGeoShapePrivate > d_ptr
Definition qgeoshape.h:61
friend QDebug operator<<(QDebug dbg, const QGeoShape &shape)
Definition qgeoshape.h:68
friend bool operator!=(const QGeoShape &lhs, const QGeoShape &rhs)
Returns true if the lhs geo shape is not equivalent to the rhs geo shape, otherwise returns false.
Definition qgeoshape.h:50
ShapeType
Describes the type of the shape.
Definition qgeoshape.h:30
@ UnknownType
Definition qgeoshape.h:31
@ RectangleType
Definition qgeoshape.h:32
friend QDataStream & operator<<(QDataStream &stream, const QGeoShape &shape)
Definition qgeoshape.h:75
friend QDataStream & operator>>(QDataStream &stream, QGeoShape &shape)
Definition qgeoshape.h:79
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
Combined button and popup list for selecting options.
EGLStreamKHR stream
size_t qHash(const QFileSystemWatcherPathKey &key, size_t seed=0)
Q_POSITIONING_EXPORT size_t qHash(const QGeoShape &shape, size_t seed=0) noexcept
#define QT_DECL_METATYPE_EXTERN(TYPE, EXPORT)
Definition qmetatype.h:1388
static bool contains(const QJsonArray &haystack, unsigned needle)
Definition qopengl.cpp:116
GLuint64 key
GLenum type
static Q_CONSTINIT QBasicAtomicInteger< unsigned > seed
Definition qrandom.cpp:196
#define Q_PROPERTY(...)
#define Q_INVOKABLE
#define Q_GADGET
#define Q_ENUMS(x)
@ Q_RELOCATABLE_TYPE
Definition qtypeinfo.h:158
#define Q_DECLARE_TYPEINFO(TYPE, FLAGS)
Definition qtypeinfo.h:180
QSharedPointer< T > other(t)
[5]
char * toString(const MyType &t)
[31]