[quote author="Asperamanca" date="1334737610"]
However, I feel you still missed my point regarding copy constructors. I'll sum it up in one sentence, and leave it at that:
"A base class cannot know it has to call the copy constructor of a derived class."
That a derived class has to call the copy constructor of its base class is clear.[/quote]
Well, but that is a moot point, isn't it? It would be impossible for any class to copy into it the members of a derived class. So, a base class doesn't need to know how to call the copy constructor of derived classes. And yes, that means that you have trouble with polymorphism, in that you can't clone a derived class using the copy constructor or assignment operator if you just have a base class pointer. Meyers suggest creating a virtual clone() method for that that returns a pointer instead of a reference, but you obviously can't do that for QList.
[quote author="Asperamanca" date="1334734252"]I get a MyDerivedList<MyType>, but store it as a QList<MyType>. When I cause a deep-copy now (e.g. by changing data), which copy constructor(s) will be called?
Edit:
Answering my own question: It wouldn't do the "right thing" regardless of whether I used QList<MyType> or QList*<MyType>. A way to get polymorphism to work in this case would be the virtual constructor idiom, which however has to be supported in the base class.[/quote]
Indeed: the virtual clone method. Note that it's not even possible to do without using pointers to the lists either. You cannot assign a MyDerivedList<MyType> to a QList<MyType> at all. Polymorphism needs pointers or references to work its magic, right?