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
qdeclarativepolylinemapitem_p.h
Go to the documentation of this file.
1// Copyright (C) 2022 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 QDECLARATIVEPOLYLINEMAPITEM
5#define QDECLARATIVEPOLYLINEMAPITEM
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QSGGeometryNode>
19#include <QSGFlatColorMaterial>
20#include <QtPositioning/QGeoPath>
21
22#include <QtLocation/private/qlocationglobal_p.h>
23#include <QtLocation/private/qdeclarativegeomapitembase_p.h>
24#include <QtLocation/private/qgeomapitemgeometry_p.h>
25
26#include <QtPositioning/private/qdoublevector2d_p.h>
27
29
30class Q_LOCATION_EXPORT QDeclarativeMapLineProperties : public QObject
31{
34
35 Q_PROPERTY(qreal width READ width WRITE setWidth NOTIFY widthChanged)
37
38public:
40
41 QColor color() const;
42 void setColor(const QColor &color);
43
44 qreal width() const;
45 void setWidth(qreal width);
46
48 void widthChanged(qreal width);
50
52 qreal width_ = 1.0;
53 QColor color_ = Qt::black;
54};
55
58{
60 QML_NAMED_ELEMENT(MapPolyline)
62
63 Q_PROPERTY(QList<QGeoCoordinate> path READ path WRITE setPath NOTIFY pathChanged)
65
66public:
69
70 void setMap(QDeclarativeGeoMap *quickMap, QGeoMap *map) override;
71 //from QuickItem
72 QSGNode *updateMapItemPaintNode(QSGNode *, UpdatePaintNodeData *) override;
73
74 Q_INVOKABLE int pathLength() const;
75 Q_INVOKABLE void addCoordinate(const QGeoCoordinate &coordinate);
76 Q_INVOKABLE void insertCoordinate(int index, const QGeoCoordinate &coordinate);
77 Q_INVOKABLE void replaceCoordinate(int index, const QGeoCoordinate &coordinate);
78 Q_INVOKABLE QGeoCoordinate coordinateAt(int index) const;
79 Q_INVOKABLE bool containsCoordinate(const QGeoCoordinate &coordinate);
80 Q_INVOKABLE void removeCoordinate(const QGeoCoordinate &coordinate);
81 Q_INVOKABLE void removeCoordinate(int index);
82
83 QList<QGeoCoordinate> path() const;
84 virtual void setPath(const QList<QGeoCoordinate> &value);
85 Q_INVOKABLE void setPath(const QGeoPath &path);
86
87 bool contains(const QPointF &point) const override;
88 const QGeoShape &geoShape() const override;
89 void setGeoShape(const QGeoShape &shape) override;
90
92
94 void pathChanged();
95
96protected Q_SLOTS:
97 void updateAfterLinePropertiesChanged();
98 void afterViewportChanged(const QGeoMapViewportChangeEvent &event) override;
99
100protected:
101 void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override;
102 void setPathFromGeoList(const QList<QGeoCoordinate> &path);
103 void updatePolish() override;
104
105#ifdef QT_LOCATION_DEBUG
106public:
107#endif
110
111 bool m_updatingGeometry = false;
112
113 std::unique_ptr<QDeclarativePolylineMapItemPrivate> m_d;
114
117};
118
120
123
124#endif /* QDECLARATIVEPOLYLINEMAPITEM_H_ */
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition qcolor.h:31
QDeclarativeMapLineProperties m_line
std::unique_ptr< QDeclarativePolylineMapItemPrivate > m_d
\inmodule QtPositioning
\inmodule QtPositioning
Definition qgeopath.h:16
\inmodule QtPositioning
Definition qgeoshape.h:17
Definition qlist.h:75
\inmodule QtCore
Definition qobject.h:103
\inmodule QtCore\reentrant
Definition qpoint.h:217
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:63
\inmodule QtCore\reentrant
Definition qrect.h:484
\group qtquick-scenegraph-nodes \title Qt Quick Scene Graph Node classes
Definition qsgnode.h:37
QMap< QString, QString > map
[6]
void colorChanged()
Combined button and popup list for selecting options.
Definition qcompare.h:63
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
static bool contains(const QJsonArray &haystack, unsigned needle)
Definition qopengl.cpp:116
GLuint index
[2]
GLint GLsizei width
GLuint color
[2]
struct _cl_event * event
GLsizei const GLchar *const * path
#define QML_DECLARE_TYPE(TYPE)
Definition qqml.h:19
#define QML_ANONYMOUS
#define QML_NAMED_ELEMENT(NAME)
#define QML_ADDED_IN_VERSION(MAJOR, MINOR)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_INVOKABLE
#define Q_SLOTS
#define Q_SIGNALS
double qreal
Definition qtypes.h:187
#define explicit
myFilter setColor(QColor(128, 0, 0))
QGraphicsSvgItem * black