aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2023-08-31 13:20:31 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-09-06 11:23:14 +0000
commitcf1947adab78af00305562de2b5e44ac0360c503 (patch)
tree78f03a1156a93426be8eb90882fb227eb12659ee /src
parentd98d50f6eff931b30cdc9e58ec69445ef5bd1ceb (diff)
Rename Path.simplified to simplify
simplified() sounds like it should be invokable, since we have precedents like QString::simplified() and QPainterPath::simplified(). We might even want a QML API like that some day. The new name more clearly indicates that it will internally simplify itself. Change-Id: I6b6ced667f78317c374fa02338752d15b35b8ed4 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit 03dab7544eef6205d751003453d7c316c983b096) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r--src/quick/util/qquickpath.cpp16
-rw-r--r--src/quick/util/qquickpath_p.h8
-rw-r--r--src/quick/util/qquickpath_p_p.h2
-rw-r--r--src/quickshapes/qquickshape.cpp4
4 files changed, 15 insertions, 15 deletions
diff --git a/src/quick/util/qquickpath.cpp b/src/quick/util/qquickpath.cpp
index 6aa4d49651..da43df7b1a 100644
--- a/src/quick/util/qquickpath.cpp
+++ b/src/quick/util/qquickpath.cpp
@@ -372,7 +372,7 @@ void QQuickPath::processPath()
d->_path = createPath(QPointF(), QPointF(), d->_attributes, d->pathLength, d->_attributePoints, &d->closed);
}
- if (d->simplified)
+ if (d->simplify)
d->_path = d->_path.simplified();
emit changed();
@@ -715,7 +715,7 @@ void QQuickPath::invalidateSequentialHistory() const
d->prevBez.isValid = false;
}
-/*! \qmlproperty bool QtQuick::Path::simplified
+/*! \qmlproperty bool QtQuick::Path::simplify
\since 6.6
When set to true, the path will be simplified. This implies merging all subpaths that intersect,
@@ -723,22 +723,22 @@ void QQuickPath::invalidateSequentialHistory() const
merged. The simplified path is intended to be used with ShapePath.OddEvenFill. Bezier curves may
be flattened to line segments due to numerical instability of doing bezier curve intersections.
*/
-void QQuickPath::setSimplified(bool simplified)
+void QQuickPath::setSimplify(bool s)
{
Q_D(QQuickPath);
- if (d->simplified == simplified)
+ if (d->simplify == s)
return;
- d->simplified = simplified;
+ d->simplify = s;
processPath();
- emit simplifiedChanged();
+ emit simplifyChanged();
}
-bool QQuickPath::simplified() const
+bool QQuickPath::simplify() const
{
Q_D(const QQuickPath);
- return d->simplified;
+ return d->simplify;
}
/*!
diff --git a/src/quick/util/qquickpath_p.h b/src/quick/util/qquickpath_p.h
index 97825509b5..e1398e474c 100644
--- a/src/quick/util/qquickpath_p.h
+++ b/src/quick/util/qquickpath_p.h
@@ -487,7 +487,7 @@ class Q_QUICK_PRIVATE_EXPORT QQuickPath : public QObject, public QQmlParserStatu
Q_PROPERTY(qreal startX READ startX WRITE setStartX NOTIFY startXChanged FINAL)
Q_PROPERTY(qreal startY READ startY WRITE setStartY NOTIFY startYChanged FINAL)
Q_PROPERTY(bool closed READ isClosed NOTIFY changed FINAL)
- Q_PROPERTY(bool simplified READ simplified WRITE setSimplified NOTIFY simplifiedChanged REVISION(6, 6) FINAL)
+ Q_PROPERTY(bool simplify READ simplify WRITE setSimplify NOTIFY simplifyChanged REVISION(6, 6) FINAL)
Q_PROPERTY(QSizeF scale READ scale WRITE setScale NOTIFY scaleChanged REVISION(2, 14))
Q_CLASSINFO("DefaultProperty", "pathElements")
QML_NAMED_ELEMENT(Path)
@@ -518,14 +518,14 @@ public:
QSizeF scale() const;
void setScale(const QSizeF &scale);
- bool simplified() const;
- void setSimplified(bool simplified);
+ bool simplify() const;
+ void setSimplify(bool s);
Q_SIGNALS:
void changed();
void startXChanged();
void startYChanged();
- Q_REVISION(6, 6) void simplifiedChanged();
+ Q_REVISION(6, 6) void simplifyChanged();
Q_REVISION(2, 14) void scaleChanged();
protected:
diff --git a/src/quick/util/qquickpath_p_p.h b/src/quick/util/qquickpath_p_p.h
index 6dbab4ea57..523546251a 100644
--- a/src/quick/util/qquickpath_p_p.h
+++ b/src/quick/util/qquickpath_p_p.h
@@ -53,7 +53,7 @@ public:
bool closed = false;
bool componentComplete = true;
bool isShapePath = false;
- bool simplified = false;
+ bool simplify = false;
};
QT_END_NAMESPACE
diff --git a/src/quickshapes/qquickshape.cpp b/src/quickshapes/qquickshape.cpp
index 86d5116869..396f78660d 100644
--- a/src/quickshapes/qquickshape.cpp
+++ b/src/quickshapes/qquickshape.cpp
@@ -699,8 +699,8 @@ QQuickShape::~QQuickShape()
\list 1
\li Only quadratic curves are inherently supported. Cubic curves will be approximated by
quadratic curves.
- \li Shapes where elements intersect are not rendered correctly. The \l [QML] {Path::simplified}
- {Path.simplified} property may be used to remove self-intersections from such shapes, but
+ \li Shapes where elements intersect are not rendered correctly. The \l [QML] {Path::simplify}
+ {Path.simplify} property may be used to remove self-intersections from such shapes, but
may incur a performance cost and reduced visual quality.
\li Shapes that span a large numerical range, such as a long string of text, may have
issues. Consider splitting these shapes into multiple ones, for instance by making