stub for drag and drop and paste mechanism

This commit is contained in:
Marco Martin 2013-08-28 13:22:29 +02:00
parent 672d5e9016
commit 04f11788ea
3 changed files with 9 additions and 0 deletions

View File

@ -35,6 +35,7 @@ void DragAndDropPlugin::registerTypes(const char *uri)
qmlRegisterType<DeclarativeDropArea>(uri, 2, 0, "DropArea");
qmlRegisterType<DeclarativeDragArea>(uri, 2, 0, "DragArea");
qmlRegisterType<QMimeData>();
qmlRegisterUncreatableType<DeclarativeMimeData>(uri, 2, 0, "MimeData", "MimeData cannot be created from QML.");
qmlRegisterUncreatableType<DeclarativeDragDropEvent>(uri, 2, 0, "DragDropEvent", "DragDropEvent cannot be created from QML.");
}

View File

@ -25,6 +25,7 @@
#include <QQmlExpression>
#include <QQmlProperty>
#include <QMimeData>
#include <KActionCollection>
#include <KAuthorized>
@ -44,6 +45,7 @@ ContainmentInterface::ContainmentInterface(DeclarativeAppletScript *parent)
m_wallpaperInterface(0)
{
setAcceptedMouseButtons(Qt::AllButtons);
setFlag(QQuickItem::ItemAcceptsDrops);
qmlRegisterType<ContainmentInterface>();
@ -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) {

View File

@ -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();