22 #include <QGraphicsItem>
121 for (QGraphicsItem* i : items())
123 i->setVisible(visible);
130 QGraphicsView::mousePressEvent(e);
140 const auto oldAnchor = transformationAnchor();
141 setTransformationAnchor(QGraphicsView::NoAnchor);
144 translate(vector.x(), vector.y());
148 setTransformationAnchor(oldAnchor);
151 QGraphicsView::mouseMoveEvent(e);
159 const auto oldAnchor = transformationAnchor();
160 setTransformationAnchor(QGraphicsView::NoAnchor);
162 float factor = std::pow(
zoomFacor, e->delta() < 0 ? -1 : +1);
163 scale(factor, factor);
166 setTransformationAnchor(oldAnchor);
170 const auto oldAnchor = transformationAnchor();
171 setTransformationAnchor(QGraphicsView::NoAnchor);
176 setTransformationAnchor(oldAnchor);
184 QGraphicsView::wheelEvent(e);