mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-11 01:22:10 +01:00
WebView: Fix detecting rwhvqt change with QtWebEngine 5.12
BUG: 402805 FIXED-IN: 3.1.0
This commit is contained in:
parent
c08df81dd6
commit
ab43af9958
|
@ -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));
|
||||
|
|
Loading…
Reference in New Issue
Block a user