[kde-edu]: no more QPtrLists!

Pino Toscano toscano.pino at tiscali.it
Tue May 31 23:29:52 CEST 2005

Jason Harris ha scritto:
> The word on the net is, we can't use QPtrList's in kde4 code.
> % cd ~/kde/kdesvn/kdeedu/kstars/kstars
> % grep QPtrList *.h *.cpp tools/*.h tools/*.cpp | wc -l
> 97
> Ouch.  So, I'm supposed to use QValueLists instead; is that right?  Are they 
> essentially a "drop in" replacement (other than the fact that they contain 
> refs rather than pointers)?

Ehm... even QValueList<T> is gone ;)

You (or better, we) should use one of QList<T> or QLinkedList<T>.
And if you have to store pointers to eg a class Foo, you could use
QList<Foo*> or QLinkedList<Foo*>.

Best regards,

Pino Toscano

More information about the kde-edu mailing list