saadmd
19th September 2011, 03:18
Hi all
I am quite new to QT and I want to get the mouse position when clicked on a web page. As far as I know there is a mousePressEvent function that can be used through the QWebView widgent. What I have done so fare is as follow
// I have set a page to the webview
webView->setUrl(QUrl::fromLocalFile(fileName));
QWebFrame* pFrame = webView->page()->mainFrame();
QWebElement document = pFrame->documentElement();
webView->mousePressEvent(QMouseEvent *e);
qDebug()<<(e->pos());
Obviously this does not work. So can anyone help me please how to make this work?
Thanks in advance
I am quite new to QT and I want to get the mouse position when clicked on a web page. As far as I know there is a mousePressEvent function that can be used through the QWebView widgent. What I have done so fare is as follow
// I have set a page to the webview
webView->setUrl(QUrl::fromLocalFile(fileName));
QWebFrame* pFrame = webView->page()->mainFrame();
QWebElement document = pFrame->documentElement();
webView->mousePressEvent(QMouseEvent *e);
qDebug()<<(e->pos());
Obviously this does not work. So can anyone help me please how to make this work?
Thanks in advance