squidge
2nd December 2009, 19:12
For each item displayed, I wish to fetch more information. Thats no problem, but for performance reasons, I also wish this data to be cached.
Due to the fact that the proxy model can be sorted I can't just use the index as a reference into this cache, as it could change at any time. Therefore I use the index returned from mapToSource, as thats guaranteed to always be the same regardless of where the item is in the proxy.
I'm wondering if there's a better way of combining data with an item that would work in such a situation? Calling mapToSource for every single item seems wasteful of processor usage when all I care about is a unique number for each item.
Due to the fact that the proxy model can be sorted I can't just use the index as a reference into this cache, as it could change at any time. Therefore I use the index returned from mapToSource, as thats guaranteed to always be the same regardless of where the item is in the proxy.
I'm wondering if there's a better way of combining data with an item that would work in such a situation? Calling mapToSource for every single item seems wasteful of processor usage when all I care about is a unique number for each item.