On 19/01/16 14:17, Stephen Kelly wrote:

Hi,

I have uploaded a testcase to

 https://github.com/ske-ableton/public_sscce/tree/master/delegate_data

which demonstrates a problem that can occur with ListView delegates that can be animated away on removal.


I got feedback that what is happening here may not be described clearly enough. So, I made a bug report too:

 https://bugreports.qt.io/browse/QTBUG-50542

The remove animation happens as a result of the QAbstractItemModel::rowsRemoved signal, so there is a 'tension' between the requirements:

1. An attempt in the delegate to access the data while it fades out.
2. The row in the model providing access to that data has just been
   removed.

The solution could be to cache data retrieved from the model.

This seems to me to be a design bug in the QML ListView. It seems to be a simple enough case (and easy enough to hit) that it should be easy to do correctly without the client needing to implement workarounds for it.

I have some ideas on how to implement a fix for this, so that the ListView caches data it retrieves from the model.

Before I implement a patch to implement caching, I wonder if anyone has any better/alternative ideas for how to fix this, or if you think this is 'not a bug' or any other thoughts you have. Some concerns could be behavior backward compatibility, API, new behavior in a new QtQuick 2.x version of the ListView etc.

Thanks,

Steve.


--
Ableton AG, Schoenhauser Allee 6-7, 10119 Berlin, Germany
Management Board: Gerhard Behles, Jan Bohl
Chair of the Supervisory Board: Uwe Struck
Registered Office: Berlin, Amtsgericht Berlin-Charlottenburg, HRB 72838

_______________________________________________
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to