On terça-feira, 1 de março de 2016 13:59:07 PST André Somers wrote: > I think you did not get the point about QMetaType and QMetaObject. They > _can_ be used together:
I don't think that they can. > 1) mark the constructors in the classes you want to be able to construct > from your file as Q_INVOKABLE > 2) register the types in the meta object system The meta *object* system has no registration. The meta *type* system requires that the registered type be default- constructible and copyable, but QObject is not copyable. Therefore, QObject- derived classes cannot be registered with the meta type system. > However, I think you are probably better off just using a factory pattern. Correct, that's what the OP needs. Create your own list of classes and how to create them. You can use a list of QMetaObject by way of the invocable constructor. But you can also implement the factory by directly calling the constructors yourself. -- Thiago Macieira - thiago.macieira (AT) intel.com Software Architect - Intel Open Source Technology Center _______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest