> > > For now there is a design choice which I feel weak myself, to do > factory or to use QMetaType for creating instances. > > Depends on the use case I suppose. If you know the types at compile time, > as is usually the case I'd go with the simple solution to make a factory. I > recently, however, had a case where the deserialization routine couldn't > know at compile time the exact type (i.e. for a library), so I had to put a > (gadget) base class and use the runtime type ids. >
Since I'm trying to recover states of the QObject-derived class instances from a file, it is not possible to know the types at compile time. But is not that factory was also for creating objects that type is known at run-time? Or am I missing something? Because I thought both factory and metaobject system provide run-time object creation?
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest