Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qdeclarativepolygonmapitem_p.h
Go to the documentation of this file.
1// Copyright (C) 2015 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// Qt-Security score:significant reason:default
4
5#ifndef QDECLARATIVEPOLYGONMAPITEM
6#define QDECLARATIVEPOLYGONMAPITEM
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtLocation/private/qlocationglobal_p.h>
20#include <QtLocation/private/qdeclarativegeomapitembase_p.h>
21#include <QtLocation/private/qdeclarativepolylinemapitem_p.h>
22#include <QtPositioning/qgeopolygon.h>
23
25
26class QDeclarativePolygonMapItemPrivate;
27class Q_LOCATION_EXPORT QDeclarativePolygonMapItem : public QDeclarativeGeoMapItemBase
28{
29 Q_OBJECT
30 QML_NAMED_ELEMENT(MapPolygon)
31 QML_ADDED_IN_VERSION(5, 0)
32
33 Q_PROPERTY(QList<QGeoCoordinate> path READ path WRITE setPath NOTIFY pathChanged)
34 Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
35 Q_PROPERTY(QDeclarativeMapLineProperties *border READ border CONSTANT)
36
37public:
38 explicit QDeclarativePolygonMapItem(QQuickItem *parent = nullptr);
39 ~QDeclarativePolygonMapItem() override;
40
41 void setMap(QDeclarativeGeoMap *quickMap, QGeoMap *map) override;
42 //from QuickItem
43 QSGNode *updateMapItemPaintNode(QSGNode *, UpdatePaintNodeData *) override;
44
45 Q_INVOKABLE void addCoordinate(const QGeoCoordinate &coordinate);
46 Q_INVOKABLE void removeCoordinate(const QGeoCoordinate &coordinate);
47
48 QList<QGeoCoordinate> path() const;
49 void setPath(const QList<QGeoCoordinate> &value);
50
51 QColor color() const;
52 void setColor(const QColor &color);
53
54 QDeclarativeMapLineProperties *border();
55
56 bool contains(const QPointF &point) const override;
57 const QGeoShape &geoShape() const override;
58 void setGeoShape(const QGeoShape &shape) override;
59
60Q_SIGNALS:
61 void pathChanged();
62 void colorChanged(const QColor &color);
63
64protected Q_SLOTS:
65 void markSourceDirtyAndUpdate();
66 void onLinePropertiesChanged();
67 void afterViewportChanged(const QGeoMapViewportChangeEvent &event) override;
68
69protected:
70 void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override;
71 void updatePolish() override;
72
73#ifdef QT_LOCATION_DEBUG
74public:
75#endif
76 QGeoPolygon m_geopoly;
77 QDeclarativeMapLineProperties m_border;
78 QColor m_color;
79 bool m_updatingGeometry;
80
81 std::unique_ptr<QDeclarativePolygonMapItemPrivate> m_d;
82
83 friend class QDeclarativePolygonMapItemPrivate;
84 friend class QDeclarativePolygonMapItemPrivateCPU;
85};
86
87QT_END_NAMESPACE
88
89QML_DECLARE_TYPE(QDeclarativePolygonMapItem)
90
91#endif /* QDECLARATIVEPOLYGONMAPITEM_H_ */
Combined button and popup list for selecting options.