Possible bug in Qt code. Testing
Rafael Fernández López
ereslibre at gmail.com
Sat Dec 9 15:30:46 GMT 2006
Hi guys,
After some talking with hermier, aseigo, dfaure and fredrikh in kde4-devel
it seems that there is a bug at Qt's code (on the model part). I wrote a
test to show that QPersistentIndexes are not correctly updated.
The test is simple enough to get the point about what's happening.
output.txt is the output of the running test.
As you can see the main problem is when removing, row() property is not
updated into the QPersistentIndexes correctly, so when asking for the row 0
on the index method after removing, the QPersistentIndex hasn't been updated
and still has row at 1, it won't find it, and it will return a
QModelIndex(), and for that reason the last line is on row -1.
I would like to have some replies at this, to know what you think. It would
be nice if it is a bug having it fixed on Qt, since I was becoming pretty
mad on uiserver, i was sure i was doing it correctly.
Bye and thanks,
Rafael Fernández López.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20061209/625b65c6/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kmodeltest.h
Type: text/x-chdr
Size: 4222 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20061209/625b65c6/attachment.h>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kmodeltest.cpp
Type: text/x-c++src
Size: 746 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20061209/625b65c6/attachment.cpp>
-------------- next part --------------
KModelTest: KMODELTEST (Before removing): The jobId 1 is right now at row 0
KModelTest: KMODELTEST (Before removing): The jobId 2 is right now at row 1
KModelTest: KMODELTEST: I didn't found the index for row 0 (Number of persistent indexes: 1)
KModelTest: KMODELTEST: The only index left is for row 1 (Number of persistent indexes: 1)
KModelTest: KMODELTEST (After removing): The jobId 2 is right now at row -1
-------------- next part --------------
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
More information about the kde-core-devel
mailing list