[Interest] 64-bit internal ID for QModelIndex?
Stephen Chu
stephen at ju-ju.com
Wed Aug 22 01:29:35 CEST 2012
On 8/21/12 6:52 PM, Jan Kundrát wrote:> On 08/21/12 23:47, Nikos
Chantziaras wrote:
>> createIndex(row, column, new qint64(value));
>
> This will leak, badly. It also won't likely work the way you intend it
> to work, if I understand your problem correctly.
>
> What do you need the 64bit indexing for, actually? From some of the
> sample code proposed in this thread, it seems that you are fine with
> adding a custom mapping to your QAIM subclass. There are many possible
> ways to do that, but it is better to know what is the problem you're
> trying to solve before suggesting solutions.
>
It's not an index. I am trying to store the data IDs from our server.
The IDs are 64-bit integer. Everything in the system is addressed with
the 64-bit ID. The data comes and goes constantly so the list of IDs
fluctuates a lot. A ID to index map (actually 2 maps since I need to map
both ways) is possible but that increases the complexity unnecessarily.
A lot of care has to be taken to make sure the maps are up-to-date and
no QModelIndex is holding stale index.
I'll just have to try something else...
More information about the Interest
mailing list