mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-11 01:22:10 +01:00
WebView: Fix finding rwhvqt with QtWebEngine 5.11
This commit is contained in:
parent
75d5f5d552
commit
9f0817ca71
|
@ -76,22 +76,6 @@ WebView::WebView(QWidget* parent)
|
|||
}
|
||||
|
||||
WebInspector::registerView(this);
|
||||
|
||||
// Hack to find widget that receives input events
|
||||
QStackedLayout *l = qobject_cast<QStackedLayout*>(layout());
|
||||
connect(l, &QStackedLayout::currentChanged, this, [this]() {
|
||||
QTimer::singleShot(0, this, [this]() {
|
||||
m_rwhvqt = focusProxy();
|
||||
if (!m_rwhvqt) {
|
||||
qCritical() << "Focus proxy is null!";
|
||||
return;
|
||||
}
|
||||
m_rwhvqt->installEventFilter(this);
|
||||
if (QQuickWidget *w = qobject_cast<QQuickWidget*>(m_rwhvqt)) {
|
||||
w->setClearColor(palette().color(QPalette::Window));
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
WebView::~WebView()
|
||||
|
@ -1307,6 +1291,15 @@ bool WebView::eventFilter(QObject *obj, QEvent *event)
|
|||
parentWidget()->installEventFilter(this);
|
||||
}
|
||||
|
||||
// Hack to find widget that receives input events
|
||||
if (obj == this && event->type() == QEvent::ChildAdded && !m_rwhvqt && focusProxy()) {
|
||||
m_rwhvqt = focusProxy();
|
||||
m_rwhvqt->installEventFilter(this);
|
||||
if (QQuickWidget *w = qobject_cast<QQuickWidget*>(m_rwhvqt)) {
|
||||
w->setClearColor(palette().color(QPalette::Window));
|
||||
}
|
||||
}
|
||||
|
||||
// Forward events to WebView
|
||||
#define HANDLE_EVENT(f, t) \
|
||||
{ \
|
||||
|
|
Loading…
Reference in New Issue
Block a user