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
qgeopath.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 QGEOPATH_H
5#define QGEOPATH_H
6
7#include <QtPositioning/QGeoShape>
8#include <QtCore/QVariantList>
9
11
12class QGeoCoordinate;
13class QGeoPathPrivate;
14
15class Q_POSITIONING_EXPORT QGeoPath : public QGeoShape
16{
18 Q_PROPERTY(QVariantList path READ variantPath WRITE setVariantPath)
19 Q_PROPERTY(qreal width READ width WRITE setWidth)
20
21public:
22 QGeoPath();
23 QGeoPath(const QList<QGeoCoordinate> &path, const qreal &width = 0.0);
24 QGeoPath(const QGeoPath &other);
25 QGeoPath(const QGeoShape &other);
26
27 ~QGeoPath();
28
29 QGeoPath &operator=(const QGeoPath &other);
30
31 void setPath(const QList<QGeoCoordinate> &path);
32 const QList<QGeoCoordinate> &path() const;
33 void clearPath();
34 void setVariantPath(const QVariantList &path);
35 QVariantList variantPath() const;
36
37 void setWidth(const qreal &width);
38 qreal width() const;
39
40 Q_INVOKABLE void translate(double degreesLatitude, double degreesLongitude);
41 Q_INVOKABLE QGeoPath translated(double degreesLatitude, double degreesLongitude) const;
42 Q_INVOKABLE double length(qsizetype indexFrom = 0, qsizetype indexTo = -1) const;
44 Q_INVOKABLE void addCoordinate(const QGeoCoordinate &coordinate);
45 Q_INVOKABLE void insertCoordinate(qsizetype index, const QGeoCoordinate &coordinate);
46 Q_INVOKABLE void replaceCoordinate(qsizetype index, const QGeoCoordinate &coordinate);
47 Q_INVOKABLE QGeoCoordinate coordinateAt(qsizetype index) const;
48 Q_INVOKABLE bool containsCoordinate(const QGeoCoordinate &coordinate) const;
49 Q_INVOKABLE void removeCoordinate(const QGeoCoordinate &coordinate);
50 Q_INVOKABLE void removeCoordinate(qsizetype index);
51
53
55 inline QGeoPathPrivate *d_func();
56 inline const QGeoPathPrivate *d_func() const;
57
58#ifndef QT_NO_DATASTREAM
60 {
61 return stream << static_cast<const QGeoShape &>(path);
62 }
64 {
65 return stream >> static_cast<QGeoShape &>(path);
66 }
67#endif
68};
69
71
73
74QT_DECL_METATYPE_EXTERN(QGeoPath, Q_POSITIONING_EXPORT)
75
76#endif // QGEOPATH_H
\inmodule QtCore\reentrant
Definition qdatastream.h:46
\inmodule QtPositioning
\inmodule QtPositioning
Definition qgeopath.h:16
friend QDataStream & operator>>(QDataStream &stream, QGeoPath &path)
Definition qgeopath.h:63
friend QDataStream & operator<<(QDataStream &stream, const QGeoPath &path)
Definition qgeopath.h:59
\inmodule QtPositioning
Definition qgeoshape.h:17
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
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
GLint GLsizei width
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
double qreal
Definition qtypes.h:187
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]