From e9d29bcf30ccbd7c76ba37ce9efcfac1649fc46e Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Fri, 18 May 2012 23:21:49 +0200 Subject: Enable basic drag and drop support for the Places Panel The dropping has not been implemented yet, however in the context of this step the creating of the drag-pixmap is now forwarded to the item-widgets. This allows creating some optimized dragging-pixmaps e.g. for the details-view, where only the name and icon should be provided as drag-pixmap. --- src/kitemviews/kitemlistcontroller.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/kitemviews/kitemlistcontroller.cpp') diff --git a/src/kitemviews/kitemlistcontroller.cpp b/src/kitemviews/kitemlistcontroller.cpp index 6045f5020..b8d719d3b 100644 --- a/src/kitemviews/kitemlistcontroller.cpp +++ b/src/kitemviews/kitemlistcontroller.cpp @@ -1063,6 +1063,11 @@ void KItemListController::startDragging() const QPixmap pixmap = m_view->createDragPixmap(selectedItems); drag->setPixmap(pixmap); + // TODO: The vertical hotspot of -24 should be replaced by the + // height of the QCursor-pixmap. + const QPoint hotSpot(pixmap.width() / 2, -24); + drag->setHotSpot(hotSpot); + drag->exec(Qt::MoveAction | Qt::CopyAction | Qt::LinkAction, Qt::CopyAction); } -- cgit v1.3