aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickitem.cpp
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2017-11-22 14:13:53 +0100
committerShawn Rutledge <shawn.rutledge@qt.io>2017-11-23 22:53:59 +0000
commit2f91b0f25fff560de27632ec9d947c890426664e (patch)
tree068cc2d48d7f25c3318e6291eeeb412937a947a0 /src/quick/items/qquickitem.cpp
parent9e59d4fc1fd52f4583858c28fc0c5a51d51a457a (diff)
prepend PointerHandler children of Items so the last is visited first
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 <jan-arve.saether@qt.io>
Diffstat (limited to 'src/quick/items/qquickitem.cpp')
-rw-r--r--src/quick/items/qquickitem.cpp2
1 files changed, 1 insertions, 1 deletions
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<QObject> *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<QQuickWindow *>(o);
QQuickItem *item = that;