Class: QgsLayoutViewToolAddItem

class qgis.gui.QgsLayoutViewToolAddItem

Bases: QgsLayoutViewTool

Layout view tool for adding items to a layout.

New in version 3.0.

QgsLayoutViewToolAddItem(view: QgsLayoutView) Constructs a QgsLayoutViewToolAddItem for the given layout view.

Methods

activate

childEvent

connectNotify

customEvent

customProperties

Returns any custom properties set for the tool.

deactivate

disconnectNotify

isClickAndDrag

Returns True if a mouse press/release operation which started at startViewPoint and ended at endViewPoint should be considered a “click and drag”.

isSignalConnected

itemMetadataId

Returns the item metadata id for items created by the tool.

layoutMoveEvent

param event

layoutPressEvent

param event

layoutReleaseEvent

param event

receivers

sender

senderSignalIndex

setCustomProperties

Sets custom properties for the tool.

setFlags

Sets the combination of flags that will be used for the tool.

setItemMetadataId

Sets the item metadata metadataId for items created by the tool.

timerEvent

Signals

createdItem

Emitted when an item has been created using the tool.

activate(self)
childEvent(self, QChildEvent)
connectNotify(self, QMetaMethod)
createdItem

Emitted when an item has been created using the tool. [signal]

customEvent(self, QEvent)
customProperties(self) Dict[str, Any]

Returns any custom properties set for the tool.

New in version 3.18.

Return type

Dict[str, Any]

deactivate(self)
disconnectNotify(self, QMetaMethod)
isClickAndDrag(self, startViewPoint: QPoint, endViewPoint: QPoint) bool

Returns True if a mouse press/release operation which started at startViewPoint and ended at endViewPoint should be considered a “click and drag”. If False is returned, the operation should be instead treated as just a click on startViewPoint.

isSignalConnected(self, QMetaMethod) bool
itemMetadataId(self) int

Returns the item metadata id for items created by the tool.

Return type

int

layoutMoveEvent(self, event: QgsLayoutViewMouseEvent)
Parameters

event (QgsLayoutViewMouseEvent) –

layoutPressEvent(self, event: QgsLayoutViewMouseEvent)
Parameters

event (QgsLayoutViewMouseEvent) –

layoutReleaseEvent(self, event: QgsLayoutViewMouseEvent)
Parameters

event (QgsLayoutViewMouseEvent) –

receivers(self, PYQT_SIGNAL) int
sender(self) QObject
senderSignalIndex(self) int
setCustomProperties(self, properties: Dict[str, Any])

Sets custom properties for the tool.

These properties are transient, and are cleared whenever the tool is activated. Callers must ensure that the properties are set only after the tool is activated.

New in version 3.18.

Parameters

properties (Dict[str) –

setFlags(self, flags: Union[QgsLayoutViewTool.Flags, QgsLayoutViewTool.Flag])

Sets the combination of flags that will be used for the tool.

See also

flags()

setItemMetadataId(self, metadataId: int)

Sets the item metadata metadataId for items created by the tool.

The metadataId associates the current tool behavior with a metadata entry from QgsLayoutItemGuiRegistry.

See also

itemMetadataId()

Parameters

metadataId (int) –

timerEvent(self, QTimerEvent)