summaryrefslogtreecommitdiffstats
path: root/src/webengine/api/qquickwebengineview.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2019-03-21 11:19:09 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2019-03-21 11:53:14 +0000
commitc8d11a21c648e87f3560042e1c022f031a6e6519 (patch)
treed8885fb28dd423258abc4eeadbdd7157c7b5c6c5 /src/webengine/api/qquickwebengineview.cpp
parent01c763c83d0c846164dcb5b69b9343e6ee2ac0b7 (diff)
Fixup focus implementation
Follow the other implementation and pass TakeFocus to WebContents Delegate, and hook to our UI from there. Also fixes use of Blur instead of LostFocus, which means we now render unfocused more correctly. Change-Id: I34a1882489bc68b9ff36ed5139af0ee8a3a95b79 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'src/webengine/api/qquickwebengineview.cpp')
-rw-r--r--src/webengine/api/qquickwebengineview.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/webengine/api/qquickwebengineview.cpp b/src/webengine/api/qquickwebengineview.cpp
index 53f12fa97..fd3cc8e82 100644
--- a/src/webengine/api/qquickwebengineview.cpp
+++ b/src/webengine/api/qquickwebengineview.cpp
@@ -333,12 +333,16 @@ void QQuickWebEngineViewPrivate::runFileChooser(QSharedPointer<FilePickerControl
ui()->showFilePicker(controller);
}
-void QQuickWebEngineViewPrivate::passOnFocus(bool reverse)
+bool QQuickWebEngineViewPrivate::passOnFocus(bool reverse)
{
Q_Q(QQuickWebEngineView);
// The child delegate currently has focus, find the next one from there and give it focus.
QQuickItem *next = q->scopedFocusItem()->nextItemInFocusChain(!reverse);
- next->forceActiveFocus(reverse ? Qt::BacktabFocusReason : Qt::TabFocusReason);
+ if (next) {
+ next->forceActiveFocus(reverse ? Qt::BacktabFocusReason : Qt::TabFocusReason);
+ return true;
+ }
+ return false;
}
void QQuickWebEngineViewPrivate::titleChanged(const QString &title)