[Solved] QT 4.8 Pass mousemove events to QGraphicsWebView in Default HTML 5 Application
-
wrote on 26 Dec 2012, 19:46 last edited by
I am creating an html 5 application that requires tracking of the mouse even if the mouse buttons are not pressed down. I have done quite of bit of searching and found setMouseTracking. Nothing I have tried has worked. This is what I have tried, with no luck.
in main.cpp
@
viewer.setMouseTracking(true);
@in html5applicationviewer inside Html5ApplicationViewerPrivate::Html5ApplicationViewerPrivate(QWidget *parent)
@parent->setMouseTracking(true);@I find it hard to believe that it's more complicated than just setting a flag somewhere. Please help! I have not changed anything else, so it should be the same as a freshly generated HTML 5 application project
-
wrote on 26 Dec 2012, 19:59 last edited by
Hi!
Take a look at "mouseMoveEvent":http://doc.qt.digia.com/qt/qgraphicswebview.html#mouseMoveEvent
Reimplement it, if you need to create any actions on mouse move.
-
wrote on 26 Dec 2012, 20:00 last edited by
I did look at that. Could you point me in the right direction on how to get that event information to pass down to the javascript event "onmousemove"?
-
wrote on 26 Dec 2012, 20:28 last edited by
It does that automatically.
So you shouldn't have any problems.I made a quick sample "here":http://wikisend.com/download/358834/JS_onMouseMove.zip
EDIT:
I see your problem after creating HTML5 app. I used default Qt Application. -
wrote on 26 Dec 2012, 20:38 last edited by
Found the solution.
@m_webView->setAcceptHoverEvents(true);@
-
wrote on 26 Dec 2012, 20:57 last edited by
Thank you Thank you Thank you!!!!
You are a gentlemen and a scholar. m_webView->setAcceptHoverEvents(true); was it
1/6