From 36734d7d57283c932f1feabe87fd0cf2fa905359 Mon Sep 17 00:00:00 2001 From: Méven Car Date: Sun, 22 Mar 2026 14:39:23 +0100 Subject: 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. --- src/kitemviews/kitemlistview.cpp | 2 +- src/kitemviews/private/kitemlistviewanimation.cpp | 2 ++ src/kitemviews/private/kitemlistviewanimation.h | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) 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(); -- cgit v1.3