Class: QgsLayoutViewRubberBand¶
- class qgis.gui.QgsLayoutViewRubberBand¶
Bases:
PyQt5.QtCore.QObject
QgsLayoutViewRubberBand
is an abstract base class for temporary rubber band items in various shapes, for use withinQgsLayoutView
widgets.New in version 3.0.
QgsLayoutViewRubberBand(view:
QgsLayoutView
= None) Constructor for QgsLayoutViewRubberBand.Methods
Returns the brush used for drawing the rubber band.
Creates a new instance of the
QgsLayoutViewRubberBand
subclass.Called when a rubber band use has finished and the rubber band is no longer required.
Returns the layout associated with the rubber band.
Returns the pen used for drawing the rubber band.
Sets the
brush
used for drawing the rubber band.Sets the
pen
used for drawing the rubber band.Called when a rubber band should be created at the specified starting
position
(in layout coordinate space).Called when a rubber band should be updated to reflect a temporary ending
position
(in layout coordinate space).Calculates an updated bounding box rectangle from a original
start
position and newposition
.Returns the view associated with the rubber band.
Signals
Emitted when the size of the rubber band is changed.
- brush(self) QBrush ¶
Returns the brush used for drawing the rubber band.
See also
See also
- Return type
QBrush
- childEvent(self, QChildEvent)¶
- connectNotify(self, QMetaMethod)¶
- create(self, view: QgsLayoutView) QgsLayoutViewRubberBand ¶
Creates a new instance of the
QgsLayoutViewRubberBand
subclass.- Parameters
view (QgsLayoutView) –
- Return type
- customEvent(self, QEvent)¶
- disconnectNotify(self, QMetaMethod)¶
- finish(self, position: Union[QPointF, QPoint] = QPointF(), modifiers: Union[Qt.KeyboardModifiers, Qt.KeyboardModifier] = Qt.KeyboardModifiers()) QRectF ¶
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.
- Parameters
position (Union[QPointF) –
modifiers (Union[Qt.KeyboardModifiers) –
- Return type
QRectF
- isSignalConnected(self, QMetaMethod) bool ¶
- pen(self) QPen ¶
Returns the pen used for drawing the rubber band.
See also
See also
- Return type
QPen
- receivers(self, PYQT_SIGNAL) int ¶
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setBrush(self, brush: Union[QBrush, QColor, Qt.GlobalColor, QGradient])¶
Sets the
brush
used for drawing the rubber band.See also
See also
- Parameters
brush (Union[QBrush) –
- setPen(self, pen: Union[QPen, QColor, Qt.GlobalColor, QGradient])¶
Sets the
pen
used for drawing the rubber band.See also
See also
- Parameters
pen (Union[QPen) –
- sizeChanged¶
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). [signal]- Parameters
size (str) –
- start(self, position: Union[QPointF, QPoint], modifiers: Union[Qt.KeyboardModifiers, Qt.KeyboardModifier])¶
Called when a rubber band should be created at the specified starting
position
(in layout coordinate space).- Parameters
position (Union[QPointF) –
modifiers (Union[Qt.KeyboardModifiers) –
- timerEvent(self, QTimerEvent)¶
- update(self, position: Union[QPointF, QPoint], modifiers: Union[Qt.KeyboardModifiers, Qt.KeyboardModifier])¶
Called when a rubber band should be updated to reflect a temporary ending
position
(in layout coordinate space).- Parameters
position (Union[QPointF) –
modifiers (Union[Qt.KeyboardModifiers) –
- updateRect(self, start: Union[QPointF, QPoint], position: Union[QPointF, QPoint], constrainSquare: bool, fromCenter: bool) QRectF ¶
Calculates an updated bounding box rectangle from a original
start
position and newposition
. IfconstrainSquare
isTrue
then the bounding box will be forced to a square shape. IffromCenter
isTrue
then the originalstart
position will form the center point of the returned rectangle.- Parameters
start (Union[QPointF) –
position (Union[QPointF) –
constrainSquare (bool) –
fromCenter (bool) –
- Return type
QRectF
- view(self) QgsLayoutView ¶
Returns the view associated with the rubber band.
See also
- Return type