+ /**
+ * Creates a QDrag object and initiates a drag-operation.
+ */
+ 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;
+
+ /**
+ * Updates m_keyboardAnchorIndex and m_keyboardAnchorPos. If no anchor is
+ * set, it will be adjusted to the current item. If it is set it will be
+ * checked whether it is still valid, otherwise it will be reset to the
+ * current item.
+ */
+ void updateKeyboardAnchor();
+
+ /**
+ * @return Index for the next row based on \a index.
+ * If there is no next row \a index will be returned.
+ */
+ int nextRowIndex(int index) const;
+
+ /**
+ * @return Index for the previous row based on \a index.
+ * If there is no previous row \a index will be returned.
+ */
+ int previousRowIndex(int index) const;
+
+ /**
+ * Helper method for updateKeyboardAnchor(), previousRowIndex() and nextRowIndex().
+ * @return The position of the keyboard anchor for the item with the index \a index.
+ * If a horizontal scrolling is used the y-position of the item will be returned,
+ * for the vertical scrolling the x-position will be returned.
+ */
+ qreal keyboardAnchorPos(int index) const;
+
+ /**
+ * Dependent on the selection-behavior the extendedSelectionRegion-property
+ * of the KItemListStyleOption from the view should be adjusted: If no
+ * rubberband selection is used the property should be enabled.
+ */
+ void updateExtendedSelectionRegion();
+
+ bool keyPressEvent(QKeyEvent* event);
+ bool inputMethodEvent(QInputMethodEvent* event);
+ bool mousePressEvent(QGraphicsSceneMouseEvent* event, const QTransform& transform);
+ bool mouseMoveEvent(QGraphicsSceneMouseEvent* event, const QTransform& transform);
+ bool mouseReleaseEvent(QGraphicsSceneMouseEvent* event, const QTransform& transform);
+ bool mouseDoubleClickEvent(QGraphicsSceneMouseEvent* event, const QTransform& transform);
+ bool dragEnterEvent(QGraphicsSceneDragDropEvent* event, const QTransform& transform);
+ bool dragLeaveEvent(QGraphicsSceneDragDropEvent* event, const QTransform& transform);
+ bool dragMoveEvent(QGraphicsSceneDragDropEvent* event, const QTransform& transform);
+ bool dropEvent(QGraphicsSceneDragDropEvent* event, const QTransform& transform);
+ bool hoverEnterEvent(QGraphicsSceneHoverEvent* event, const QTransform& transform);
+ bool hoverMoveEvent(QGraphicsSceneHoverEvent* event, const QTransform& transform);
+ bool hoverLeaveEvent(QGraphicsSceneHoverEvent* event, const QTransform& transform);
+ bool wheelEvent(QGraphicsSceneWheelEvent* event, const QTransform& transform);
+ bool resizeEvent(QGraphicsSceneResizeEvent* event, const QTransform& transform);
+
+private:
+ bool m_singleClickActivationEnforced;
+ bool m_selectionTogglePressed;
+ bool m_clearSelectionIfItemsAreNotDragged;