diff --git a/src/declarativeimports/draganddrop/draganddropplugin.cpp b/src/declarativeimports/draganddrop/draganddropplugin.cpp index 6cc9f6ac4..0f9088cee 100644 --- a/src/declarativeimports/draganddrop/draganddropplugin.cpp +++ b/src/declarativeimports/draganddrop/draganddropplugin.cpp @@ -35,6 +35,7 @@ void DragAndDropPlugin::registerTypes(const char *uri) qmlRegisterType(uri, 2, 0, "DropArea"); qmlRegisterType(uri, 2, 0, "DragArea"); + qmlRegisterType(); qmlRegisterUncreatableType(uri, 2, 0, "MimeData", "MimeData cannot be created from QML."); qmlRegisterUncreatableType(uri, 2, 0, "DragDropEvent", "DragDropEvent cannot be created from QML."); } diff --git a/src/scriptengines/qml/plasmoid/containmentinterface.cpp b/src/scriptengines/qml/plasmoid/containmentinterface.cpp index 9672f6433..398355e4b 100644 --- a/src/scriptengines/qml/plasmoid/containmentinterface.cpp +++ b/src/scriptengines/qml/plasmoid/containmentinterface.cpp @@ -25,6 +25,7 @@ #include #include +#include #include #include @@ -44,6 +45,7 @@ ContainmentInterface::ContainmentInterface(DeclarativeAppletScript *parent) m_wallpaperInterface(0) { setAcceptedMouseButtons(Qt::AllButtons); + setFlag(QQuickItem::ItemAcceptsDrops); qmlRegisterType(); @@ -150,6 +152,11 @@ QVariantList ContainmentInterface::availableScreenRegion(int id) const return regVal; } +void ContainmentInterface::processMimeData(QMimeData *data, int x, int y) +{ + qWarning() << "Arrived mimeData" << data->urls() << data->formats() << "at" << x << ", " << y; +} + void ContainmentInterface::appletAddedForward(Plasma::Applet *applet) { if (!applet) { diff --git a/src/scriptengines/qml/plasmoid/containmentinterface.h b/src/scriptengines/qml/plasmoid/containmentinterface.h index 24f5b8b49..4be473c8e 100644 --- a/src/scriptengines/qml/plasmoid/containmentinterface.h +++ b/src/scriptengines/qml/plasmoid/containmentinterface.h @@ -60,6 +60,7 @@ public: Q_INVOKABLE void lockWidgets(bool locked); Q_INVOKABLE QRectF screenGeometry(int id) const; Q_INVOKABLE QVariantList availableScreenRegion(int id) const; + Q_INVOKABLE void processMimeData(QMimeData *data, int x, int y); protected: void init();