diff options
author | Daniel Nicoletti <dantti12@gmail.com> | 2014-04-29 09:25:00 -0300 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-04-30 21:33:17 +0200 |
commit | f9ebbd6c618488f9b671f5504528ced3350754fb (patch) | |
tree | 6a3f3cbc62d8d30865bd39b64f270460a6151cad /src/compositor | |
parent | e7a1e121d9cb92e89e53baba81aceedca24f2b94 (diff) | |
download | qtwayland-f9ebbd6c618488f9b671f5504528ced3350754fb.tar.gz |
Fix QWaylandSurfaceItem to process hover events
setAcceptHoverEvents was set to true but the methods
to handle it werern't implemented
Change-Id: I53719b00eac27b3b903a882fd2aa91fd6a51973e
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Diffstat (limited to 'src/compositor')
-rw-r--r-- | src/compositor/compositor_api/qwaylandsurfaceitem.cpp | 24 | ||||
-rw-r--r-- | src/compositor/compositor_api/qwaylandsurfaceitem.h | 3 |
2 files changed, 27 insertions, 0 deletions
diff --git a/src/compositor/compositor_api/qwaylandsurfaceitem.cpp b/src/compositor/compositor_api/qwaylandsurfaceitem.cpp index 2c2f3cce..561477aa 100644 --- a/src/compositor/compositor_api/qwaylandsurfaceitem.cpp +++ b/src/compositor/compositor_api/qwaylandsurfaceitem.cpp @@ -221,6 +221,30 @@ void QWaylandSurfaceItem::mouseReleaseEvent(QMouseEvent *event) } } +void QWaylandSurfaceItem::hoverEnterEvent(QHoverEvent *event) +{ + if (m_surface) { + QWaylandInputDevice *inputDevice = m_surface->compositor()->defaultInputDevice(); + inputDevice->sendMouseMoveEvent(m_surface, event->pos()); + } +} + +void QWaylandSurfaceItem::hoverMoveEvent(QHoverEvent *event) +{ + if (m_surface) { + QWaylandInputDevice *inputDevice = m_surface->compositor()->defaultInputDevice(); + inputDevice->sendMouseMoveEvent(m_surface, event->pos()); + } +} + +void QWaylandSurfaceItem::hoverLeaveEvent(QHoverEvent *event) +{ + if (m_surface) { + QWaylandInputDevice *inputDevice = m_surface->compositor()->defaultInputDevice(); + inputDevice->sendMouseMoveEvent(m_surface, event->pos()); + } +} + void QWaylandSurfaceItem::wheelEvent(QWheelEvent *event) { if (m_surface) { diff --git a/src/compositor/compositor_api/qwaylandsurfaceitem.h b/src/compositor/compositor_api/qwaylandsurfaceitem.h index b17b892f..5cc3f614 100644 --- a/src/compositor/compositor_api/qwaylandsurfaceitem.h +++ b/src/compositor/compositor_api/qwaylandsurfaceitem.h @@ -97,6 +97,9 @@ protected: void mousePressEvent(QMouseEvent *event); void mouseMoveEvent(QMouseEvent *event); void mouseReleaseEvent(QMouseEvent *event); + void hoverEnterEvent(QHoverEvent *event); + void hoverMoveEvent(QHoverEvent *event); + void hoverLeaveEvent(QHoverEvent *event); void wheelEvent(QWheelEvent *event); void keyPressEvent(QKeyEvent *event); |