mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-11 01:22:10 +01:00
Added function to return focused element on page.
WebView/WebPage::activeElement
This commit is contained in:
parent
a73ad89f9e
commit
90c285c1ac
|
@ -186,6 +186,12 @@ bool WebPage::containsRejectedCerts(const QList<QSslCertificate> &certs)
|
|||
return matches == certs.count();
|
||||
}
|
||||
|
||||
QWebElement WebPage::activeElement() const
|
||||
{
|
||||
QRect activeRect = inputMethodQuery(Qt::ImMicroFocus).toRect();
|
||||
return mainFrame()->hitTestContent(activeRect.center()).element();
|
||||
}
|
||||
|
||||
bool WebPage::isRunningLoop()
|
||||
{
|
||||
return m_runningLoop;
|
||||
|
|
|
@ -78,6 +78,7 @@ public:
|
|||
void addRejectedCerts(const QList<QSslCertificate> &certs);
|
||||
bool containsRejectedCerts(const QList<QSslCertificate> &certs);
|
||||
|
||||
QWebElement activeElement() const;
|
||||
QString userAgentForUrl(const QUrl &url) const;
|
||||
|
||||
static bool isPointerSafeToUse(WebPage* page);
|
||||
|
|
|
@ -225,6 +225,12 @@ bool WebView::hasRss() const
|
|||
return m_hasRss;
|
||||
}
|
||||
|
||||
QWebElement WebView::activeElement() const
|
||||
{
|
||||
QRect activeRect = inputMethodQuery(Qt::ImMicroFocus).toRect();
|
||||
return page()->mainFrame()->hitTestContent(activeRect.center()).element();
|
||||
}
|
||||
|
||||
bool WebView::isUrlValid(const QUrl &url)
|
||||
{
|
||||
const QString &urlScheme = url.scheme();
|
||||
|
|
|
@ -49,6 +49,7 @@ public:
|
|||
void fakeLoadingProgress(int progress);
|
||||
|
||||
bool hasRss() const;
|
||||
QWebElement activeElement() const;
|
||||
|
||||
void addNotification(QWidget* notif);
|
||||
bool eventFilter(QObject* obj, QEvent* event);
|
||||
|
|
Loading…
Reference in New Issue
Block a user