Permalink
Browse files

Handle pinch gesture event on Win 7 as mouse wheel event.

  • Loading branch information...
1 parent af5de1b commit 49c2630c393b003a473263001a18e27144744178 @till213 till213 committed with unknown Mar 13, 2011
Showing with 8 additions and 1 deletion.
  1. +8 −1 src/Kernel/src/ScreeniePixmapItem.cpp
@@ -196,7 +196,14 @@ void ScreeniePixmapItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
void ScreeniePixmapItem::wheelEvent(QGraphicsSceneWheelEvent *event)
{
- int value = event->delta() / 12;
+ int value;
+ // On Windows 7 pinch gestures are mapped to wheel events with CTRL pressed,
+ // also refer to: http://msdn.microsoft.com/en-us/library/dd940543%28v=vs.85%29.aspx
+ if (Qt::ControlModifier & event->modifiers()) {
+ value = -event->delta() / 12;
+ } else {
+ value = event->delta() / 12;
+ }
if (isInsidePixmap(event->pos())) {
addDistance(value);
} else {

0 comments on commit 49c2630

Please sign in to comment.