┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMéven Car <[email protected]>2026-03-22 14:39:23 +0100
committerMéven Car <[email protected]>2026-03-22 14:39:23 +0100
commit36734d7d57283c932f1feabe87fd0cf2fa905359 (patch)
treecf7a2ef4e0baa291697156b2daea7d6bd22b83b5
parentea877b191a7975d800b9d0f5c9e971dea1179f21 (diff)
kitemsviews/listviewanimation: add a started signal
To allow to cancel an edit role when the widget starts being animated. This was hooked to a function not a signal.
-rw-r--r--src/kitemviews/kitemlistview.cpp2
-rw-r--r--src/kitemviews/private/kitemlistviewanimation.cpp2
-rw-r--r--src/kitemviews/private/kitemlistviewanimation.h1
3 files changed, 4 insertions, 1 deletions
diff --git a/src/kitemviews/kitemlistview.cpp b/src/kitemviews/kitemlistview.cpp
index ccc96a7ae..1d02ee5c0 100644
--- a/src/kitemviews/kitemlistview.cpp
+++ b/src/kitemviews/kitemlistview.cpp
@@ -117,7 +117,7 @@ KItemListView::KItemListView(QGraphicsWidget *parent)
m_animation = new KItemListViewAnimation(this);
connect(m_animation, &KItemListViewAnimation::finished, this, &KItemListView::slotAnimationFinished);
- connect(m_animation, &KItemListViewAnimation::start, this, &KItemListView::slotAnimationStarted);
+ connect(m_animation, &KItemListViewAnimation::started, this, &KItemListView::slotAnimationStarted);
m_rubberBand = new KItemListRubberBand(this);
connect(m_rubberBand, &KItemListRubberBand::activationChanged, this, &KItemListView::slotRubberBandActivationChanged);
diff --git a/src/kitemviews/private/kitemlistviewanimation.cpp b/src/kitemviews/private/kitemlistviewanimation.cpp
index 2ea884461..db98713f7 100644
--- a/src/kitemviews/private/kitemlistviewanimation.cpp
+++ b/src/kitemviews/private/kitemlistviewanimation.cpp
@@ -143,6 +143,8 @@ void KItemListViewAnimation::start(QGraphicsWidget *widget, AnimationType type,
m_animation[type].insert(widget, propertyAnim);
propertyAnim->start();
+
+ Q_EMIT started(widget, type, endValue);
}
void KItemListViewAnimation::stop(QGraphicsWidget *widget, AnimationType type)
diff --git a/src/kitemviews/private/kitemlistviewanimation.h b/src/kitemviews/private/kitemlistviewanimation.h
index 821566161..a23715a8a 100644
--- a/src/kitemviews/private/kitemlistviewanimation.h
+++ b/src/kitemviews/private/kitemlistviewanimation.h
@@ -74,6 +74,7 @@ public:
Q_SIGNALS:
void finished(QGraphicsWidget *widget, KItemListViewAnimation::AnimationType type);
+ void started(QGraphicsWidget *widget, AnimationType type, const QVariant &endValue);
private Q_SLOTS:
void slotFinished();