C++ (Qt) container->registerType<ITestClass,FirstTestClass>("first"); container->registerType<ITestClass,SecondTestClass>("second"); ITestClass* first = container->resolve<ITestClass>("first"); ITestClass* second = container->resolve<ITestClass>("second");
C++ (Qt)auto *pointer = createObjectOfClass("MyClass");
C++ (Qt)class IFace{public: virtual void method1() = 0; virtual void method2() = 0;};
C++ (Qt) IFace *objA = static_cast<IFace*>( QMetaType::construct ( QMetaType::type( "ClassA" ) ) ); Q_ASSERT( objA ); objA->method1(); objA->method2(); IFace *objB = static_cast<IFace*>( QMetaType::construct ( QMetaType::type( "ClassB" ) ) ); Q_ASSERT( objB ); objB->method1(); objB->method2();