forked from qt-creator/qt-creator
Help: Add context menu to litehtml backend
Change-Id: I051984e360b41d17d32cff80fd1d4017fc81dae6 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -1007,6 +1007,20 @@ QVector<QRect> DocumentContainer::leaveEvent()
|
||||
return {};
|
||||
}
|
||||
|
||||
QUrl DocumentContainer::linkAt(const QPoint &documentPos, const QPoint &viewportPos)
|
||||
{
|
||||
if (!m_document)
|
||||
return {};
|
||||
const litehtml::element::ptr element = m_document->root()->get_element_by_point(documentPos.x(),
|
||||
documentPos.y(),
|
||||
viewportPos.x(),
|
||||
viewportPos.y());
|
||||
const char *href = element->get_attr("href");
|
||||
if (href)
|
||||
return resolveUrl(QString::fromUtf8(href), m_baseUrl);
|
||||
return {};
|
||||
}
|
||||
|
||||
QString DocumentContainer::caption() const
|
||||
{
|
||||
return m_caption;
|
||||
|
||||
Reference in New Issue
Block a user