┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews/kitemlistcontroller.h
diff options
context:
space:
mode:
authorAkseli Lahtinen <[email protected]>2025-05-09 13:34:30 +0300
committerAkseli Lahtinen <[email protected]>2025-05-09 13:34:30 +0300
commit2201018673467bf7a871082b1fd1e3f8c6f926e7 (patch)
tree0eac8446d79c39e83432a2e8f60378c67cfcaf56 /src/kitemviews/kitemlistcontroller.h
parent882cd01717f53ac544c54fec3d03163b8fbdebe7 (diff)
DolphinView: Remove -1 interval, add setAutoActivationEnabled
In future Qt versions, Qt Timers do not allow negative intervals. Instead, they will be changed to 1. Related Qt commit: https://github.com/qt/qtbase/commit/f1f610bc67bfd5c2ef31270a6945e7bae93b5e4a Instead of relying on the interval, use a boolean variable to check if the autoactivation is enabled or not.
Diffstat (limited to 'src/kitemviews/kitemlistcontroller.h')
-rw-r--r--src/kitemviews/kitemlistcontroller.h20
1 files changed, 3 insertions, 17 deletions
diff --git a/src/kitemviews/kitemlistcontroller.h b/src/kitemviews/kitemlistcontroller.h
index fcb971fb7..48da07206 100644
--- a/src/kitemviews/kitemlistcontroller.h
+++ b/src/kitemviews/kitemlistcontroller.h
@@ -88,23 +88,8 @@ public:
int indexCloseToMousePressedPosition() 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;
+ void setAutoActivationEnabled(bool enabled);
+ bool isAutoActivationEnabled() const;
/**
* If set to true, the signals itemActivated() and itemsActivated() are emitted
@@ -362,6 +347,7 @@ private:
std::optional<int> m_pressedIndex;
QPointF m_pressedMouseGlobalPos;
+ bool m_autoActivationEnabled = false;
QTimer *m_autoActivationTimer;
Qt::GestureType m_swipeGesture;