Skip to content

Commit

Permalink
Wheel event support in WaylandSurfaceItem
Browse files Browse the repository at this point in the history
Change-Id: Ib3988b09ccb2eea998108cbb41d4edc25ce123bb
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
  • Loading branch information
Laszlo Agocs authored and Jørgen Lind committed Aug 17, 2012
1 parent cb62bee commit 313bb66
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/compositor/compositor_api/waylandsurfaceitem.cpp
Expand Up @@ -212,6 +212,14 @@ void WaylandSurfaceItem::mouseReleaseEvent(QMouseEvent *event)
}
}

void WaylandSurfaceItem::wheelEvent(QWheelEvent *event)
{
if (m_surface) {
WaylandInputDevice *inputDevice = m_surface->compositor()->defaultInputDevice();
inputDevice->sendMouseWheelEvent(event->orientation(), event->delta());
}
}

void WaylandSurfaceItem::keyPressEvent(QKeyEvent *event)
{
if (m_surface && hasFocus()) {
Expand Down
1 change: 1 addition & 0 deletions src/compositor/compositor_api/waylandsurfaceitem.h
Expand Up @@ -93,6 +93,7 @@ class Q_COMPOSITOR_EXPORT WaylandSurfaceItem : public QQuickItem
void mousePressEvent(QMouseEvent *event);
void mouseMoveEvent(QMouseEvent *event);
void mouseReleaseEvent(QMouseEvent *event);
void wheelEvent(QWheelEvent *event);

void keyPressEvent(QKeyEvent *event);
void keyReleaseEvent(QKeyEvent *event);
Expand Down

0 comments on commit 313bb66

Please sign in to comment.