From 7a91492cff931c0c4e0d38dd0aee77d9dcb29373 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sun, 4 Sep 2011 17:40:44 +0200 Subject: Improved drag and drop support --- src/kitemviews/kitemlistcontroller.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/kitemviews/kitemlistcontroller.h') diff --git a/src/kitemviews/kitemlistcontroller.h b/src/kitemviews/kitemlistcontroller.h index 8ac2b554b..80c750581 100644 --- a/src/kitemviews/kitemlistcontroller.h +++ b/src/kitemviews/kitemlistcontroller.h @@ -34,6 +34,7 @@ class KItemModelBase; class KItemListKeyboardSearchManager; class KItemListSelectionManager; class KItemListView; +class KItemListWidget; class QGraphicsSceneHoverEvent; class QGraphicsSceneDragDropEvent; class QGraphicsSceneMouseEvent; @@ -113,6 +114,7 @@ signals: * Is emitted if the item with the index \p index gets hovered. */ void itemHovered(int index); + /** * Is emitted if the item with the index \p index gets unhovered. * It is assured that the signal itemHovered() for this index @@ -122,6 +124,13 @@ signals: void itemExpansionToggleClicked(int index); + /** + * Is emitted if a drop event is done above the item with the index + * \a index. If \a index is < 0 the drop event is done above an + * empty area of the view. + */ + void itemDropEvent(int index, QGraphicsSceneDragDropEvent* event); + void modelChanged(KItemModelBase* current, KItemModelBase* previous); void viewChanged(KItemListView* current, KItemListView* previous); @@ -142,6 +151,18 @@ private: */ void startDragging(); + /** + * @return Widget that is currently in the hovered state. 0 is returned + * if no widget is marked as hovered. + */ + KItemListWidget* hoveredWidget() const; + + /** + * @return Widget that is below the position \a pos. 0 is returned + * if no widget is below the position. + */ + KItemListWidget* widgetForPos(const QPointF& pos) const; + private: SelectionBehavior m_selectionBehavior; KItemModelBase* m_model; -- cgit v1.3