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
qgeopolygon.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 QGEOPOLYGON_H
5#define QGEOPOLYGON_H
6
7#include <QtPositioning/QGeoShape>
8#include <QtCore/QVariantList>
9
11
12class QGeoCoordinate;
14
15class Q_POSITIONING_EXPORT QGeoPolygon : public QGeoShape
16{
18 Q_PROPERTY(QList<QGeoCoordinate> perimeter READ perimeter WRITE setPerimeter REVISION(5, 12))
19
20public:
25
26 ~QGeoPolygon();
27
28 QGeoPolygon &operator=(const QGeoPolygon &other);
29
30 void setPerimeter(const QList<QGeoCoordinate> &path);
31 const QList<QGeoCoordinate> &perimeter() const;
32
33 Q_INVOKABLE void addHole(const QVariant &holePath);
34 void addHole(const QList<QGeoCoordinate> &holePath);
35 Q_INVOKABLE const QVariantList hole(qsizetype index) const;
36 const QList<QGeoCoordinate> holePath(qsizetype index) const;
37 Q_INVOKABLE void removeHole(qsizetype index);
38 Q_INVOKABLE qsizetype holesCount() const;
39 Q_INVOKABLE void translate(double degreesLatitude, double degreesLongitude);
40 Q_INVOKABLE QGeoPolygon translated(double degreesLatitude, double degreesLongitude) const;
41 Q_INVOKABLE double length(qsizetype indexFrom = 0, qsizetype indexTo = -1) const;
43 Q_INVOKABLE void addCoordinate(const QGeoCoordinate &coordinate);
44 Q_INVOKABLE void insertCoordinate(qsizetype index, const QGeoCoordinate &coordinate);
45 Q_INVOKABLE void replaceCoordinate(qsizetype index, const QGeoCoordinate &coordinate);
46 Q_INVOKABLE QGeoCoordinate coordinateAt(qsizetype index) const;
47 Q_INVOKABLE bool containsCoordinate(const QGeoCoordinate &coordinate) const;
48 Q_INVOKABLE void removeCoordinate(const QGeoCoordinate &coordinate);
49 Q_INVOKABLE void removeCoordinate(qsizetype index);
50
52
54 inline QGeoPolygonPrivate *d_func();
55 inline const QGeoPolygonPrivate *d_func() const;
56
57#ifndef QT_NO_DATASTREAM
59 {
60 return stream << static_cast<const QGeoShape &>(polygon);
61 }
63 {
64 return stream >> static_cast<QGeoShape &>(polygon);
65 }
66#endif
67};
68
70
72
73QT_DECL_METATYPE_EXTERN(QGeoPolygon, Q_POSITIONING_EXPORT)
74
75#endif // QGEOPOLYGON_H
\inmodule QtCore\reentrant
Definition qdatastream.h:46
\inmodule QtPositioning
\inmodule QtPositioning
Definition qgeopolygon.h:16
friend QDataStream & operator>>(QDataStream &stream, QGeoPolygon &polygon)
Definition qgeopolygon.h:62
friend QDataStream & operator<<(QDataStream &stream, const QGeoPolygon &polygon)
Definition qgeopolygon.h:58
\inmodule QtPositioning
Definition qgeoshape.h:17
Definition qlist.h:75
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtCore
Definition qvariant.h:65
Combined button and popup list for selecting options.
EGLStreamKHR stream
#define QT_DECL_METATYPE_EXTERN(TYPE, EXPORT)
Definition qmetatype.h:1388
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLuint index
[2]
GLenum GLuint GLenum GLsizei length
GLsizei const GLchar *const * path
#define Q_PROPERTY(...)
#define Q_INVOKABLE
#define Q_GADGET
@ Q_RELOCATABLE_TYPE
Definition qtypeinfo.h:158
#define Q_DECLARE_TYPEINFO(TYPE, FLAGS)
Definition qtypeinfo.h:180
ptrdiff_t qsizetype
Definition qtypes.h:165
static bool translate(xcb_connection_t *connection, xcb_window_t child, xcb_window_t parent, int *x, int *y)
QSharedPointer< T > other(t)
[5]
char * toString(const MyType &t)
[31]