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_p.h
Go to the documentation of this file.
1// Copyright (C) 2020 Paolo Angelelli <paolo.angelelli@gmail.com>
2// Copyright (C) 2022 The Qt Company Ltd.
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4
5#ifndef QDECLARATIVEPOLYLINEMAPITEM_P_P_H
6#define QDECLARATIVEPOLYLINEMAPITEM_P_P_H
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 <QtCore/QScopedValueRollback>
20#include <QSGGeometryNode>
21#include <QSGFlatColorMaterial>
22
23#include <QtLocation/private/qlocationglobal_p.h>
24#include <QtLocation/private/qdeclarativepolylinemapitem_p.h>
25#include <QtLocation/private/qgeomapitemgeometry_p.h>
26
27#include <QtPositioning/private/qdoublevector2d_p.h>
28
30
31class QQuickShape;
32class QQuickShapePath;
33
35{
36 void updateSourcePoints(const QGeoMap &map,
37 const QList<QDoubleVector2D> &basePath);
38
39 QPainterPath srcPath() const { return srcPath_; }
40
43};
44
46{
47 Q_DISABLE_COPY_MOVE(QDeclarativePolylineMapItemPrivate)
48public:
53
55 virtual void markSourceDirtyAndUpdate() = 0;
56 virtual void onMapSet() = 0;
57 virtual void onLinePropertiesChanged() = 0;
58 virtual void onGeoGeometryChanged() = 0;
59 virtual void onGeoGeometryUpdated() = 0;
60 virtual void onItemGeometryChanged() = 0;
61 virtual void updatePolish() = 0;
62 virtual void afterViewportChanged() = 0;
64 virtual bool contains(const QPointF &point) const = 0;
65
67};
68
70{
71public:
74
76 {
77 // mark dirty just in case we're a width change
78 markSourceDirtyAndUpdate();
79 }
81 {
82 m_geometry.markSourceDirty();
83 m_poly.polishAndUpdate();
84 }
85 void regenerateCache();
86 void updateCache();
87 void afterViewportChanged() override
88 {
89 // preserveGeometry is cleared in updateMapItemPaintNode
90 markSourceDirtyAndUpdate();
91 }
92 void onMapSet() override
93 {
94 regenerateCache();
95 markSourceDirtyAndUpdate();
96 }
97 void onGeoGeometryChanged() override
98 {
99 regenerateCache();
100 markSourceDirtyAndUpdate();
101 }
102 void onGeoGeometryUpdated() override
103 {
104 updateCache();
105 markSourceDirtyAndUpdate();
106 }
107 void onItemGeometryChanged() override
108 {
109 onGeoGeometryChanged();
110 }
111 void updatePolish() override;
112 QSGNode *updateMapItemPaintNode(QSGNode *oldNode, QQuickItem::UpdatePaintNodeData * /*data*/) override;
113 bool contains(const QPointF &point) const override;
114
115 QList<QDoubleVector2D> m_geopathProjected;
117 QQuickShape *m_shape = nullptr;
118 QQuickShapePath *m_shapePath = nullptr;
119 QDeclarativeGeoMapPainterPath *m_painterPath = nullptr;
120};
121
123
124#endif // QDECLARATIVEPOLYLINEMAPITEM_P_P_H
virtual void markSourceDirtyAndUpdate()=0
virtual QSGNode * updateMapItemPaintNode(QSGNode *oldNode, QQuickItem::UpdatePaintNodeData *data)=0
virtual bool contains(const QPointF &point) const =0
QDeclarativePolylineMapItemPrivate(QDeclarativePolylineMapItem &poly)
virtual void onLinePropertiesChanged()=0
virtual void onItemGeometryChanged()=0
\inmodule QtGui
\inmodule QtCore\reentrant
Definition qpoint.h:217
\group qtquick-scenegraph-nodes \title Qt Quick Scene Graph Node classes
Definition qsgnode.h:37
QMap< QString, QString > map
[6]
Combined button and popup list for selecting options.
static bool contains(const QJsonArray &haystack, unsigned needle)
Definition qopengl.cpp:116
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
double qreal
Definition qtypes.h:187
void updateSourcePoints(const QGeoMap &map, const QList< QDoubleVector2D > &basePath)