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
4#ifndef QDECLARATIVEPOLYGONMAPITEM
5#define QDECLARATIVEPOLYGONMAPITEM
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 <QtLocation/private/qlocationglobal_p.h>
19#include <QtLocation/private/qdeclarativegeomapitembase_p.h>
20#include <QtLocation/private/qdeclarativepolylinemapitem_p.h>
21#include <QtPositioning/qgeopolygon.h>
22
24
25class QDeclarativePolygonMapItemPrivate;
26class Q_LOCATION_EXPORT QDeclarativePolygonMapItem : public QDeclarativeGeoMapItemBase
27{
28 Q_OBJECT
29 QML_NAMED_ELEMENT(MapPolygon)
30 QML_ADDED_IN_VERSION(5, 0)
31
32 Q_PROPERTY(QList<QGeoCoordinate> path READ path WRITE setPath NOTIFY pathChanged)
33 Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
34 Q_PROPERTY(QDeclarativeMapLineProperties *border READ border CONSTANT)
35
36public:
37 explicit QDeclarativePolygonMapItem(QQuickItem *parent = nullptr);
38 ~QDeclarativePolygonMapItem() override;
39
40 void setMap(QDeclarativeGeoMap *quickMap, QGeoMap *map) override;
41 //from QuickItem
42 QSGNode *updateMapItemPaintNode(QSGNode *, UpdatePaintNodeData *) override;
43
44 Q_INVOKABLE void addCoordinate(const QGeoCoordinate &coordinate);
45 Q_INVOKABLE void removeCoordinate(const QGeoCoordinate &coordinate);
46
47 QList<QGeoCoordinate> path() const;
48 void setPath(const QList<QGeoCoordinate> &value);
49
50 QColor color() const;
51 void setColor(const QColor &color);
52
53 QDeclarativeMapLineProperties *border();
54
55 bool contains(const QPointF &point) const override;
56 const QGeoShape &geoShape() const override;
57 void setGeoShape(const QGeoShape &shape) override;
58
59Q_SIGNALS:
60 void pathChanged();
61 void colorChanged(const QColor &color);
62
63protected Q_SLOTS:
64 void markSourceDirtyAndUpdate();
65 void onLinePropertiesChanged();
66 void afterViewportChanged(const QGeoMapViewportChangeEvent &event) override;
67
68protected:
69 void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override;
70 void updatePolish() override;
71
72#ifdef QT_LOCATION_DEBUG
73public:
74#endif
75 QGeoPolygon m_geopoly;
76 QDeclarativeMapLineProperties m_border;
77 QColor m_color;
78 bool m_updatingGeometry;
79
80 std::unique_ptr<QDeclarativePolygonMapItemPrivate> m_d;
81
82 friend class QDeclarativePolygonMapItemPrivate;
83 friend class QDeclarativePolygonMapItemPrivateCPU;
84};
85
86QT_END_NAMESPACE
87
88QML_DECLARE_TYPE(QDeclarativePolygonMapItem)
89
90#endif /* QDECLARATIVEPOLYGONMAPITEM_H_ */
Combined button and popup list for selecting options.