16#ifndef QGSMODELVIEWRUBBERBAND_H
17#define QGSMODELVIEWRUBBERBAND_H
28class QgsModelGraphicsView;
29class QGraphicsRectItem;
30class QGraphicsEllipseItem;
31class QGraphicsPathItem;
32class 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;
126 QRectF
updateRect( QPointF
start, QPointF position,
bool constrainSquare,
bool fromCenter );
129 QgsModelGraphicsView *mView =
nullptr;
131 QBrush mBrush = Qt::NoBrush;
132 QPen mPen = QPen( QBrush( QColor( 227, 22, 22, 200 ) ), 0 );
154 void start( QPointF position, Qt::KeyboardModifiers modifiers )
override;
155 void update( QPointF position, Qt::KeyboardModifiers modifiers )
override;
156 QRectF
finish( QPointF position = QPointF(), Qt::KeyboardModifiers modifiers = Qt::KeyboardModifiers() )
override;
160 QGraphicsRectItem *mRubberBandItem =
nullptr;
163 QPointF mRubberBandStartPos;
184 void start( QPointF position, Qt::KeyboardModifiers modifiers )
override;
185 void update( QPointF position, Qt::KeyboardModifiers modifiers )
override;
186 QRectF
finish( QPointF position = QPointF(), Qt::KeyboardModifiers modifiers = Qt::KeyboardModifiers() )
override;
190 QGraphicsPathItem *mRubberBandItem =
nullptr;
193 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.