diff options
| author | Peter Penz <[email protected]> | 2011-11-29 22:01:16 +0100 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2011-11-29 22:03:26 +0100 |
| commit | 3719ce7d2a7f4ee6a0585763139eea8f7786630c (patch) | |
| tree | a93f357f440ac5866020ba69dc5815d927c3c3f7 /src/kitemviews/kitemlistcontroller.h | |
| parent | 4cd8ebff82cd215cc5a7c5b004207b0b0eda6734 (diff) | |
Reactivate the "Open folders during drag operations" feature
The feature got temporary lost due to the port to the new view
engine.
Diffstat (limited to 'src/kitemviews/kitemlistcontroller.h')
| -rw-r--r-- | src/kitemviews/kitemlistcontroller.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/kitemviews/kitemlistcontroller.h b/src/kitemviews/kitemlistcontroller.h index aa2fe2176..29ab6be63 100644 --- a/src/kitemviews/kitemlistcontroller.h +++ b/src/kitemviews/kitemlistcontroller.h @@ -86,6 +86,24 @@ public: void setSelectionBehavior(SelectionBehavior behavior); SelectionBehavior selectionBehavior() const; + /** + * Sets the delay in milliseconds when dragging an object above an item + * until the item gets activated automatically. A value of -1 indicates + * that no automatic activation will be done at all (= default value). + * + * The hovered item must support dropping (see KItemModelBase::supportsDropping()), + * otherwise the automatic activation is not available. + * + * After activating the item the signal itemActivated() will be + * emitted. If the view supports the expanding of items + * (KItemListView::supportsItemExpanding() returns true) and the item + * itself is expandable (see KItemModelBase::isExpandable()) then instead + * of activating the item it gets expanded instead (see + * KItemModelBase::setExpanded()). + */ + void setAutoActivationDelay(int delay); + int autoActivationDelay() const; + virtual bool showEvent(QShowEvent* event); virtual bool hideEvent(QHideEvent* event); virtual bool keyPressEvent(QKeyEvent* event); @@ -106,7 +124,18 @@ public: virtual bool processEvent(QEvent* event, const QTransform& transform); signals: + /** + * Is emitted if exactly one item has been activated by e.g. a mouse-click + * or by pressing Return/Enter. + */ void itemActivated(int index); + + /** + * Is emitted if more than one item has been activated by pressing Return/Enter + * when having a selection. + */ + void itemsActivated(const QSet<int>& indexes); + void itemMiddleClicked(int index); /** @@ -160,6 +189,8 @@ private slots: void slotChangeCurrentItem(const QString& text, bool searchFromNextItem); + void slotAutoActivationTimeout(); + private: /** * Creates a QDrag object and initiates a drag-operation. @@ -188,6 +219,8 @@ private: int m_pressedIndex; QPointF m_pressedMousePos; + QTimer* m_autoActivationTimer; + /** * When starting a rubberband selection during a Shift- or Control-key has been * pressed the current selection should never be deleted. To be able to restore |
