summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorJüri Valdmann <juri.valdmann@qt.io>2018-05-15 11:51:16 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2018-05-15 20:05:20 +0000
commit694350898f4d96a57a1f91e36519070ed4b4c09b (patch)
tree9561bff5bb1b95c35594325ef0aeac914b9d1524 /examples
parentce01bf795b5a50e28e119d1925b395b8bfcf419b (diff)
Fix keyboard focus for speculative RenderFrameHosts
When encountering a 301 redirect, one render frame/widget is created for the original URL plus one "speculative" render frame/widget for the new URL. Once the speculative frame commits, keyboard focus should switch to the corresponding widget. This doesn't work however, because QQuickItem::forceActiveFocus doesn't give focus to the containing QQuickWidget. Fixed by using QWidget::setFocus. Also changed simplebrowser to focus the QWebEngineView on startup. Task-number: QTBUG-68076 Change-Id: I8dc42ba89bfdcd46a86c7dca357fdf1e94f439d4 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/webenginewidgets/simplebrowser/main.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/webenginewidgets/simplebrowser/main.cpp b/examples/webenginewidgets/simplebrowser/main.cpp
index 9b9bf80b..96b1eab9 100644
--- a/examples/webenginewidgets/simplebrowser/main.cpp
+++ b/examples/webenginewidgets/simplebrowser/main.cpp
@@ -50,7 +50,7 @@
#include "browser.h"
#include "browserwindow.h"
-#include "webview.h"
+#include "tabwidget.h"
#include <QApplication>
#include <QWebEngineSettings>
@@ -78,7 +78,7 @@ int main(int argc, char **argv)
Browser browser;
BrowserWindow *window = browser.createWindow();
- window->currentTab()->setUrl(url);
+ window->tabWidget()->setUrl(url);
return app.exec();
}