C++ (Qt)class Base { Base() {} virtual ~Base() {}}; class A : public Base {};class B : public Base {};//... и т.д.
C++ (Qt)class Base { Base() {} virtual ~Base() = 0;}; inline Base::~Base() {}
Base *ptr = new Derived();...delete ptr;
C++ (Qt)class Funct {public: virtual int doit(int x) = 0; virtual ~Funct() = 0;}; inline Funct::~Funct() {} // defined even though it's pure virtual; it's faster this way; trust me
C++ (Qt)QString s("text");