Class: QgsLayoutCustomDropHandler¶
- class qgis.gui.QgsLayoutCustomDropHandler(parent: QObject = None)¶
Bases:
PyQt5.QtCore.QObject
Constructor for QgsLayoutCustomDropHandler.
Abstract base class that may be implemented to handle new types of data to be dropped or pasted in QGIS layouts.
Methods
Called when the specified
file
has been dropped onto a QGIS layout.Called when the specified MIME
data
has been pasted onto a QGIS layout.- childEvent(self, QChildEvent)¶
- connectNotify(self, QMetaMethod)¶
- customEvent(self, QEvent)¶
- disconnectNotify(self, QMetaMethod)¶
- handleFileDrop(self, iface: QgsLayoutDesignerInterface, file: str) → bool¶
Called when the specified
file
has been dropped onto a QGIS layout. IfTrue
is returned, then the handler has accepted this file and it should not be further processed (e.g. by otherQgsLayoutCustomDropHandler
).The base class implementation does nothing.
Deprecated since version use: the version which specifies a drop location instead.
handleFileDrop(self, iface:
QgsLayoutDesignerInterface
, dropPoint: Union[QPointF, QPoint], file: str) -> bool Called when the specifiedfile
has been dropped onto a QGIS layout. IfTrue
is returned, then the handler has accepted this file and it should not be further processed (e.g. by otherQgsLayoutCustomDropHandler
).The
dropPoint
point specifies the location (in layout coordinates) at which the drop occurred.The base class implementation does nothing.
New in version 3.12.
- Parameters
iface (QgsLayoutDesignerInterface) –
file (str) –
- Return type
bool
- handlePaste(self, iface: QgsLayoutDesignerInterface, pastePoint: Union[QPointF, QPoint], data: QMimeData) → Tuple[bool, List[QgsLayoutItem]]¶
Called when the specified MIME
data
has been pasted onto a QGIS layout. IfTrue
is returned, then the handler has accepted this data and it should not be further processed (e.g. by otherQgsLayoutCustomDropHandler
).The
pastePoint
point specifies the location (in layout coordinates) at which the paste occurred.The base class implementation does nothing.
- Parameters
iface (QgsLayoutDesignerInterface) – pointer to the layout designer interface
pastePoint (Union[QPointF) – layout point at which the paste should occur
data (QMimeData) – MIME data to paste
- Return type
Tuple[bool, List[QgsLayoutItem]]
- Returns
True
if the handler accepted and processed the paste operationpastedItems: should be filled with any newly created items as a result of the paste
New in version 3.14.
- isSignalConnected(self, QMetaMethod) → bool¶
- receivers(self, PYQT_SIGNAL) → int¶
- sender(self) → QObject¶
- senderSignalIndex(self) → int¶
- timerEvent(self, QTimerEvent)¶