QGIS API Documentation 3.41.0-Master (45a0abf3bec)
|
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. | |
Public Member Functions | |
QgsLayoutViewRubberBand (QgsLayoutView *view=nullptr) | |
Constructor for QgsLayoutViewRubberBand. | |
~QgsLayoutViewRubberBand () override=default | |
QBrush | brush () const |
Returns the brush used for drawing the rubber band. | |
virtual QgsLayoutViewRubberBand * | create (QgsLayoutView *view) const =0 |
Creates a new instance of the QgsLayoutViewRubberBand subclass. | |
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. | |
QgsLayout * | layout () const |
Returns the layout associated with the rubber band. | |
QPen | pen () const |
Returns the pen used for drawing the rubber band. | |
void | setBrush (const QBrush &brush) |
Sets the brush used for drawing the rubber band. | |
void | setPen (const QPen &pen) |
Sets the pen used for drawing the rubber band. | |
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). | |
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). | |
QgsLayoutView * | view () const |
Returns the view associated with the rubber band. | |
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. | |
QgsLayoutViewRubberBand is an abstract base class for temporary rubber band items in various shapes, for use within QgsLayoutView widgets.
Definition at line 36 of file qgslayoutviewrubberband.h.
QgsLayoutViewRubberBand::QgsLayoutViewRubberBand | ( | QgsLayoutView * | view = nullptr | ) |
Constructor for QgsLayoutViewRubberBand.
Definition at line 26 of file qgslayoutviewrubberband.cpp.
|
overridedefault |
QBrush QgsLayoutViewRubberBand::brush | ( | ) | const |
Returns the brush used for drawing the rubber band.
Definition at line 115 of file qgslayoutviewrubberband.cpp.
|
pure virtual |
Creates a new instance of the QgsLayoutViewRubberBand subclass.
Implemented in QgsLayoutViewRectangularRubberBand, QgsLayoutViewEllipticalRubberBand, and QgsLayoutViewTriangleRubberBand.
|
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 QgsLayoutViewRectangularRubberBand, QgsLayoutViewEllipticalRubberBand, and QgsLayoutViewTriangleRubberBand.
QgsLayout * QgsLayoutViewRubberBand::layout | ( | ) | const |
Returns the layout associated with the rubber band.
Definition at line 37 of file qgslayoutviewrubberband.cpp.
QPen QgsLayoutViewRubberBand::pen | ( | ) | const |
Returns the pen used for drawing the rubber band.
Definition at line 105 of file qgslayoutviewrubberband.cpp.
void QgsLayoutViewRubberBand::setBrush | ( | const QBrush & | brush | ) |
Sets the brush used for drawing the rubber band.
Definition at line 120 of file qgslayoutviewrubberband.cpp.
void QgsLayoutViewRubberBand::setPen | ( | const QPen & | pen | ) |
Sets the pen used for drawing the rubber band.
Definition at line 110 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 QgsLayoutViewRectangularRubberBand, QgsLayoutViewEllipticalRubberBand, and QgsLayoutViewTriangleRubberBand.
|
pure virtual |
Called when a rubber band should be updated to reflect a temporary ending position (in layout coordinate space).
Implemented in QgsLayoutViewRectangularRubberBand, QgsLayoutViewEllipticalRubberBand, and QgsLayoutViewTriangleRubberBand.
|
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 42 of file qgslayoutviewrubberband.cpp.
QgsLayoutView * QgsLayoutViewRubberBand::view | ( | ) | const |
Returns the view associated with the rubber band.
Definition at line 32 of file qgslayoutviewrubberband.cpp.