#include <objectfactory.h>
Inheritance diagram for ObjectFactory:


Public Member Functions | |
| virtual QObject * | newObject (QString className, QObject *parent=0) |
| |
| Address * | newAddress (Country::CountryType country=Country::Undefined) |
| Address * | newAddress (QString countryName="USA") |
Static Public Member Functions | |
| static ObjectFactory * | instance () |
| |
Protected Member Functions | |
| ObjectFactory () | |
It knows how to create instances of some QObject-derived classes: Address and also can "spoof" classes it does not know about by setting dynamic properties.
It initializes constraints of the various Address-types before it creates the first instance.
It manages its own singleton instance, which is the parent of all newly created objects. You can set the parent to another object after it is returned.
Definition at line 31 of file objectfactory.h.
| QObject * ObjectFactory::newObject | ( | QString | className, | |
| QObject * | parent = 0 | |||
| ) | [virtual] |
If the className is not a known type, it will return an instance of PropsMap, serving as a catch-all. By default, the new object is a child of "this", which means its lifetime expires when this object is destroyed. Overridden versions of this class may return more specific types.
| className | - the name of the class to create | |
| parent | the parent of the object. |
Implements AbstractFactory.
Reimplemented in CustomerFactory.
Definition at line 20 of file objectfactory.cpp.
References newAddress().
Referenced by CustomerFactory::newObject(), and QObjectReader::startElement().
Here is the call graph for this function:

1.5.1