diff --git a/src/scriptengines/qml/plasmoid/containmentinterface.cpp b/src/scriptengines/qml/plasmoid/containmentinterface.cpp index e801baec9..4c9a692d1 100644 --- a/src/scriptengines/qml/plasmoid/containmentinterface.cpp +++ b/src/scriptengines/qml/plasmoid/containmentinterface.cpp @@ -311,6 +311,15 @@ QPointF ContainmentInterface::mapToApplet(AppletInterface *applet, int x, int y) return pos - applet->mapToScene(QPointF(0, 0)); } +void ContainmentInterface::processMimeData(QObject *mimeDataProxy, int x, int y) +{ + QMimeData* mime = qobject_cast(mimeDataProxy); + if (mime) + processMimeData(mime, x, y); + else + processMimeData(mimeDataProxy->property("mimeData").value(), x, y); +} + void ContainmentInterface::processMimeData(QMimeData *mimeData, int x, int y) { if (!mimeData) { diff --git a/src/scriptengines/qml/plasmoid/containmentinterface.h b/src/scriptengines/qml/plasmoid/containmentinterface.h index 7c899e042..9248c6c3c 100644 --- a/src/scriptengines/qml/plasmoid/containmentinterface.h +++ b/src/scriptengines/qml/plasmoid/containmentinterface.h @@ -122,6 +122,11 @@ public: */ Q_INVOKABLE void processMimeData(QMimeData *data, int x, int y); + /** + * Process the mime data arrived to a particular coordinate, either with a drag and drop or paste with middle mouse button + */ + Q_INVOKABLE void processMimeData(QObject *data, int x, int y); + /** * Search for a containment at those coordinates. * the coordinates are passed as local coordinates of *this* containment