Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt-interest Archive, March 2002
problem in extending QList (a template class)


Message 1 in thread

Hi,

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 {

public:

        Chain(); //constructor
        ~Chain(); //destructor
};


Message 2 in thread

Hi,

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 {

public:

        Chain(); //constructor
        ~Chain(); //destructor
};