experim API to move plamoids between containments

This commit is contained in:
Marco Martin 2014-05-09 18:43:33 +02:00
parent 0b83de8fbb
commit 97831b616f
2 changed files with 17 additions and 0 deletions

View File

@ -230,6 +230,21 @@ void ContainmentInterface::setAppletArgs(Plasma::Applet *applet, const QString &
}
}
QObject *ContainmentInterface::containmentAt(int x, int y)
{
foreach (Plasma::Containment *c, containment()->corona()->containments()) {
ContainmentInterface *contInterface = c->property("_plasma_graphicObject").value<ContainmentInterface *>();
if (contInterface) {
QWindow *w = contInterface->window();
if (w && w->geometry().contains(QPoint(window()->x(), window()->y()) + QPoint(x, y))) {
return contInterface;
}
}
}
return 0;
}
void ContainmentInterface::processMimeData(QMimeData *mimeData, int x, int y)
{
if (!mimeData) {

View File

@ -115,6 +115,8 @@ public:
*/
Q_INVOKABLE void processMimeData(QMimeData *data, int x, int y);
Q_INVOKABLE QObject *containmentAt(int x, int y);
static ContainmentInterface *qmlAttachedProperties(QObject *object)
{
return qobject_cast<ContainmentInterface *>(AppletQuickItem::qmlAttachedProperties(object));