QAbstractItemView: disconnect from the correct delegate

Purely from a symmetry argument, we should be disconnecting the old
item delegate, not the new one.

I didn't find a case where this actually causes test failures, nor did
I take the time to implement a test where it does.

Amends a126d3627cc347500c1a6bd82027efa6d451ccbd. That patch landed in
Qt 6.7, but that branch is "closed" at this point in time, so not
picking there now.

Pick-to: 6.9 6.8
Change-Id: I06b704e699616d61c65ad676ffe45dfbd9f8a870
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
Marc Mutz 2025-04-01 07:59:51 +02:00 committed by Volker Hilsheimer
parent e55479ea4a
commit e5f11eebc8

View File

@ -861,7 +861,7 @@ void QAbstractItemView::setItemDelegate(QAbstractItemDelegate *delegate)
if (d->itemDelegate) {
if (d->delegateRefCount(d->itemDelegate) == 1)
d->disconnectDelegate(delegate);
d->disconnectDelegate(d->itemDelegate);
}
if (delegate) {