1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 09:32:12 +01:00

WebView: Workaround QtWebEngine issue where webview loses focus

This commit is contained in:
David Rosca 2018-03-13 18:44:28 +01:00
parent a50eee896c
commit 674a0e78f6
No known key found for this signature in database
GPG Key ID: EBC3FC294452C6D8
2 changed files with 13 additions and 0 deletions

View File

@ -1268,6 +1268,17 @@ void WebView::contextMenuEvent(QContextMenuEvent *event)
}); });
} }
bool WebView::focusNextPrevChild(bool next)
{
// QTBUG-67043
// Workaround QtWebEngine issue where QWebEngineView loses focus on second load() call.
if (next) {
setFocus();
return false;
}
return QWebEngineView::focusNextPrevChild(next);
}
void WebView::loadRequest(const LoadRequest &req) void WebView::loadRequest(const LoadRequest &req)
{ {
QWebEngineView::load(req.webRequest()); QWebEngineView::load(req.webRequest());

View File

@ -145,6 +145,8 @@ protected:
void resizeEvent(QResizeEvent *event) override; void resizeEvent(QResizeEvent *event) override;
void contextMenuEvent(QContextMenuEvent *event) override; void contextMenuEvent(QContextMenuEvent *event) override;
bool focusNextPrevChild(bool next) override;
virtual void _wheelEvent(QWheelEvent *event); virtual void _wheelEvent(QWheelEvent *event);
virtual void _mousePressEvent(QMouseEvent *event); virtual void _mousePressEvent(QMouseEvent *event);
virtual void _mouseReleaseEvent(QMouseEvent *event); virtual void _mouseReleaseEvent(QMouseEvent *event);