16#ifndef QGSLAYOUTVIEWRUBBERBAND_H
17#define QGSLAYOUTVIEWRUBBERBAND_H
26class QGraphicsRectItem;
27class QGraphicsEllipseItem;
28class QGraphicsPolygonItem;
43 sipType = sipType_QgsLayoutViewMouseEvent;
66 virtual void start( QPointF position, Qt::KeyboardModifiers modifiers ) = 0;
72 virtual void update( QPointF position, Qt::KeyboardModifiers modifiers ) = 0;
79 virtual QRectF
finish( QPointF position = QPointF(), Qt::KeyboardModifiers modifiers = Qt::KeyboardModifiers() ) = 0;
105 void setBrush(
const QBrush &brush );
119 void setPen(
const QPen &pen );
138 QRectF updateRect( QPointF start, QPointF position,
bool constrainSquare,
bool fromCenter );
143 QBrush mBrush = Qt::NoBrush;
144 QPen mPen = QPen( QBrush( QColor( 227, 22, 22, 200 ) ), 0 );
165 void start( QPointF position, Qt::KeyboardModifiers modifiers )
override;
166 void update( QPointF position, Qt::KeyboardModifiers modifiers )
override;
167 QRectF finish( QPointF position = QPointF(), Qt::KeyboardModifiers modifiers = Qt::KeyboardModifiers() )
override;
171 QGraphicsRectItem *mRubberBandItem =
nullptr;
174 QPointF mRubberBandStartPos;
194 void start( QPointF position, Qt::KeyboardModifiers modifiers )
override;
195 void update( QPointF position, Qt::KeyboardModifiers modifiers )
override;
196 QRectF finish( QPointF position = QPointF(), Qt::KeyboardModifiers modifiers = Qt::KeyboardModifiers() )
override;
200 QGraphicsEllipseItem *mRubberBandItem =
nullptr;
203 QPointF mRubberBandStartPos;
223 void start( QPointF position, Qt::KeyboardModifiers modifiers )
override;
224 void update( QPointF position, Qt::KeyboardModifiers modifiers )
override;
225 QRectF finish( QPointF position = QPointF(), Qt::KeyboardModifiers modifiers = Qt::KeyboardModifiers() )
override;
229 QGraphicsPolygonItem *mRubberBandItem =
nullptr;
232 QPointF mRubberBandStartPos;
QgsLayoutViewEllipseRubberBand is elliptical rubber band for use within QgsLayoutView widgets.
A QgsLayoutViewMouseEvent is the result of a user interaction with the mouse on a QgsLayoutView.
QgsLayoutViewRectangularRubberBand is rectangular rubber band for use within QgsLayoutView widgets.
QgsLayoutViewRubberBand is an abstract base class for temporary rubber band items in various shapes,...
~QgsLayoutViewRubberBand() override=default
virtual QRectF finish(QPointF position=QPointF(), Qt::KeyboardModifiers modifiers=Qt::KeyboardModifiers())=0
Called when a rubber band use has finished and the rubber band is no longer required.
void sizeChanged(const QString &size)
Emitted when the size of the rubber band is changed.
virtual void start(QPointF position, Qt::KeyboardModifiers modifiers)=0
Called when a rubber band should be created at the specified starting position (in layout coordinate ...
virtual QgsLayoutViewRubberBand * create(QgsLayoutView *view) const =0
Creates a new instance of the QgsLayoutViewRubberBand subclass.
virtual void update(QPointF position, Qt::KeyboardModifiers modifiers)=0
Called when a rubber band should be updated to reflect a temporary ending position (in layout coordin...
QgsLayoutViewTriangleRubberBand is triangular rubber band for use within QgsLayoutView widgets.
A graphical widget to display and interact with QgsLayouts.
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)