Hi all,
I try to find the QWebElement at the clickposition in a QWebView
(Qt-5.0) witch the follwing code snippet:
void WebView::mousePressEvent(QMouseEvent *e)
{
QWebFrame* frame = page()->frameAt(e->pos());
QWebHitTestResult hit = frame->hitTestContent(e->pos());
qDebug() << Q_FUNC_INFO << e->pos()
<< hit.element().toOuterXml()
;
QWebView::mousePressEvent(e);
}
WebView is a direct subclass of QWebView.
The result is not what I expected; maybe my expection is wrong :-)
- if I click right beside the element (e.g. <p>), I get the "correct"
element
- if I click on the element, I get an empty QWebElement
- if I click left beside the element, I get the whole webpage.
What am I doing wrong?
--
Wilhelm
_______________________________________________
Interest mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/interest