Call base implementations of dragMoveEvent() and dropEvent() so that individual QGraphicsItems within the scene can use drag and drop.
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=695014
This commit is contained in:
parent
4823fc0237
commit
398d39948e
10
corona.cpp
10
corona.cpp
|
@ -216,13 +216,14 @@ void Corona::dragEnterEvent( QGraphicsSceneDragDropEvent *event)
|
||||||
//QMouseEvent event(QEvent::MouseButtonPress, event->pos(), Qt::LeftButton, event->mouseButtons(), 0);
|
//QMouseEvent event(QEvent::MouseButtonPress, event->pos(), Qt::LeftButton, event->mouseButtons(), 0);
|
||||||
//QApplication::sendEvent(this, &event);
|
//QApplication::sendEvent(this, &event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
event->accept();
|
||||||
//TODO Allow dragging an applet from another Corona into this one while
|
//TODO Allow dragging an applet from another Corona into this one while
|
||||||
// keeping its settings etc.
|
// keeping its settings etc.
|
||||||
}
|
}
|
||||||
|
|
||||||
void Corona::dragLeaveEvent(QGraphicsSceneDragDropEvent *event)
|
void Corona::dragLeaveEvent(QGraphicsSceneDragDropEvent *event)
|
||||||
{
|
{
|
||||||
Q_UNUSED(event);
|
|
||||||
kDebug() << "Corona::dragLeaveEvent(QGraphicsSceneDragDropEvent* event)" << endl;
|
kDebug() << "Corona::dragLeaveEvent(QGraphicsSceneDragDropEvent* event)" << endl;
|
||||||
//TODO If an established Applet is dragged out of the Corona, remove it and
|
//TODO If an established Applet is dragged out of the Corona, remove it and
|
||||||
// create a QDrag type thing to keep the Applet's settings
|
// create a QDrag type thing to keep the Applet's settings
|
||||||
|
@ -230,7 +231,9 @@ void Corona::dragLeaveEvent(QGraphicsSceneDragDropEvent *event)
|
||||||
|
|
||||||
void Corona::dragMoveEvent(QGraphicsSceneDragDropEvent *event)
|
void Corona::dragMoveEvent(QGraphicsSceneDragDropEvent *event)
|
||||||
{
|
{
|
||||||
Q_UNUSED(event);
|
QGraphicsScene::dragMoveEvent(event);
|
||||||
|
|
||||||
|
event->accept();
|
||||||
kDebug() << "Corona::dragMoveEvent(QDragMoveEvent* event)" << endl;
|
kDebug() << "Corona::dragMoveEvent(QDragMoveEvent* event)" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -273,7 +276,8 @@ void Corona::dropEvent(QGraphicsSceneDragDropEvent *event)
|
||||||
addItem(button);
|
addItem(button);
|
||||||
}
|
}
|
||||||
event->acceptProposedAction();
|
event->acceptProposedAction();
|
||||||
}
|
} else
|
||||||
|
QGraphicsScene::dropEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
// void Corona::contextMenuEvent(QGraphicsSceneContextMenuEvent *contextMenuEvent)
|
// void Corona::contextMenuEvent(QGraphicsSceneContextMenuEvent *contextMenuEvent)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user