MCPcopy Index your code
hub / github.com/DreamSourceLab/DSView / gestureEvent

Method gestureEvent

DSView/pv/view/viewport.cpp:1434–1458  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1432}
1433
1434bool Viewport::gestureEvent(QNativeGestureEvent *event)
1435{
1436 static double total_scale = 0;
1437 switch(event->gestureType()) {
1438 case Qt::BeginNativeGesture:
1439 break;
1440 case Qt::EndNativeGesture:
1441 total_scale = 0;
1442 break;
1443 case Qt::ZoomNativeGesture: {
1444 total_scale += event->value() * 2;
1445 if (_view.zoom(total_scale, _view.hover_point().x()))
1446 total_scale = 0;
1447 }
1448 break;
1449 case Qt::SmartZoomNativeGesture:
1450 _view.zoom(-1, _view.hover_point().x());
1451 break;
1452 default:
1453 return QWidget::event(event);
1454 }
1455
1456 measure();
1457 return true;
1458}
1459
1460void Viewport::leaveEvent(QEvent *)
1461{

Callers

nothing calls this directly

Calls 2

valueMethod · 0.45
zoomMethod · 0.45

Tested by

no test coverage detected