From 5ba4aeba3e82f843fb4c5b54daaaf9ae5d8cedac Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Tue, 23 Aug 2011 20:55:41 +0200 Subject: Rough draft for getting back drag and drop support Includes a lot of TODOs but is a base for getting back full drag and drop support quite soon. --- src/kitemviews/kitemlistcontroller.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/kitemviews/kitemlistcontroller.h') diff --git a/src/kitemviews/kitemlistcontroller.h b/src/kitemviews/kitemlistcontroller.h index 90850bae1..b56087ce1 100644 --- a/src/kitemviews/kitemlistcontroller.h +++ b/src/kitemviews/kitemlistcontroller.h @@ -26,6 +26,8 @@ #include #include +#include +#include #include class KItemModelBase; @@ -39,6 +41,7 @@ class QGraphicsSceneWheelEvent; class QHideEvent; class QInputMethodEvent; class QKeyEvent; +class QMimeData; class QShowEvent; class QTransform; @@ -130,11 +133,32 @@ private slots: void slotRubberBandChanged(); private: + /** + * @return Pixmap that is used for a drag operation based on the + * items given by \a indexes. + * TODO: Will be moved to KItemListView later + */ + QPixmap createDragPixmap(const QSet& indexes) const; + + /** + * @return MIME-data for the items given by \a indexes. + * TODO: Will be moved to KItemListView or KItemModelBase/KFileItemModel later. + */ + QMimeData* createMimeData(const QSet& indexes) const; + + /** + * Creates a QDrag object to start a drag-operation. + */ + void startDragging(); + +private: + bool m_dragging; SelectionBehavior m_selectionBehavior; KItemModelBase* m_model; KItemListView* m_view; KItemListSelectionManager* m_selectionManager; int m_pressedIndex; + QPointF m_pressedMousePos; /** * When starting a rubberband selection during a Shift- or Control-key has been -- cgit v1.3