PDA

View Full Version : How To Use mousePressEvent to get the click position on QWebFrame or QWebView ?



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

saadmd
19th September 2011, 05:39
well, Since no one has replayed yet. I want to declare my question?
I noticed I can use eventFilter function to filter events
my question is:
does this function work with QWebFrame ??