16#ifndef QGSLAYOUTVIEWRUBBERBAND_H
17#define QGSLAYOUTVIEWRUBBERBAND_H
26class QGraphicsRectItem;
27class QGraphicsEllipseItem;
28class QGraphicsPolygonItem;
44 sipType = sipType_QgsLayoutViewMouseEvent;
68 virtual void start( QPointF position, Qt::KeyboardModifiers modifiers ) = 0;
74 virtual void update( QPointF position, Qt::KeyboardModifiers modifiers ) = 0;
81 virtual QRectF
finish( QPointF position = QPointF(), Qt::KeyboardModifiers modifiers = Qt::KeyboardModifiers() ) = 0;
100 QBrush brush()
const;
107 void setBrush(
const QBrush &brush );
121 void setPen(
const QPen &pen );
141 QRectF updateRect( QPointF start, QPointF position,
bool constrainSquare,
bool fromCenter );
147 QBrush mBrush = Qt::NoBrush;
148 QPen mPen = QPen( QBrush( QColor( 227, 22, 22, 200 ) ), 0 );
171 void start( QPointF position, Qt::KeyboardModifiers modifiers )
override;
172 void update( QPointF position, Qt::KeyboardModifiers modifiers )
override;
173 QRectF finish( QPointF position = QPointF(), Qt::KeyboardModifiers modifiers = Qt::KeyboardModifiers() )
override;
178 QGraphicsRectItem *mRubberBandItem =
nullptr;
181 QPointF mRubberBandStartPos;
203 void start( QPointF position, Qt::KeyboardModifiers modifiers )
override;
204 void update( QPointF position, Qt::KeyboardModifiers modifiers )
override;
205 QRectF finish( QPointF position = QPointF(), Qt::KeyboardModifiers modifiers = Qt::KeyboardModifiers() )
override;
210 QGraphicsEllipseItem *mRubberBandItem =
nullptr;
213 QPointF mRubberBandStartPos;
235 void start( QPointF position, Qt::KeyboardModifiers modifiers )
override;
236 void update( QPointF position, Qt::KeyboardModifiers modifiers )
override;
237 QRectF finish( QPointF position = QPointF(), Qt::KeyboardModifiers modifiers = Qt::KeyboardModifiers() )
override;
242 QGraphicsPolygonItem *mRubberBandItem =
nullptr;
245 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)