Skip to content
Snippets Groups Projects
Commit dd271001 authored by Paul Lemire's avatar Paul Lemire Committed by Sean Harmer
Browse files

MouseEventFilter: handle HoverMove events


When using Scene3D, there are no MouseMove events. Instead there are HoverMove
events being generated. For that reason we intercept these to allow the
MouseHandlers to receive positionChanged events when used with Scene3D

Change-Id: I638a86a1b574e3f99163e0b1b13cb47c83acdc1e
Reviewed-by: default avatarSean Harmer <sean.harmer@kdab.com>
parent 1b65fbd8
No related merge requests found
...@@ -64,6 +64,14 @@ bool MouseEventFilter::eventFilter(QObject *obj, QEvent *e) ...@@ -64,6 +64,14 @@ bool MouseEventFilter::eventFilter(QObject *obj, QEvent *e)
{ {
Q_UNUSED(obj); Q_UNUSED(obj);
switch (e->type()) { switch (e->type()) {
// When dealing with QtQuick events, there are nove MouseMove events
// only hover events which are transmitted if hoverEnabled was set to true on the Scene3D
case QEvent::HoverMove:
{
const QHoverEvent *event = static_cast<QHoverEvent *>(e);
m_inputHandler->appendMouseEvent(QMouseEvent(QEvent::MouseMove, event->posF(), Qt::NoButton, Qt::NoButton, event->modifiers()));
break;
}
case QEvent::MouseButtonPress: case QEvent::MouseButtonPress:
case QEvent::MouseButtonRelease: case QEvent::MouseButtonRelease:
case QEvent::MouseMove: case QEvent::MouseMove:
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment