29 mRubberBand->setBrush( QBrush( QColor( 70, 50, 255, 25 ) ) );
30 mRubberBand->setPen( QPen( QBrush( QColor( 70, 50, 255, 100 ) ), 0 ) );
35 if ( event->button() != Qt::LeftButton )
41 mMousePressStartPos =
event->pos();
42 if ( event->modifiers() & Qt::AltModifier )
45 const double scaleFactor = 2;
47 const QRect viewportRect( 0, 0,
view()->viewport()->width(),
view()->viewport()->height() );
51 const QRectF boundsRect = visibleRect.
toRectF();
54 view()->fitInView( boundsRect, Qt::KeepAspectRatio );
71 mRubberBand->update( event->
modelPoint(), Qt::KeyboardModifiers() );
76 if ( !
mMarqueeZoom || event->button() != Qt::LeftButton )
83 QRectF newBoundsRect = mRubberBand->finish( event->
modelPoint() );
89 const double scaleFactor = 0.5;
91 const QRect viewportRect( 0, 0,
view()->viewport()->width(),
view()->viewport()->height() );
95 newBoundsRect = visibleRect.
toRectF();
99 view()->fitInView( newBoundsRect, Qt::KeepAspectRatio );
105 if ( !event->isAutoRepeat() )
108 view()->viewport()->setCursor( ( event->modifiers() & Qt::AltModifier ) ?
118 if ( !event->isAutoRepeat() )
121 view()->viewport()->setCursor( ( event->modifiers() & Qt::AltModifier ) ?
133 mRubberBand->finish();
138 void QgsModelViewToolZoom::startMarqueeZoom( QPointF scenePoint )
142 mRubberBandStartPos = scenePoint;
143 mRubberBand->start( scenePoint, Qt::KeyboardModifiers() );