QGIS API Documentation 3.28.0-Firenze (ed3ad0430f)
Public Member Functions | List of all members
QgsLayoutCustomDropHandler Class Reference

Abstract base class that may be implemented to handle new types of data to be dropped or pasted in QGIS layouts. More...

#include <qgslayoutcustomdrophandler.h>

Inheritance diagram for QgsLayoutCustomDropHandler:
Inheritance graph
[legend]

Public Member Functions

 QgsLayoutCustomDropHandler (QObject *parent=nullptr)
 Constructor for QgsLayoutCustomDropHandler. More...
 
virtual Q_DECL_DEPRECATED bool handleFileDrop (QgsLayoutDesignerInterface *iface, const QString &file)
 Called when the specified file has been dropped onto a QGIS layout. More...
 
virtual bool handleFileDrop (QgsLayoutDesignerInterface *iface, QPointF dropPoint, const QString &file)
 Called when the specified file has been dropped onto a QGIS layout. More...
 
virtual bool handlePaste (QgsLayoutDesignerInterface *iface, QPointF pastePoint, const QMimeData *data, QList< QgsLayoutItem * > &pastedItems)
 Called when the specified MIME data has been pasted onto a QGIS layout. More...
 

Detailed Description

Abstract base class that may be implemented to handle new types of data to be dropped or pasted in QGIS layouts.

Since
QGIS 3.0

Definition at line 33 of file qgslayoutcustomdrophandler.h.

Constructor & Destructor Documentation

◆ QgsLayoutCustomDropHandler()

QgsLayoutCustomDropHandler::QgsLayoutCustomDropHandler ( QObject *  parent = nullptr)

Constructor for QgsLayoutCustomDropHandler.

Definition at line 19 of file qgslayoutcustomdrophandler.cpp.

Member Function Documentation

◆ handleFileDrop() [1/2]

bool QgsLayoutCustomDropHandler::handleFileDrop ( QgsLayoutDesignerInterface iface,
const QString &  file 
)
virtual

Called when the specified file has been dropped onto a QGIS layout.

If true is returned, then the handler has accepted this file and it should not be further processed (e.g. by other QgsLayoutCustomDropHandler).

The base class implementation does nothing.

Deprecated:
use the version which specifies a drop location instead.

Definition at line 25 of file qgslayoutcustomdrophandler.cpp.

◆ handleFileDrop() [2/2]

bool QgsLayoutCustomDropHandler::handleFileDrop ( QgsLayoutDesignerInterface iface,
QPointF  dropPoint,
const QString &  file 
)
virtual

Called when the specified file has been dropped onto a QGIS layout.

If true is returned, then the handler has accepted this file and it should not be further processed (e.g. by other QgsLayoutCustomDropHandler).

The dropPoint point specifies the location (in layout coordinates) at which the drop occurred.

The base class implementation does nothing.

Since
QGIS 3.12

Reimplemented in QgsLayoutQptDropHandler.

Definition at line 30 of file qgslayoutcustomdrophandler.cpp.

◆ handlePaste()

bool QgsLayoutCustomDropHandler::handlePaste ( QgsLayoutDesignerInterface iface,
QPointF  pastePoint,
const QMimeData *  data,
QList< QgsLayoutItem * > &  pastedItems 
)
virtual

Called when the specified MIME data has been pasted onto a QGIS layout.

If true is returned, then the handler has accepted this data and it should not be further processed (e.g. by other QgsLayoutCustomDropHandler).

The pastePoint point specifies the location (in layout coordinates) at which the paste occurred.

The base class implementation does nothing.

Parameters
ifacepointer to the layout designer interface
pastePointlayout point at which the paste should occur
dataMIME data to paste
pastedItemsshould be filled with any newly created items as a result of the paste
Returns
true if the handler accepted and processed the paste operation
Since
QGIS 3.14

Definition at line 35 of file qgslayoutcustomdrophandler.cpp.


The documentation for this class was generated from the following files: