qt-interest@trolltech.com
[Top] [All Lists]

Re: class in a QList

Subject: Re: class in a QList
From: Tobias Doerffel
Date: Mon, 9 Oct 2006 12:30:13 +0200
Am Montag, 9. Oktober 2006 12:05 schrieb Andreas Pakulat:
> However there's a way around, you could use factory methods which create
> a new instance of a certain class for you and return a pointer to that
> instance. Then you can create a QList of pointers to these methods.
but there's one restriction: all the classes have to be derived from a 
base-class as all the instantiation-functions have to return the same type 
(i.e. pointer to the same class), otherwise you can't store the 
functions-pointers in one list (as the list itself is instantiated with a 
certain function-pointer-type)

toby
<Prev in Thread] Current Thread [Next in Thread>