oopapidocs  2.0
ObjectFactory Class Reference

ObjectFactory - a default AbstractFactory. More...

#include <objectfactory.h>

Inheritance diagram for ObjectFactory:
Collaboration diagram for ObjectFactory:

List of all members.

Public Member Functions

virtual QObject * newObject (QString className, QObject *parent=0)

Detailed Description

ObjectFactory - a default AbstractFactory.

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.

Author:
Alan Ezust Factory for creating Addresses
See also:
QMetaObject::newInstance() - and Q_INVOKABLE.

Definition at line 31 of file objectfactory.h.


Member Function Documentation

QObject * ObjectFactory::newObject ( QString  className,
QObject *  parent = 0 
) [virtual]
Returns:
a QObject-derived instance which can handle the properties of className. 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.
Parameters:
className- the name of the class to create
parentthe parent of the object.

Implements AbstractFactory.

Definition at line 16 of file objectfactory.cpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Enumerations