diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2023-02-03 08:06:11 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2023-02-03 23:42:18 +0100 |
commit | 2b6eb1a51d1593b3df55b5ab4aee3d0eadd75bef (patch) | |
tree | f2aded5432f5716acbd77b57593dabd5ecfddd35 /src/quick/items/qquickmultipointtoucharea_p.h | |
parent | 053394edab2e4bbe655a3a436e7c4b1257deb7da (diff) |
MultiPointTouchArea: rename signal arguments in Qt 7; test with formals
This will be a behavior change for anyone who is still relying on
"touchPoints" to be the signal argument rather than the MPTA property;
so let's put it off until Qt 7 and have a reminder in docs in the
meantime.
Fix autotests to avoid depending on this (just as users should).
[ChangeLog][QtQuick][MultiPointTouchArea] As a reminder: you should
always use formal parameters when writing a signal handler that depends
on an argument, such as MultiPointTouchArea.onPressed, onUpdated,
onReleased, or onCanceled. It gives you an opportunity to name the
argument, to avoid confusion with the touchPoints property, and will
avoid behavior changes if we rename the argument in a future version.
Pick-to: 6.5
Fixes: QTBUG-110906
Change-Id: Ie78dc539f7f6cac660f2e90bf3e4665afed3e3f7
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/quick/items/qquickmultipointtoucharea_p.h')
-rw-r--r-- | src/quick/items/qquickmultipointtoucharea_p.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/quick/items/qquickmultipointtoucharea_p.h b/src/quick/items/qquickmultipointtoucharea_p.h index f92705f28e..26fbf5fc61 100644 --- a/src/quick/items/qquickmultipointtoucharea_p.h +++ b/src/quick/items/qquickmultipointtoucharea_p.h @@ -181,7 +181,7 @@ class Q_QUICK_PRIVATE_EXPORT QQuickMultiPointTouchArea : public QQuickItem Q_OBJECT Q_DISABLE_COPY_MOVE(QQuickMultiPointTouchArea) - Q_PROPERTY(QQmlListProperty<QQuickTouchPoint> touchPoints READ touchPoints) + Q_PROPERTY(QQmlListProperty<QQuickTouchPoint> touchPoints READ touchPoints CONSTANT) Q_PROPERTY(int minimumTouchPoints READ minimumTouchPoints WRITE setMinimumTouchPoints NOTIFY minimumTouchPointsChanged) Q_PROPERTY(int maximumTouchPoints READ maximumTouchPoints WRITE setMaximumTouchPoints NOTIFY maximumTouchPointsChanged) Q_PROPERTY(bool mouseEnabled READ mouseEnabled WRITE setMouseEnabled NOTIFY mouseEnabledChanged) @@ -219,12 +219,23 @@ public: } Q_SIGNALS: +#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0) void pressed(const QList<QObject*> &touchPoints); void updated(const QList<QObject*> &touchPoints); void released(const QList<QObject*> &touchPoints); void canceled(const QList<QObject*> &touchPoints); +#else + void pressed(const QList<QObject*> &points); + void updated(const QList<QObject*> &points); + void released(const QList<QObject*> &points); + void canceled(const QList<QObject*> &points); +#endif void gestureStarted(QQuickGrabGestureEvent *gesture); +#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0) void touchUpdated(const QList<QObject*> &touchPoints); +#else + void touchUpdated(const QList<QObject*> &points); +#endif void minimumTouchPointsChanged(); void maximumTouchPointsChanged(); void mouseEnabledChanged(); |