[Kde-games-devel] kspaceduel: replace Q3PtrList with QtList
Dirk
dirkrathlev at gmx.de
Thu Jan 4 23:05:27 CET 2007
Hi Dmitry,
> 1. I believe that removing items from container while looping over it can lead
> to unexpected results. IIRC QLinkedList is the container to use if you want
> to have iterators which aren't invalidated after remove* operations. Please
> check this in doc :).
>
the Qt doc says I can access a QList just like an array. I think it's
correct, but will take a look at QLinkedList.
> 2. Again, you can use foreach() instead "for(int i=0;i<list.size();i++)' kind
> of loops to make the code more readable.
>
You're right. I'm still a little unfamiliar with this coding style.
Thanks for the hint.
> 3. Why you use qDeleteAll() in one places and "while(!empty) takeFirst" in
> another? I think it would be nice to be consistent.
>
Correct. I used "while(!empty) takeFirst" because I ran into some
problems first. They are now solved (forgot the .clear() call).
Thank you for reviewing it.
Cheers,
Dirk
More information about the kde-games-devel
mailing list