From 2f91b0f25fff560de27632ec9d947c890426664e Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Wed, 22 Nov 2017 14:13:53 +0100 Subject: prepend PointerHandler children of Items so the last is visited first MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This helps with overriding behavior: when a QML control implementation has handlers encapsulated inside, but the user tries to override behavior by declaring more handler instances in instances of the control, the user's handlers must be visited before the encapsulated handlers. Likewise, this reverse-ordering corresponds to intuition after having used MouseHandlers: the one which is declared last inside an Item will have a higher effective Z order, and thus will be visited first during event delivery. Task-number: QTBUG-64692 Change-Id: I9bf18218a1887d0297c71ebf81dde0956394b72a Reviewed-by: Jan Arve Sæther --- src/quick/items/qquickitem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/quick/items/qquickitem.cpp') diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp index ccc4e90abf..54fcbfbbf2 100644 --- a/src/quick/items/qquickitem.cpp +++ b/src/quick/items/qquickitem.cpp @@ -3253,7 +3253,7 @@ void QQuickItemPrivate::data_append(QQmlListProperty *prop, QObject *o) // because there can be multiple handlers... that->setAcceptedMouseButtons(Qt::AllButtons); QQuickItemPrivate *p = QQuickItemPrivate::get(that); - p->extra.value().pointerHandlers.append(pointerHandler); + p->extra.value().pointerHandlers.prepend(pointerHandler); } else { QQuickWindow *thisWindow = qmlobject_cast(o); QQuickItem *item = that; -- cgit v1.2.3