16#ifndef QGSMODELVIEWRUBBERBAND_H
17#define QGSMODELVIEWRUBBERBAND_H
28class QgsModelGraphicsView;
29class QGraphicsRectItem;
30class QGraphicsEllipseItem;
31class QGraphicsPathItem;
32class QGraphicsPolygonItem;
62 virtual void start( QPointF position, Qt::KeyboardModifiers modifiers ) = 0;
68 virtual void update( QPointF position, Qt::KeyboardModifiers modifiers ) = 0;
75 virtual QRectF
finish( QPointF position = QPointF(), Qt::KeyboardModifiers modifiers = Qt::KeyboardModifiers() ) = 0;
80 QgsModelGraphicsView *
view()
const;
128 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 );
157 void start( QPointF position, Qt::KeyboardModifiers modifiers )
override;
158 void update( QPointF position, Qt::KeyboardModifiers modifiers )
override;
159 QRectF
finish( QPointF position = QPointF(), Qt::KeyboardModifiers modifiers = Qt::KeyboardModifiers() )
override;
163 QGraphicsRectItem *mRubberBandItem =
nullptr;
166 QPointF mRubberBandStartPos;
188 void start( QPointF position, Qt::KeyboardModifiers modifiers )
override;
189 void update( QPointF position, Qt::KeyboardModifiers modifiers )
override;
190 QRectF
finish( QPointF position = QPointF(), Qt::KeyboardModifiers modifiers = Qt::KeyboardModifiers() )
override;
194 QGraphicsPathItem *mRubberBandItem =
nullptr;
197 QPointF mRubberBandStartPos;
void update(QPointF position, Qt::KeyboardModifiers modifiers) override
Called when a rubber band should be updated to reflect a temporary ending position (in model coordina...
QgsModelViewBezierRubberBand * create(QgsModelGraphicsView *view) const override
Creates a new instance of the QgsModelViewRubberBand subclass.
QgsModelViewBezierRubberBand(QgsModelGraphicsView *view=nullptr)
Constructor for QgsModelViewRectangularRubberBand.
QRectF finish(QPointF position=QPointF(), Qt::KeyboardModifiers modifiers=Qt::KeyboardModifiers()) override
Called when a rubber band use has finished and the rubber band is no longer required.
void start(QPointF position, Qt::KeyboardModifiers modifiers) override
Called when a rubber band should be created at the specified starting position (in model coordinate s...
QgsModelViewRectangularRubberBand(QgsModelGraphicsView *view=nullptr)
Constructor for QgsModelViewRectangularRubberBand.
void update(QPointF position, Qt::KeyboardModifiers modifiers) override
Called when a rubber band should be updated to reflect a temporary ending position (in model coordina...
void start(QPointF position, Qt::KeyboardModifiers modifiers) override
Called when a rubber band should be created at the specified starting position (in model coordinate s...
QgsModelViewRectangularRubberBand * create(QgsModelGraphicsView *view) const override
Creates a new instance of the QgsModelViewRubberBand subclass.
QRectF finish(QPointF position=QPointF(), Qt::KeyboardModifiers modifiers=Qt::KeyboardModifiers()) override
Called when a rubber band use has finished and the rubber band is no longer required.
QRectF updateRect(QPointF start, QPointF position, bool constrainSquare, bool fromCenter)
Calculates an updated bounding box rectangle from a original start position and new position.
void setPen(const QPen &pen)
Sets the pen used for drawing the rubber band.
void setBrush(const QBrush &brush)
Sets the brush used for drawing the rubber band.
QgsModelViewRubberBand(QgsModelGraphicsView *view=nullptr)
Constructor for QgsModelViewRubberBand.
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.
QPen pen() const
Returns the pen used for drawing the rubber band.
QgsModelGraphicsView * view() const
Returns the view associated with the rubber band.
virtual QgsModelViewRubberBand * create(QgsModelGraphicsView *view) const =0
Creates a new instance of the QgsModelViewRubberBand subclass.
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...
QBrush brush() const
Returns the brush used for drawing the rubber band.