Class: QgsLayoutViewToolAddItem¶
- class qgis.gui.QgsLayoutViewToolAddItem¶
Bases:
QgsLayoutViewTool
Layout view tool for adding items to a layout.
QgsLayoutViewToolAddItem(view:
QgsLayoutView
) Constructs aQgsLayoutViewToolAddItem
for the given layoutview
.Methods
Returns any custom properties set for the tool.
Returns
True
if a mouse press/release operation which started atstartViewPoint
and ended atendViewPoint
should be considered a "click and drag".Returns the item metadata id for items created by the tool.
- param event:
- param event:
- param event:
Sets custom
properties
for the tool.Sets the combination of
flags
that will be used for the tool.Sets the item metadata
metadataId
for items created by the tool.Signals
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
- activate(self)¶
- childEvent(self, QChildEvent)¶
- connectNotify(self, QMetaMethod)¶
- createdItem¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Parameters:
name (str = ...) –
revision (int = ...) –
arguments (Sequence = ...) –
- Return type:
PYQT_SIGNAL
- customEvent(self, QEvent)¶
- customProperties(self) Dict[str, Any] ¶
Returns any custom properties set for the tool.
See also
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 atstartViewPoint
and ended atendViewPoint
should be considered a “click and drag”. IfFalse
is returned, the operation should be instead treated as just a click onstartViewPoint
.
- isSignalConnected(self, QMetaMethod) bool ¶
- itemMetadataId(self) int ¶
Returns the item metadata id for items created by the tool.
See also
- 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.
See also
New in version 3.18.
- Parameters:
properties (Dict[str) –
- setFlags(self, flags: 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 fromQgsLayoutItemGuiRegistry
.See also
- Parameters:
metadataId (int) –
- timerEvent(self, QTimerEvent)¶