[Qt-interest] QModelIndex problems to represent a given data structure

Justus Best just18 at gmx.de
Mon Jul 5 23:18:02 CEST 2010


  I looked up the Qt bug tracker and found an entry from
16/Oct/09 12:54 AM
http://bugreports.qt.nokia.com/browse/QTBUG-4865
So it seems to be a known bug lets hope for a fix in 4.8 or maybe for 
4.7 if it isn't frozen already.
...
I really should stop researching while writing. It seems that it will 
not be that easy to make it 64bit as the Id is just
return reinterpret_cast<qint64>(p);
and p is the void pointer.
It wasn't really clear to me, that I'm able to set internal id and 
access it as a void pointer which most definitely will raise a bad bad 
exception :p and vice versa.
Anyway I will have to live with 32bits which should be enough for me to 
identify my items in the data structure.

Justus

Am 05.07.2010 22:21, schrieb Andre Somers:
> Op 5-7-2010 21:37, Justus Best schreef:
>>     Hi Andre,
>>
>> Thanks for your help, was hoping for an "better" solution then bit
>> shifting and masking my id to get all the infos I need to determine my
>> elements.
>> I guess its a good thing that the id is an unsigned int, caus I don't
>> have to worry about algebraic  sign, but it would be even better if I
>> would get all the 64bits for my id. Maybe Thiago can give a Statement to
>> this if he has some time to spare ;P.
>>
>> Kind  regards
>> Justus
>>
> It gets worse. You only get 32 bits, not 64. Sorry to disapoint you, but
> QAbstractItemModel::createIndex only takes a 32 bits int (quint32, to be
> exact).
>
> André
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>



More information about the Qt-interest-old mailing list