22 #include <QWheelEvent>
42 void MyGraphicsView::wheelEvent(QWheelEvent* event)
44 double scaleFactor = pow(2.0, -event->delta() / 240.0);
45 double factor = matrix().scale(scaleFactor, scaleFactor).mapRect(QRectF(0, 0, 1, 1)).width();
46 if (factor > 0.07 && factor < 100.0)
48 scale(scaleFactor, scaleFactor);
see the online Qt documentation
MyGraphicsView(std::shared_ptr< QGraphicsScene > g, QWidget *parent=nullptr)
Interface for MyGraphicsView.
see the online Qt documentation
Namespace for generic graphical shell for simulators.