Making a QList of an abstract class objects in C++/QT?
问题 although I've been helped countless times by other questions/answers here, this is my first question here, so don't be too harsh on me! :) I've been learning QT/C++ and let's assume I have something like this: class AbstractMasterClass{ public: virtual void foo(void) = 0; //Pure virtual method } This class will have plenty subclasses, each one of them implementing their own foo() method. And the question is: How can I create a QList which I'll populate with AbstractMasterClass's subclasses?