MCPcopy Create free account
hub / github.com/comaps/comaps / wheelEvent

Method wheelEvent

qt/qt_common/map_widget.cpp:512–525  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

510}
511
512void MapWidget::wheelEvent(QWheelEvent * e)
513{
514 if (m_screenshotMode)
515 return;
516
517 QOpenGLWidget::wheelEvent(e);
518
519 QPointF const pos = e->position();
520
521 double const factor = e->angleDelta().y() / 3.0 / 360.0;
522 // https://doc-snapshots.qt.io/qt6-dev/qwheelevent.html#angleDelta, angleDelta() returns in eighths of a degree.
523 /// @todo Here you can tune the speed of zooming.
524 m_framework.Scale(exp(factor), m2::PointD(L2D(pos.x()), L2D(pos.y())), false);
525}
526} // namespace qt::common

Callers

nothing calls this directly

Calls 4

positionMethod · 0.45
yMethod · 0.45
ScaleMethod · 0.45
xMethod · 0.45

Tested by

no test coverage detected