16#ifndef QGSLAYOUTVIEWRUBBERBAND_H
17#define QGSLAYOUTVIEWRUBBERBAND_H
26class QGraphicsRectItem;
27class QGraphicsEllipseItem;
28class QGraphicsPolygonItem;
45 sipType = sipType_QgsLayoutViewMouseEvent;
69 virtual void start( QPointF position, Qt::KeyboardModifiers modifiers ) = 0;
75 virtual void update( QPointF position, Qt::KeyboardModifiers modifiers ) = 0;
82 virtual QRectF
finish( QPointF position = QPointF(), Qt::KeyboardModifiers modifiers = Qt::KeyboardModifiers() ) = 0;
101 QBrush brush()
const;
108 void setBrush(
const QBrush &brush );
122 void setPen(
const QPen &pen );
142 QRectF updateRect( QPointF start, QPointF position,
bool constrainSquare,
bool fromCenter );
148 QBrush mBrush = Qt::NoBrush;
149 QPen mPen = QPen( QBrush( QColor( 227, 22, 22, 200 ) ), 0 );
173 void start( QPointF position, Qt::KeyboardModifiers modifiers )
override;
174 void update( QPointF position, Qt::KeyboardModifiers modifiers )
override;
175 QRectF finish( QPointF position = QPointF(), Qt::KeyboardModifiers modifiers = Qt::KeyboardModifiers() )
override;
180 QGraphicsRectItem *mRubberBandItem =
nullptr;
183 QPointF mRubberBandStartPos;
206 void start( QPointF position, Qt::KeyboardModifiers modifiers )
override;
207 void update( QPointF position, Qt::KeyboardModifiers modifiers )
override;
208 QRectF finish( QPointF position = QPointF(), Qt::KeyboardModifiers modifiers = Qt::KeyboardModifiers() )
override;
213 QGraphicsEllipseItem *mRubberBandItem =
nullptr;
216 QPointF mRubberBandStartPos;
239 void start( QPointF position, Qt::KeyboardModifiers modifiers )
override;
240 void update( QPointF position, Qt::KeyboardModifiers modifiers )
override;
241 QRectF finish( QPointF position = QPointF(), Qt::KeyboardModifiers modifiers = Qt::KeyboardModifiers() )
override;
246 QGraphicsPolygonItem *mRubberBandItem =
nullptr;
249 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)