aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/util/qquickpath_p.h
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@qt.io>2019-03-24 18:53:52 +0100
committerpaolo <paolo.angelelli@qt.io>2019-07-18 11:54:20 +0200
commit4a7f21da6e7d1f513fc60dccfff6d6b81a116f21 (patch)
tree6475853ac457cc4670579e92231ff43d3bf4b9f4 /src/quick/util/qquickpath_p.h
parent3d2ff1931f9e7c139bb7a4c9490b2cb595d1e7bf (diff)
Add QQuickPathMultiLine
And show our users even more love. This path element allows to specify a list of polylines as a single list of lists of points. [ChangeLog][QtQuick][Path] Added QQuickPathMultiLine. Change-Id: Idf1d1dcd928bb19b9ad995322f86822448811537 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/quick/util/qquickpath_p.h')
-rw-r--r--src/quick/util/qquickpath_p.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/quick/util/qquickpath_p.h b/src/quick/util/qquickpath_p.h
index 998f4e3123..aa3425ff6c 100644
--- a/src/quick/util/qquickpath_p.h
+++ b/src/quick/util/qquickpath_p.h
@@ -434,6 +434,7 @@ public:
QVariantList path() const;
void setPath(const QVariantList &path);
+ void setPath(const QVector<QPointF> &path);
QPointF start() const;
void addToPath(QPainterPath &path, const QQuickPathData &data) override;
@@ -445,6 +446,30 @@ private:
QVector<QPointF> m_path;
};
+class Q_QUICK_PRIVATE_EXPORT QQuickPathMultiline : public QQuickCurve
+{
+ Q_OBJECT
+ Q_PROPERTY(QPointF start READ start NOTIFY startChanged)
+ Q_PROPERTY(QVariantList paths READ paths WRITE setPaths NOTIFY pathsChanged)
+public:
+ QQuickPathMultiline(QObject *parent=nullptr);
+
+ QVariantList paths() const;
+ void setPaths(const QVariantList &paths);
+ void setPaths(const QVector<QVector<QPointF>> &paths);
+ QPointF start() const;
+ void addToPath(QPainterPath &path, const QQuickPathData &) override;
+
+Q_SIGNALS:
+ void pathsChanged();
+ void startChanged();
+
+private:
+ QPointF absolute(const QPointF &relative) const;
+
+ QVector<QVector<QPointF>> m_paths;
+};
+
struct QQuickCachedBezier
{
QQuickCachedBezier() {}