aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2021-07-15 15:31:28 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-07-19 08:49:01 +0000
commitb99933558ad461e54ed3070b43b9f1b16cb43a47 (patch)
treece41cefffe0b4630dfa6e02cb930d4485f61dca6
parentd407daa683775b30f127345d3a2025a0434a4f73 (diff)
Separate the signals for QQuickPen properties
There were some bogus "binding loops" in the pinchHandler manual test. Change-Id: Ib81c4850125d2db411a21ea4e95ff36c713ce1c1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 5d9b928516a1486bd0f03d9a0c245a64a58fb1ac) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/quick/items/qquickrectangle.cpp6
-rw-r--r--src/quick/items/qquickrectangle_p.h10
2 files changed, 9 insertions, 7 deletions
diff --git a/src/quick/items/qquickrectangle.cpp b/src/quick/items/qquickrectangle.cpp
index ebcfe5bca1..ce570a743c 100644
--- a/src/quick/items/qquickrectangle.cpp
+++ b/src/quick/items/qquickrectangle.cpp
@@ -95,7 +95,7 @@ void QQuickPen::setWidth(qreal w)
m_width = w;
m_valid = m_color.alpha() && (qRound(m_width) >= 1 || (!m_aligned && m_width > 0));
static_cast<QQuickItem*>(parent())->update();
- emit penChanged();
+ emit widthChanged();
}
QColor QQuickPen::color() const
@@ -108,7 +108,7 @@ void QQuickPen::setColor(const QColor &c)
m_color = c;
m_valid = m_color.alpha() && (qRound(m_width) >= 1 || (!m_aligned && m_width > 0));
static_cast<QQuickItem*>(parent())->update();
- emit penChanged();
+ emit colorChanged();
}
bool QQuickPen::pixelAligned() const
@@ -123,7 +123,7 @@ void QQuickPen::setPixelAligned(bool aligned)
m_aligned = aligned;
m_valid = m_color.alpha() && (qRound(m_width) >= 1 || (!m_aligned && m_width > 0));
static_cast<QQuickItem*>(parent())->update();
- emit penChanged();
+ emit pixelAlignedChanged();
}
bool QQuickPen::isValid() const
diff --git a/src/quick/items/qquickrectangle_p.h b/src/quick/items/qquickrectangle_p.h
index 8c0d111241..f4e66ebeca 100644
--- a/src/quick/items/qquickrectangle_p.h
+++ b/src/quick/items/qquickrectangle_p.h
@@ -63,9 +63,9 @@ class Q_QUICK_PRIVATE_EXPORT QQuickPen : public QObject
{
Q_OBJECT
- Q_PROPERTY(qreal width READ width WRITE setWidth NOTIFY penChanged)
- Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY penChanged)
- Q_PROPERTY(bool pixelAligned READ pixelAligned WRITE setPixelAligned NOTIFY penChanged)
+ Q_PROPERTY(qreal width READ width WRITE setWidth NOTIFY widthChanged)
+ Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
+ Q_PROPERTY(bool pixelAligned READ pixelAligned WRITE setPixelAligned NOTIFY pixelAlignedChanged)
QML_ANONYMOUS
QML_ADDED_IN_VERSION(2, 0)
public:
@@ -83,7 +83,9 @@ public:
bool isValid() const;
Q_SIGNALS:
- void penChanged();
+ void widthChanged();
+ void colorChanged();
+ void pixelAlignedChanged();
private:
qreal m_width;