template <class T>class T { //...};
Product *Creator::Create(QString name, QString text){ if(name== "name1") return new name1(text); if(name== "name2") return new name2(text); if(name== "name3") return new name3(text); //... if(name== "nameN") return new nameN(text); return new Unknown(text);}