Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.11.0
-
None
-
Archlinux
-
36d230c44c7e2f6fccf224b4a0ab5efe77117e0a (qt/qtwebengine/5.12)
Description
I'd expect the focusProxy() of a QWebEngineView to always be the RVHW, but sometimes this isn't the case. When adding a hack to simplebrowser to print the focusProxy() on a right-click:
diff --git a/examples/webenginewidgets/simplebrowser/webview.cpp b/examples/webenginewidgets/simplebrowser/webview.cpp
index fcbb543f..c2fda9e5 100644
--- a/examples/webenginewidgets/simplebrowser/webview.cpp
+++ b/examples/webenginewidgets/simplebrowser/webview.cpp
@@ -176,6 +176,7 @@ QWebEngineView *WebView::createWindow(QWebEnginePage::WebWindowType type)
void WebView::contextMenuEvent(QContextMenuEvent *event)
{
+ qDebug() << focusProxy();
QMenu *menu = page()->createStandardContextMenu();
const QList<QAction *> actions = menu->actions();
auto inspectElement = std::find(actions.cbegin(), actions.cend(), page()->action(QWebEnginePage::InspectElement));
then you get what's expected on the Qt webpage: QtWebEngineCore::RenderWidgetHostViewQtDelegateWidget(0x55ee78e3f440).
However, after going to http://www.qt.io/ (which redirects to https://), the focusProxy() is gone and QWidget(0x0) is printed.
This also causes the website to not resize correctly anymore when the window is resized:
Attachments
Issue Links
- resulted in
-
QTBUG-71513 Reg->5.12 Beta3 Quicknanobrowser crashes on exit
- Closed
-
QTBUG-75131 [REG 5.11->5.12] QWebEngineView::setPage doesn't delete old page
- Closed