problem in extending QList (a template class)

Jens Zurheide jens.zurheide at
Sun Mar 3 18:54:44 GMT 2002


I found something interesting about templates for you at There might be more of this 
stuff in the internet.

Sunday 03 March 2002 15:17 Dung Patrick
>I want to extend QList (say a class called Chain). QList itself is a
> template class. So, what's the method to extend a template class? Thank
> you for advance.
>Is the .h file like this:
>#include <qlist.h>
>template<class Chain> class Chain : public QList {
Should read like this:
template<class T> class Chain : public QList<T> {
Note: public inheritance translates into human language as "is a".
>        Chain(); //constructor
>        ~Chain(); //destructor

template< class T>
template< class T>

Note, that all member functions' definitions (where you define what the 
member function have to do) must be in header files for template classes.

Have fun,

to unsubscribe from this list send an email to kdevelop-request at with the following body:
unsubscribe »your-email-address«

More information about the KDevelop mailing list