mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 18:56:34 +01:00
Added more methods to QmlWebHitTest
This commit is contained in:
parent
236732d95b
commit
c8a1bad5af
@ -98,10 +98,77 @@ bool QmlWebHitTestResult::mediaMuted() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Gets the tagName of the element on which the contex menu is requested.
|
* @brief Gets the tagName of the element on which the context menu is requested.
|
||||||
* @return String representing the tag name of the element
|
* @return String representing the tag name of the element
|
||||||
*/
|
*/
|
||||||
QString QmlWebHitTestResult::tagName() const
|
QString QmlWebHitTestResult::tagName() const
|
||||||
{
|
{
|
||||||
return m_webHitTestResult.tagName();
|
return m_webHitTestResult.tagName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Gets the base url on which the context menu is requested.
|
||||||
|
* @return String representing the base url
|
||||||
|
*/
|
||||||
|
QString QmlWebHitTestResult::baseUrl() const
|
||||||
|
{
|
||||||
|
QUrl base = m_webHitTestResult.baseUrl();
|
||||||
|
return QString::fromUtf8(base.toEncoded());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Gets the link title on which the context menu is requested.
|
||||||
|
* @return String representing the link title
|
||||||
|
*/
|
||||||
|
QString QmlWebHitTestResult::linkTitle() const
|
||||||
|
{
|
||||||
|
return m_webHitTestResult.linkTitle();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Gets the link url on which the context menu is requested.
|
||||||
|
* @return String representing the link url
|
||||||
|
*/
|
||||||
|
QString QmlWebHitTestResult::linkUrl() const
|
||||||
|
{
|
||||||
|
QUrl link = m_webHitTestResult.linkUrl();
|
||||||
|
return QString::fromUtf8(link.toEncoded());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Gets the url of image on which the context menu is requested.
|
||||||
|
* @return String representing the image url
|
||||||
|
*/
|
||||||
|
QString QmlWebHitTestResult::imageUrl() const
|
||||||
|
{
|
||||||
|
QUrl image = m_webHitTestResult.imageUrl();
|
||||||
|
return QString::fromUtf8(image.toEncoded());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Gets the url of media on which the context menu is requested.
|
||||||
|
* @return String representing the media url
|
||||||
|
*/
|
||||||
|
QString QmlWebHitTestResult::mediaUrl() const
|
||||||
|
{
|
||||||
|
QUrl media = m_webHitTestResult.mediaUrl();
|
||||||
|
return QString::fromUtf8(media.toEncoded());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Gets the position at which the context menu is requested.
|
||||||
|
* @return QPoint representing the position
|
||||||
|
*/
|
||||||
|
QPoint QmlWebHitTestResult::pos() const
|
||||||
|
{
|
||||||
|
return m_webHitTestResult.pos();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Gets the viewport position at which the context menu is requested.
|
||||||
|
* @return QPoint representing the viewport position
|
||||||
|
*/
|
||||||
|
QPointF QmlWebHitTestResult::viewportPos() const
|
||||||
|
{
|
||||||
|
return m_webHitTestResult.viewportPos();
|
||||||
|
}
|
||||||
|
@ -37,6 +37,13 @@ public:
|
|||||||
Q_INVOKABLE bool mediaPaused() const;
|
Q_INVOKABLE bool mediaPaused() const;
|
||||||
Q_INVOKABLE bool mediaMuted() const;
|
Q_INVOKABLE bool mediaMuted() const;
|
||||||
Q_INVOKABLE QString tagName() const;
|
Q_INVOKABLE QString tagName() const;
|
||||||
|
Q_INVOKABLE QString baseUrl() const;
|
||||||
|
Q_INVOKABLE QString linkTitle() const;
|
||||||
|
Q_INVOKABLE QString linkUrl() const;
|
||||||
|
Q_INVOKABLE QString imageUrl() const;
|
||||||
|
Q_INVOKABLE QString mediaUrl() const;
|
||||||
|
Q_INVOKABLE QPoint pos() const;
|
||||||
|
Q_INVOKABLE QPointF viewportPos() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
WebHitTestResult m_webHitTestResult;
|
WebHitTestResult m_webHitTestResult;
|
||||||
|
Loading…
Reference in New Issue
Block a user