Qt 6.x
The Qt SDK
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_PRIVATE_EXPORT QDeclarativeMapLineProperties : public QObject
31{
35
36 Q_PROPERTY(qreal width READ width WRITE setWidth NOTIFY widthChanged)
38
39public:
40 explicit QDeclarativeMapLineProperties(QObject *parent = nullptr);
41
42 QColor color() const;
43 void setColor(const QColor &color);
44
45 qreal width() const;
46 void setWidth(qreal width);
47
51
52private:
53 qreal width_ = 1.0;
54 QColor color_ = Qt::black;
55};
56
58class Q_LOCATION_PRIVATE_EXPORT QDeclarativePolylineMapItem : public QDeclarativeGeoMapItemBase
59{
61 QML_NAMED_ELEMENT(MapPolyline)
63
64 Q_PROPERTY(QList<QGeoCoordinate> path READ path WRITE setPath NOTIFY pathChanged)
66
67public:
70
71 void setMap(QDeclarativeGeoMap *quickMap, QGeoMap *map) override;
72 //from QuickItem
73 QSGNode *updateMapItemPaintNode(QSGNode *, UpdatePaintNodeData *) override;
74
75 Q_INVOKABLE int pathLength() const;
76 Q_INVOKABLE void addCoordinate(const QGeoCoordinate &coordinate);
77 Q_INVOKABLE void insertCoordinate(int index, const QGeoCoordinate &coordinate);
78 Q_INVOKABLE void replaceCoordinate(int index, const QGeoCoordinate &coordinate);
79 Q_INVOKABLE QGeoCoordinate coordinateAt(int index) const;
80 Q_INVOKABLE bool containsCoordinate(const QGeoCoordinate &coordinate);
81 Q_INVOKABLE void removeCoordinate(const QGeoCoordinate &coordinate);
82 Q_INVOKABLE void removeCoordinate(int index);
83
85 virtual void setPath(const QList<QGeoCoordinate> &value);
86 Q_INVOKABLE void setPath(const QGeoPath &path);
87
88 bool contains(const QPointF &point) const override;
89 const QGeoShape &geoShape() const override;
90 void setGeoShape(const QGeoShape &shape) override;
91
93
96
97protected Q_SLOTS:
98 void updateAfterLinePropertiesChanged();
99 void afterViewportChanged(const QGeoMapViewportChangeEvent &event) override;
100
101protected:
102 void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override;
103 void setPathFromGeoList(const QList<QGeoCoordinate> &path);
104 void updatePolish() override;
105
106#ifdef QT_LOCATION_DEBUG
107public:
108#endif
111
112 bool m_updatingGeometry = false;
113
114 std::unique_ptr<QDeclarativePolylineMapItemPrivate> m_d;
115
118};
119
121
124
125#endif /* QDECLARATIVEPOLYLINEMAPITEM_H_ */
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition qcolor.h:31
void widthChanged(qreal width)
void colorChanged(const QColor &color)
QDeclarativeMapLineProperties m_line
QDeclarativeMapLineProperties * line()
std::unique_ptr< QDeclarativePolylineMapItemPrivate > m_d
\inmodule QtPositioning
\inmodule QtPositioning
Definition qgeopath.h:16
\inmodule QtPositioning
Definition qgeoshape.h:17
Definition qlist.h:74
\inmodule QtCore
Definition qobject.h:90
\inmodule QtCore\reentrant
Definition qpoint.h:214
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:64
\inmodule QtCore\reentrant
Definition qrect.h:483
\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.
@ black
Definition qnamespace.h:29
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
static bool contains(const QJsonArray &haystack, unsigned needle)
Definition qopengl.cpp:116
GLuint index
[2]
GLint GLsizei width
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 QML_ELEMENT
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_INVOKABLE
#define Q_SLOTS
#define Q_SIGNALS
double qreal
Definition qtypes.h:92
myFilter setColor(QColor(128, 0, 0))
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent