From b8fd580cb3453b3850c36765c4b2537538d2f4f8 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Thu, 26 Jul 2018 08:14:13 +0200 Subject: TapHandler: emit eventPoint from the tapped signals MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Any JS callback using one of these signals probably needs to know which button was tapped. We do not want to require TapHandler.point.pressedButtons to tell a lie (temporarily hold the previous state even though a button was actually released). We could add a releasedButtons property, but it would be a bit weird to have it holding state indefinitely between events. We could add just a button parameter to these signals, which would not be so bad, but emitting the whole eventPoint opens up other possibilities, like doing filtering in JS based on the device. To be able to get the device property of the event in QML, it must not be a const pointer. Q_PROPERTY(const type* ...) is so far unprecedented in Qt Quick; and the device has only const properties anyway. This reverts 8dc02aab72a714b5195ccc641fbfb534c3ae9e98 Task-number: QTBUG-61749 Task-number: QTBUG-64847 Change-Id: I09067498b22cc86e9f68c5ff13d6aa5447faba3d Reviewed-by: Jan Arve Sæther --- src/quick/items/qquickevents_p_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/quick/items/qquickevents_p_p.h') diff --git a/src/quick/items/qquickevents_p_p.h b/src/quick/items/qquickevents_p_p.h index c67c386676..7ac2bab7fd 100644 --- a/src/quick/items/qquickevents_p_p.h +++ b/src/quick/items/qquickevents_p_p.h @@ -386,7 +386,7 @@ private: class Q_QUICK_PRIVATE_EXPORT QQuickPointerEvent : public QObject { Q_OBJECT - Q_PROPERTY(const QQuickPointerDevice *device READ device) + Q_PROPERTY(QQuickPointerDevice *device READ device) Q_PROPERTY(Qt::KeyboardModifiers modifiers READ modifiers) Q_PROPERTY(Qt::MouseButtons button READ button) Q_PROPERTY(Qt::MouseButtons buttons READ buttons) -- cgit v1.2.3