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 )
40 mMousePressStartPos =
event->pos();
41 if ( event->modifiers() & Qt::AltModifier )
44 double scaleFactor = 2;
46 QRect viewportRect( 0, 0,
view()->viewport()->width(),
view()->viewport()->height() );
50 QRectF boundsRect = visibleRect.
toRectF();
53 view()->fitInView( boundsRect, Qt::KeepAspectRatio );
72 mRubberBand->update( event->
layoutPoint(),
nullptr );
77 if ( !
mMarqueeZoom || event->button() != Qt::LeftButton )
84 QRectF newBoundsRect = mRubberBand->finish( event->
layoutPoint() );
90 double scaleFactor = 0.5;
92 QRect viewportRect( 0, 0,
view()->viewport()->width(),
view()->viewport()->height() );
96 newBoundsRect = visibleRect.
toRectF();
100 view()->fitInView( newBoundsRect, Qt::KeepAspectRatio );
108 if ( !event->isAutoRepeat() )
111 view()->viewport()->setCursor( ( event->modifiers() & Qt::AltModifier ) ?
121 if ( !event->isAutoRepeat() )
124 view()->viewport()->setCursor( ( event->modifiers() & Qt::AltModifier ) ?
136 mRubberBand->finish();
141 void QgsLayoutViewToolZoom::startMarqueeZoom( QPointF scenePoint )
145 mRubberBandStartPos = scenePoint;
146 mRubberBand->start( scenePoint,
nullptr );