Since: BlackBerry 10.0.0

#include <bb/cascades/DataModel>

Indicates whether a ListView can translate cached items to new indexes.

An instance of this class can be sent along with the new indexes class that can be sent along with the DataModel::itemsChanged signal so that the listening ListView can translate all of the items in its cache to the new indexes (and won't have to do a full refresh of the items). Items in the ListView cache that have no such translation are removed from the ListView.


Public Functions Index

virtual ~IndexMapper ()
boolnewIndexPath (QVariantList *pOutIndexPath, int *pOutReplacementIndex, const QVariantList &oldIndexPath) const =0

Public Functions

virtual~IndexMapper ()


bool newIndexPath (

Called by ListView for every item in its cache in response to the DataModel::itemsChanged signal.

This function is called only when the DataModel::itemsChanged signal is emitted, so the old indexing won't be needed anymore when all listeners to the signal are finished, unless the eChangeType argument of the signal is INSTANT.


An output parameter. If the return value of this function is false, the content of *pOutIndexPath is undefined. Otherwise, it's a new index path specifying the placement of the item in question in the model after the update.


An output parameter. If the return value of this function is true, the value of *pOutReplacementIndex is undefined. Otherwise, it's the index amongst its siblings (that is, the last index in the index path) that the item in question would have had in the updated model, had the item not been removed. This parameter affects placement of the item-visuals that are animated out of the list. This parameter can be a negative value if the ItemRemoved-animated visuals can be placed after its parent's remaining children.


The index path for listItem before the change in the model.


true if the item in question remains in the model after the update, false if the item has been removed.


BlackBerry 10.0.0

Last modified: 2014-03-13

comments powered by Disqus