mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-14 02:52:12 +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
|
QWidget *WebView::inputWidget() const
|
||||||
{
|
{
|
||||||
return qobject_cast<QWidget*>(m_rwhvqt);
|
return m_rwhvqt;
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
|
@ -1122,8 +1122,8 @@ bool WebView::eventFilter(QObject *obj, QEvent *event)
|
||||||
{
|
{
|
||||||
// Hack to find widget that receives input events
|
// Hack to find widget that receives input events
|
||||||
if (obj == this && event->type() == QEvent::ChildAdded) {
|
if (obj == this && event->type() == QEvent::ChildAdded) {
|
||||||
QObject *child = static_cast<QChildEvent*>(event)->child();
|
QWidget *child = qobject_cast<QWidget*>(static_cast<QChildEvent*>(event)->child());
|
||||||
if (qstrcmp(child->metaObject()->className(), "QtWebEngineCore::RenderWidgetHostViewQtDelegateWidget") == 0) {
|
if (child && child->inherits("QtWebEngineCore::RenderWidgetHostViewQtDelegateWidget")) {
|
||||||
m_rwhvqt = child;
|
m_rwhvqt = child;
|
||||||
m_rwhvqt->installEventFilter(this);
|
m_rwhvqt->installEventFilter(this);
|
||||||
}
|
}
|
||||||
|
|
|
@ -183,7 +183,7 @@ private:
|
||||||
WebPage* m_page;
|
WebPage* m_page;
|
||||||
bool m_firstLoad;
|
bool m_firstLoad;
|
||||||
|
|
||||||
QObject *m_rwhvqt;
|
QWidget *m_rwhvqt;
|
||||||
|
|
||||||
static bool s_forceContextMenuOnMouseRelease;
|
static bool s_forceContextMenuOnMouseRelease;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user