From 073f8cae13f2637c0bf2f5611295e103418d52ff Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sat, 26 May 2012 13:40:48 +0200 Subject: Further preperations for drag & drop support in the places panel --- src/panels/places/placespanel.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/panels/places/placespanel.cpp') diff --git a/src/panels/places/placespanel.cpp b/src/panels/places/placespanel.cpp index 968c9af45..deef42935 100644 --- a/src/panels/places/placespanel.cpp +++ b/src/panels/places/placespanel.cpp @@ -43,6 +43,7 @@ #include "placesitemlistwidget.h" #include "placesitemmodel.h" #include +#include #include #include @@ -88,6 +89,7 @@ void PlacesPanel::showEvent(QShowEvent* event) connect(m_controller, SIGNAL(itemMiddleClicked(int)), this, SLOT(slotItemMiddleClicked(int))); connect(m_controller, SIGNAL(itemContextMenuRequested(int,QPointF)), this, SLOT(slotItemContextMenuRequested(int,QPointF))); connect(m_controller, SIGNAL(viewContextMenuRequested(QPointF)), this, SLOT(slotViewContextMenuRequested(QPointF))); + connect(m_controller, SIGNAL(itemDropEvent(int,QGraphicsSceneDragDropEvent*)), this, SLOT(slotItemDropEvent(int,QGraphicsSceneDragDropEvent*))); KItemListContainer* container = new KItemListContainer(m_controller, this); container->setEnabledFrame(false); @@ -252,6 +254,11 @@ void PlacesPanel::slotViewContextMenuRequested(const QPointF& pos) selectClosestItem(); } +void PlacesPanel::slotItemDropEvent(int index, QGraphicsSceneDragDropEvent* event) +{ + m_model->dropMimeData(index, event->mimeData()); +} + void PlacesPanel::slotUrlsDropped(const KUrl& dest, QDropEvent* event, QWidget* parent) { Q_UNUSED(parent); -- cgit v1.3