31class Q_LOCATION_EXPORT QDeclarativeMapLineProperties :
public QObject
36 Q_PROPERTY(qreal width READ width WRITE setWidth NOTIFY widthChanged)
37 Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
40 explicit QDeclarativeMapLineProperties(QObject *parent =
nullptr);
43 void setColor(
const QColor &color);
46 void setWidth(qreal width);
49 void widthChanged(qreal width);
50 void colorChanged(
const QColor &color);
54 QColor color_ = Qt::black;
61 QML_NAMED_ELEMENT(MapPolyline)
62 QML_ADDED_IN_VERSION(5, 0)
64 Q_PROPERTY(QList<QGeoCoordinate> path READ path WRITE setPath NOTIFY pathChanged)
65 Q_PROPERTY(QDeclarativeMapLineProperties *line READ line CONSTANT)
68 explicit QDeclarativePolylineMapItem(QQuickItem *parent =
nullptr);
69 ~QDeclarativePolylineMapItem();
71 void setMap(QDeclarativeGeoMap *quickMap, QGeoMap *map) override;
73 QSGNode *updateMapItemPaintNode(QSGNode *, UpdatePaintNodeData *) override;
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);
84 QList<QGeoCoordinate> path()
const;
85 virtual void setPath(
const QList<QGeoCoordinate> &value);
86 Q_INVOKABLE
void setPath(
const QGeoPath &path);
88 bool contains(
const QPointF &point)
const override;
89 const QGeoShape &geoShape()
const override;
90 void setGeoShape(
const QGeoShape &shape) override;
92 QDeclarativeMapLineProperties *line();
98 void updateAfterLinePropertiesChanged();
99 void afterViewportChanged(
const QGeoMapViewportChangeEvent &event) override;
102 void geometryChange(
const QRectF &newGeometry,
const QRectF &oldGeometry) override;
103 void setPathFromGeoList(
const QList<QGeoCoordinate> &path);
104 void updatePolish() override;
106#ifdef QT_LOCATION_DEBUG
110 QDeclarativeMapLineProperties m_line;
112 bool m_updatingGeometry =
false;
114 std::unique_ptr<QDeclarativePolylineMapItemPrivate> m_d;
116 friend class QDeclarativePolylineMapItemPrivate;
117 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)