addApplet function
offers a crude support to applet migration between containments
This commit is contained in:
parent
97831b616f
commit
cdb9c8c1cc
@ -245,6 +245,18 @@ QObject *ContainmentInterface::containmentAt(int x, int y)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void ContainmentInterface::addApplet(AppletInterface *applet)
|
||||
{
|
||||
if (!applet || applet->applet()->containment() == containment()) {
|
||||
return;
|
||||
}
|
||||
|
||||
blockSignals(true);
|
||||
containment()->addApplet(applet->applet());
|
||||
blockSignals(false);
|
||||
emit appletAdded(applet, QCursor::pos().x(), QCursor::pos().y());
|
||||
}
|
||||
|
||||
void ContainmentInterface::processMimeData(QMimeData *mimeData, int x, int y)
|
||||
{
|
||||
if (!mimeData) {
|
||||
|
@ -117,6 +117,8 @@ public:
|
||||
|
||||
Q_INVOKABLE QObject *containmentAt(int x, int y);
|
||||
|
||||
Q_INVOKABLE void addApplet(AppletInterface *applet);
|
||||
|
||||
static ContainmentInterface *qmlAttachedProperties(QObject *object)
|
||||
{
|
||||
return qobject_cast<ContainmentInterface *>(AppletQuickItem::qmlAttachedProperties(object));
|
||||
|
Loading…
Reference in New Issue
Block a user