qt5base-lts/tests/auto/gui/itemmodels
Christian Ehrlicher 4522b17159 QStandardItemModel: do not reset persisten index in setItem()
When an existing item is replaced with a new one in
QStandardItemModel::setItem() then the persitent index is invalidated
which leads to some unexpected behaviors (like e.g the header size and
resize mode are reset).
Therefore we have to make sure that the invalidation does not happen.
This can be achieved by delaying the call to QStandardItem::setModel()
for the old item until the new is properly added. After this, the old
item no longer gets a valid QModelIndex from the model and therefore
can't invalidate the persistent index anymore.

Fixes: QTBUG-13605
Fixes: QTBUG-73000
Fixes: QTBUG-80586
Change-Id: I4e45e6feb81b7287c0859f638d7ab1a576fc2f0f
Reviewed-by: David Faure <david.faure@kdab.com>
2019-12-14 08:46:05 +01:00
..
qstandarditem Remove usages of deprecated APIs of corelib 2019-07-05 11:25:46 +02:00
qstandarditemmodel QStandardItemModel: do not reset persisten index in setItem() 2019-12-14 08:46:05 +01:00
itemmodels.pro add and use qtHaveModule() function 2012-12-21 19:05:02 +01:00