C++ (Qt)void My_GraphicsView::wheelEvent( QWheelEvent* qevent ){ if( qevent->buttons() != Qt::MidButton ) { if( !(qevent->modifiers() & Qt::ControlModifier) ) { if( qevent->delta() > 0 ) { qreal factor = transform().scale( dCoeff, dCoeff ).mapRect(QRectF(0, 0, 1, 1)).width(); if( factor < 0.07 || factor > 100 ) return; scale( dCoeff, dCoeff ); } else { qreal factor = transform().scale( dCoeff, dCoeff ).mapRect(QRectF(0, 0, 1, 1)).width(); if( factor < 0.07 || factor > 100 ) return; scale( dCoeff, dCoeff ); } } else { QAbstractScrollArea::wheelEvent( qevent ); }}
C++ (Qt)void QGraphicsView::setSceneRect ( qreal x, qreal y, qreal w, qreal h )void QGraphicsScene::setSceneRect ( qreal x, qreal y, qreal w, qreal h )
C++ (Qt)int n = ....;QGraphicsView::setSceneRect( 0.0, 0.0, sceneRect().width()*n, sceneRect().height()*n );
C++ (Qt)QGraphicsView::setSceneRect(-sceneRect().width()*n, sceneRect().height()*n, sceneRect().width()*n, sceneRect().height()*n );
C++ (Qt)QGraphicsView::setSceneRect(INT_MIN, INT_MIN, INT_MAX, INT_MAX);