mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 10:46:35 +01:00
WebView: Store input widget as QWidget and not QObject
This commit is contained in:
parent
8517d393ca
commit
36031c46e6
@ -230,7 +230,7 @@ void WebView::restoreHistory(const QByteArray &data)
|
||||
|
||||
QWidget *WebView::inputWidget() const
|
||||
{
|
||||
return qobject_cast<QWidget*>(m_rwhvqt);
|
||||
return m_rwhvqt;
|
||||
}
|
||||
|
||||
// static
|
||||
@ -1122,8 +1122,8 @@ bool WebView::eventFilter(QObject *obj, QEvent *event)
|
||||
{
|
||||
// Hack to find widget that receives input events
|
||||
if (obj == this && event->type() == QEvent::ChildAdded) {
|
||||
QObject *child = static_cast<QChildEvent*>(event)->child();
|
||||
if (qstrcmp(child->metaObject()->className(), "QtWebEngineCore::RenderWidgetHostViewQtDelegateWidget") == 0) {
|
||||
QWidget *child = qobject_cast<QWidget*>(static_cast<QChildEvent*>(event)->child());
|
||||
if (child && child->inherits("QtWebEngineCore::RenderWidgetHostViewQtDelegateWidget")) {
|
||||
m_rwhvqt = child;
|
||||
m_rwhvqt->installEventFilter(this);
|
||||
}
|
||||
|
@ -183,7 +183,7 @@ private:
|
||||
WebPage* m_page;
|
||||
bool m_firstLoad;
|
||||
|
||||
QObject *m_rwhvqt;
|
||||
QWidget *m_rwhvqt;
|
||||
|
||||
static bool s_forceContextMenuOnMouseRelease;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user