1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 02:36:34 +01:00

WebView: Fix detecting rwhvqt change with QtWebEngine 5.12

BUG: 402805
FIXED-IN: 3.1.0
This commit is contained in:
David Rosca 2019-01-26 10:36:48 +01:00
parent c08df81dd6
commit ab43af9958
No known key found for this signature in database
GPG Key ID: EBC3FC294452C6D8

View File

@ -1276,9 +1276,16 @@ bool WebView::eventFilter(QObject *obj, QEvent *event)
// Hack to find widget that receives input events
if (obj == this && event->type() == QEvent::ChildAdded) {
#if QTWEBENGINEWIDGETS_VERSION >= QT_VERSION_CHECK(5, 12, 0)
QPointer<QWidget> child = qobject_cast<QWidget*>(static_cast<QChildEvent*>(event)->child());
QTimer::singleShot(0, this, [=]() {
if (child && child->inherits("QtWebEngineCore::RenderWidgetHostViewQtDelegateWidget")) {
m_rwhvqt = child;
#else
QTimer::singleShot(0, this, [this]() {
if (focusProxy() && m_rwhvqt != focusProxy()) {
m_rwhvqt = focusProxy();
#endif
m_rwhvqt->installEventFilter(this);
if (QQuickWidget *w = qobject_cast<QQuickWidget*>(m_rwhvqt)) {
w->setClearColor(palette().color(QPalette::Window));