30class Q_LOCATION_EXPORT QDeclarativeMapLineProperties :
public QObject
35 Q_PROPERTY(qreal width READ width WRITE setWidth NOTIFY widthChanged)
36 Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
39 explicit QDeclarativeMapLineProperties(QObject *parent =
nullptr);
42 void setColor(
const QColor &color);
45 void setWidth(qreal width);
48 void widthChanged(qreal width);
49 void colorChanged(
const QColor &color);
53 QColor color_ = Qt::black;
60 QML_NAMED_ELEMENT(MapPolyline)
61 QML_ADDED_IN_VERSION(5, 0)
63 Q_PROPERTY(QList<QGeoCoordinate> path READ path WRITE setPath NOTIFY pathChanged)
64 Q_PROPERTY(QDeclarativeMapLineProperties *line READ line CONSTANT)
67 explicit QDeclarativePolylineMapItem(QQuickItem *parent =
nullptr);
68 ~QDeclarativePolylineMapItem();
70 void setMap(QDeclarativeGeoMap *quickMap, QGeoMap *map) override;
72 QSGNode *updateMapItemPaintNode(QSGNode *, UpdatePaintNodeData *) override;
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);
83 QList<QGeoCoordinate> path()
const;
84 virtual void setPath(
const QList<QGeoCoordinate> &value);
85 Q_INVOKABLE
void setPath(
const QGeoPath &path);
87 bool contains(
const QPointF &point)
const override;
88 const QGeoShape &geoShape()
const override;
89 void setGeoShape(
const QGeoShape &shape) override;
91 QDeclarativeMapLineProperties *line();
97 void updateAfterLinePropertiesChanged();
98 void afterViewportChanged(
const QGeoMapViewportChangeEvent &event) override;
101 void geometryChange(
const QRectF &newGeometry,
const QRectF &oldGeometry) override;
102 void setPathFromGeoList(
const QList<QGeoCoordinate> &path);
103 void updatePolish() override;
105#ifdef QT_LOCATION_DEBUG
109 QDeclarativeMapLineProperties m_line;
111 bool m_updatingGeometry =
false;
113 std::unique_ptr<QDeclarativePolylineMapItemPrivate> m_d;
115 friend class QDeclarativePolylineMapItemPrivate;
116 friend class QDeclarativePolylineMapItemPrivateCPU;
static QT_BEGIN_NAMESPACE bool get_line_intersection(const double p0_x, const double p0_y, const double p1_x, const double p1_y, const double p2_x, const double p2_y, const double p3_x, const double p3_y, double *i_x, double *i_y, double *i_t)