diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2017-09-27 11:17:56 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2017-09-29 11:36:43 +0000 |
commit | fdcaf8013e7d2701824024a11ef159b2558ab6a6 (patch) | |
tree | aa1aa2f542d77967a9c418a59ff2063690e8a905 /src/quick/items | |
parent | 93855f56bf750e22f2c10763c6306748e87e691d (diff) |
QQuickWindowPrivate::deliverKeyEvent: stop using QQW::sendEvent
To uphold the deprecation, we have to stop using it ourselves.
Fixes the warning.
Change-Id: Ia9ba24086fbc3a336a950b63ea2745a26b4f2866
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'src/quick/items')
-rw-r--r-- | src/quick/items/qquickwindow.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index 8c7cbe5117..9f3f8531e4 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -1644,10 +1644,15 @@ void QQuickWindow::keyReleaseEvent(QKeyEvent *e) void QQuickWindowPrivate::deliverKeyEvent(QKeyEvent *e) { - Q_Q(QQuickWindow); - - if (activeFocusItem) - q->sendEvent(activeFocusItem, e); + if (activeFocusItem) { + QQuickItem *item = activeFocusItem; + e->accept(); + QCoreApplication::sendEvent(item, e); + while (!e->isAccepted() && (item = item->parentItem())) { + e->accept(); + QCoreApplication::sendEvent(item, e); + } + } } QMouseEvent *QQuickWindowPrivate::cloneMouseEvent(QMouseEvent *event, QPointF *transformedLocalPos) |