QgsModelViewRubberBand is an abstract base class for temporary rubber band items in various shapes, for use within QgsModelGraphicsView widgets.
More...
#include <qgsmodelviewrubberband.h>
|
void | sizeChanged (const QString &size) |
| Emitted when the size of the rubber band is changed. More...
|
|
|
| QgsModelViewRubberBand (QgsModelGraphicsView *view=nullptr) |
| Constructor for QgsModelViewRubberBand. More...
|
|
| ~QgsModelViewRubberBand () override=default |
|
QBrush | brush () const |
| Returns the brush used for drawing the rubber band. More...
|
|
virtual QgsModelViewRubberBand * | create (QgsModelGraphicsView *view) const =0 |
| Creates a new instance of the QgsModelViewRubberBand subclass. More...
|
|
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. More...
|
|
QPen | pen () const |
| Returns the pen used for drawing the rubber band. More...
|
|
void | setBrush (const QBrush &brush) |
| Sets the brush used for drawing the rubber band. More...
|
|
void | setPen (const QPen &pen) |
| Sets the pen used for drawing the rubber band. More...
|
|
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 space). More...
|
|
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 coordinate space). More...
|
|
QgsModelGraphicsView * | view () const |
| Returns the view associated with the rubber band. More...
|
|
|
QRectF | updateRect (QPointF start, QPointF position, bool constrainSquare, bool fromCenter) |
| Calculates an updated bounding box rectangle from a original start position and new position. More...
|
|
QgsModelViewRubberBand is an abstract base class for temporary rubber band items in various shapes, for use within QgsModelGraphicsView widgets.
- Since
- QGIS 3.14
Definition at line 38 of file qgsmodelviewrubberband.h.
◆ QgsModelViewRubberBand()
QgsModelViewRubberBand::QgsModelViewRubberBand |
( |
QgsModelGraphicsView * |
view = nullptr | ) |
|
◆ ~QgsModelViewRubberBand()
QgsModelViewRubberBand::~QgsModelViewRubberBand |
( |
| ) |
|
|
overridedefault |
◆ brush()
QBrush QgsModelViewRubberBand::brush |
( |
| ) |
const |
◆ create()
◆ finish()
virtual QRectF QgsModelViewRubberBand::finish |
( |
QPointF |
position = QPointF() , |
|
|
Qt::KeyboardModifiers |
modifiers = Qt::KeyboardModifiers() |
|
) |
| |
|
pure virtual |
Called when a rubber band use has finished and the rubber band is no longer required.
Returns the final bounding box of the rubber band.
Implemented in QgsModelViewRectangularRubberBand.
◆ pen()
QPen QgsModelViewRubberBand::pen |
( |
| ) |
const |
◆ setBrush()
void QgsModelViewRubberBand::setBrush |
( |
const QBrush & |
brush | ) |
|
◆ setPen()
void QgsModelViewRubberBand::setPen |
( |
const QPen & |
pen | ) |
|
◆ sizeChanged
void QgsModelViewRubberBand::sizeChanged |
( |
const QString & |
size | ) |
|
|
signal |
Emitted when the size of the rubber band is changed.
The size argument gives a translated string describing the new rubber band size, with a format which differs per subclass (e.g. rectangles may describe a size using width and height, while circles may describe a size by radius).
◆ start()
virtual void QgsModelViewRubberBand::start |
( |
QPointF |
position, |
|
|
Qt::KeyboardModifiers |
modifiers |
|
) |
| |
|
pure virtual |
◆ update()
virtual void QgsModelViewRubberBand::update |
( |
QPointF |
position, |
|
|
Qt::KeyboardModifiers |
modifiers |
|
) |
| |
|
pure virtual |
◆ updateRect()
QRectF QgsModelViewRubberBand::updateRect |
( |
QPointF |
start, |
|
|
QPointF |
position, |
|
|
bool |
constrainSquare, |
|
|
bool |
fromCenter |
|
) |
| |
|
protected |
Calculates an updated bounding box rectangle from a original start position and new position.
If constrainSquare is true
then the bounding box will be forced to a square shape. If fromCenter is true
then the original start position will form the center point of the returned rectangle.
Definition at line 33 of file qgsmodelviewrubberband.cpp.
◆ view()
QgsModelGraphicsView * QgsModelViewRubberBand::view |
( |
| ) |
const |
The documentation for this class was generated from the following files: