28 mRubberBand->setBrush( QBrush( QColor( 70, 50, 255, 25 ) ) );
29 mRubberBand->setPen( QPen( QBrush( QColor( 70, 50, 255, 100 ) ), 0 ) );
34 if ( event->button() != Qt::LeftButton )
39 mRubberBand->finish();
45 mMousePressStartPos =
event->pos();
46 if ( event->modifiers() & Qt::AltModifier )
49 const double scaleFactor = 2;
51 const QRect viewportRect( 0, 0,
view()->viewport()->width(),
view()->viewport()->height() );
55 const QRectF boundsRect = visibleRect.
toRectF();
58 view()->fitInView( boundsRect, Qt::KeepAspectRatio );
77 mRubberBand->update( event->
layoutPoint(), Qt::KeyboardModifiers() );
82 if ( !
mMarqueeZoom || event->button() != Qt::LeftButton )
89 QRectF newBoundsRect = mRubberBand->finish( event->
layoutPoint() );
95 const double scaleFactor = 0.5;
97 const QRect viewportRect( 0, 0,
view()->viewport()->width(),
view()->viewport()->height() );
101 newBoundsRect = visibleRect.
toRectF();
105 view()->fitInView( newBoundsRect, Qt::KeepAspectRatio );
113 if ( !event->isAutoRepeat() )
116 view()->viewport()->setCursor( ( event->modifiers() & Qt::AltModifier ) ?
126 if ( !event->isAutoRepeat() )
129 view()->viewport()->setCursor( ( event->modifiers() & Qt::AltModifier ) ?
141 mRubberBand->finish();
146 void QgsLayoutViewToolZoom::startMarqueeZoom( QPointF scenePoint )
150 mRubberBandStartPos = scenePoint;
151 mRubberBand->start( scenePoint, Qt::KeyboardModifiers() );