QGIS API Documentation
3.20.0-Odense (decaadbb31)
|
QgsLayoutViewRubberBand is an abstract base class for temporary rubber band items in various shapes, for use within QgsLayoutView widgets. More...
#include <qgslayoutviewrubberband.h>
Signals | |
void | sizeChanged (const QString &size) |
Emitted when the size of the rubber band is changed. More... | |
Public Member Functions | |
QgsLayoutViewRubberBand (QgsLayoutView *view=nullptr) | |
Constructor for QgsLayoutViewRubberBand. More... | |
~QgsLayoutViewRubberBand () override=default | |
QBrush | brush () const |
Returns the brush used for drawing the rubber band. More... | |
virtual QgsLayoutViewRubberBand * | create (QgsLayoutView *view) const =0 |
Creates a new instance of the QgsLayoutViewRubberBand 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... | |
QgsLayout * | layout () const |
Returns the layout associated with the rubber band. 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 layout 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 layout coordinate space). More... | |
QgsLayoutView * | view () const |
Returns the view associated with the rubber band. More... | |
Protected Member Functions | |
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... | |
QgsLayoutViewRubberBand is an abstract base class for temporary rubber band items in various shapes, for use within QgsLayoutView widgets.
Definition at line 37 of file qgslayoutviewrubberband.h.
QgsLayoutViewRubberBand::QgsLayoutViewRubberBand | ( | QgsLayoutView * | view = nullptr | ) |
Constructor for QgsLayoutViewRubberBand.
Definition at line 24 of file qgslayoutviewrubberband.cpp.
|
overridedefault |
QBrush QgsLayoutViewRubberBand::brush | ( | ) | const |
Returns the brush used for drawing the rubber band.
Definition at line 113 of file qgslayoutviewrubberband.cpp.
|
pure virtual |
Creates a new instance of the QgsLayoutViewRubberBand subclass.
Implemented in QgsLayoutViewTriangleRubberBand, QgsLayoutViewEllipticalRubberBand, and QgsLayoutViewRectangularRubberBand.
|
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 QgsLayoutViewTriangleRubberBand, QgsLayoutViewEllipticalRubberBand, and QgsLayoutViewRectangularRubberBand.
QgsLayout * QgsLayoutViewRubberBand::layout | ( | ) | const |
Returns the layout associated with the rubber band.
Definition at line 35 of file qgslayoutviewrubberband.cpp.
QPen QgsLayoutViewRubberBand::pen | ( | ) | const |
Returns the pen used for drawing the rubber band.
Definition at line 103 of file qgslayoutviewrubberband.cpp.
void QgsLayoutViewRubberBand::setBrush | ( | const QBrush & | brush | ) |
Sets the brush used for drawing the rubber band.
Definition at line 118 of file qgslayoutviewrubberband.cpp.
void QgsLayoutViewRubberBand::setPen | ( | const QPen & | pen | ) |
Sets the pen used for drawing the rubber band.
Definition at line 108 of file qgslayoutviewrubberband.cpp.
|
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).
|
pure virtual |
Called when a rubber band should be created at the specified starting position (in layout coordinate space).
Implemented in QgsLayoutViewTriangleRubberBand, QgsLayoutViewEllipticalRubberBand, and QgsLayoutViewRectangularRubberBand.
|
pure virtual |
Called when a rubber band should be updated to reflect a temporary ending position (in layout coordinate space).
Implemented in QgsLayoutViewTriangleRubberBand, QgsLayoutViewEllipticalRubberBand, and QgsLayoutViewRectangularRubberBand.
|
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 40 of file qgslayoutviewrubberband.cpp.
QgsLayoutView * QgsLayoutViewRubberBand::view | ( | ) | const |
Returns the view associated with the rubber band.
Definition at line 30 of file qgslayoutviewrubberband.cpp.