void setAutoActivationDelay(int delay);
int autoActivationDelay() const;
+ /**
+ * If set to true, the signals itemActivated() and itemsActivated() are emitted
+ * after a single-click of the left mouse button. If set to false, a double-click
+ * is required. Per default the setting from KGlobalSettings::singleClick() is
+ * used.
+ */
+ void setSingleClickActivation(bool singleClick);
+ bool singleClickActivation() const;
+
virtual bool showEvent(QShowEvent* event);
virtual bool hideEvent(QHideEvent* event);
virtual bool keyPressEvent(QKeyEvent* event);
void updateKeyboardAnchor();
/**
- * @return Index for the next row based on the current index.
- * If there is no next row the current index will be returned.
+ * @return Index for the next row based on \a index.
+ * If there is no next row \a index will be returned.
*/
- int nextRowIndex() const;
+ int nextRowIndex(int index) const;
/**
- * @return Index for the previous row based on the current index.
- * If there is no previous row the current index will be returned.
+ * @return Index for the previous row based on \a index.
+ * If there is no previous row \a index will be returned.
*/
- int previousRowIndex() const;
+ int previousRowIndex(int index) const;
/**
* Helper method for updateKeyboardAnchor(), previousRowIndex() and nextRowIndex().
qreal keyboardAnchorPos(int index) const;
private:
+ bool m_singleClickActivation;
bool m_selectionTogglePressed;
+ bool m_clearSelectionIfItemsAreNotDragged;
SelectionBehavior m_selectionBehavior;
KItemModelBase* m_model;
KItemListView* m_view;