mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 02:36:34 +01:00
WebView: Workaround QtWebEngine issue where webview loses focus
This commit is contained in:
parent
a50eee896c
commit
674a0e78f6
@ -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)
|
||||
{
|
||||
QWebEngineView::load(req.webRequest());
|
||||
|
@ -145,6 +145,8 @@ protected:
|
||||
void resizeEvent(QResizeEvent *event) override;
|
||||
void contextMenuEvent(QContextMenuEvent *event) override;
|
||||
|
||||
bool focusNextPrevChild(bool next) override;
|
||||
|
||||
virtual void _wheelEvent(QWheelEvent *event);
|
||||
virtual void _mousePressEvent(QMouseEvent *event);
|
||||
virtual void _mouseReleaseEvent(QMouseEvent *event);
|
||||
|
Loading…
Reference in New Issue
Block a user