QgsPlotRubberBand is an abstract base class for temporary rubber band items in various shapes, for use within QgsPlotCanvas widgets.
More...
#include <qgsplotrubberband.h>
|
| QgsPlotRubberBand (QgsPlotCanvas *canvas=nullptr) |
| Constructor for QgsPlotRubberBand. More...
|
|
| ~QgsPlotRubberBand () override=default |
|
QBrush | brush () const |
| Returns the brush used for drawing the rubber band. More...
|
|
QgsPlotCanvas * | canvas () const |
| Returns the canvas associated with the rubber band. 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 canvas 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 canvas coordinate space). 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...
|
|
QgsPlotRubberBand is an abstract base class for temporary rubber band items in various shapes, for use within QgsPlotCanvas widgets.
- Since
- QGIS 3.26
Definition at line 38 of file qgsplotrubberband.h.
◆ QgsPlotRubberBand()
QgsPlotRubberBand::QgsPlotRubberBand |
( |
QgsPlotCanvas * |
canvas = nullptr | ) |
|
◆ ~QgsPlotRubberBand()
QgsPlotRubberBand::~QgsPlotRubberBand |
( |
| ) |
|
|
overridedefault |
◆ brush()
QBrush QgsPlotRubberBand::brush |
( |
| ) |
const |
◆ canvas()
◆ finish()
virtual QRectF QgsPlotRubberBand::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 QgsPlotRectangularRubberBand.
◆ pen()
QPen QgsPlotRubberBand::pen |
( |
| ) |
const |
◆ setBrush()
void QgsPlotRubberBand::setBrush |
( |
const QBrush & |
brush | ) |
|
◆ setPen()
void QgsPlotRubberBand::setPen |
( |
const QPen & |
pen | ) |
|
◆ start()
virtual void QgsPlotRubberBand::start |
( |
QPointF |
position, |
|
|
Qt::KeyboardModifiers |
modifiers |
|
) |
| |
|
pure virtual |
Called when a rubber band should be created at the specified starting position (in canvas coordinate space).
Implemented in QgsPlotRectangularRubberBand.
◆ update()
virtual void QgsPlotRubberBand::update |
( |
QPointF |
position, |
|
|
Qt::KeyboardModifiers |
modifiers |
|
) |
| |
|
pure virtual |
Called when a rubber band should be updated to reflect a temporary ending position (in canvas coordinate space).
Implemented in QgsPlotRectangularRubberBand.
◆ updateRect()
QRectF QgsPlotRubberBand::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 36 of file qgsplotrubberband.cpp.
The documentation for this class was generated from the following files: