16 #ifndef QGSMODELVIEWRUBBERBAND_H
17 #define QGSMODELVIEWRUBBERBAND_H
27 class QgsModelGraphicsView;
28 class QGraphicsRectItem;
29 class QGraphicsEllipseItem;
30 class QGraphicsPolygonItem;
61 virtual void start( QPointF position, Qt::KeyboardModifiers modifiers ) = 0;
67 virtual void update( QPointF position, Qt::KeyboardModifiers modifiers ) = 0;
74 virtual QRectF
finish( QPointF position = QPointF(), Qt::KeyboardModifiers modifiers = Qt::KeyboardModifiers() ) = 0;
79 QgsModelGraphicsView *view()
const;
93 void setBrush(
const QBrush &brush );
107 void setPen(
const QPen &pen );
127 QRectF updateRect( QPointF start, QPointF position,
bool constrainSquare,
bool fromCenter );
131 QgsModelGraphicsView *mView =
nullptr;
133 QBrush mBrush = Qt::NoBrush;
134 QPen mPen = QPen( QBrush( QColor( 227, 22, 22, 200 ) ), 0 );
158 void start( QPointF position, Qt::KeyboardModifiers modifiers )
override;
159 void update( QPointF position, Qt::KeyboardModifiers modifiers )
override;
160 QRectF finish( QPointF position = QPointF(), Qt::KeyboardModifiers modifiers = Qt::KeyboardModifiers() )
override;
165 QGraphicsRectItem *mRubberBandItem =
nullptr;
168 QPointF mRubberBandStartPos;
QgsModelViewRectangularRubberBand is rectangular rubber band for use within QgsModelGraphicsView widg...
QgsModelViewRubberBand is an abstract base class for temporary rubber band items in various shapes,...
virtual QgsModelViewRubberBand * create(QgsModelGraphicsView *view) const =0
Creates a new instance of the QgsModelViewRubberBand 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 model coordina...
~QgsModelViewRubberBand() 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 model coordinate s...