Create and manipulate GluonObjects by reference and name. More...
#include <gluonobjectfactory.h>
Public Member Functions | |
template<class T > | |
void | registerObjectType () |
GluonObject * | instantiateObjectByName (const QString &objectTypeName) |
GluonObject * | instantiateObjectByMimetype (const QString &objectMimeType) |
QVariant | wrapObject (const QVariant &original, GluonObject *newValue) |
QVariant | wrapObject (const QString &type, GluonObject *newValue) |
GluonObject * | wrappedObject (const QVariant &wrappedObject) |
void | loadPlugins () |
QStringList | objectTypeNames () const |
QStringList | objectMimeTypes () const |
QHash< QString, const QMetaObject * > | objectTypes () const |
const QHash< QString, int > | objectTypeIDs () const |
Create and manipulate GluonObjects by reference and name.
The GluonObjectFactory provides functionality not just for creating objects, but also assists in extending QVariant with functionality for handling objects with inherited classes.
Definition at line 42 of file gluonobjectfactory.h.
GluonObject * GluonObjectFactory::instantiateObjectByMimetype | ( | const QString & | objectMimeType | ) |
Create a new object which is capable of handling the passed mime type
objectMimeType | The string representation of the mimetype you wish to be able to handle
|
Definition at line 99 of file gluonobjectfactory.cpp.
GluonObject * GluonObjectFactory::instantiateObjectByName | ( | const QString & | objectTypeName | ) |
Create a new object with the class name indicated by the passed string
objectTypeName | The name of the class you want an instance of
|
Definition at line 67 of file gluonobjectfactory.cpp.
void GluonObjectFactory::loadPlugins | ( | ) |
Request a reload of the factory's plugins
Definition at line 166 of file gluonobjectfactory.cpp.
QStringList GluonObjectFactory::objectMimeTypes | ( | ) | const |
A list of all the mimetypes supported by the factory
Definition at line 61 of file gluonobjectfactory.cpp.
const QHash< QString, int > GluonObjectFactory::objectTypeIDs | ( | ) | const |
A hash containing the QMetaType object IDs for all the classes registered in the factory. The key is the class name, and the value is the ID
Definition at line 55 of file gluonobjectfactory.cpp.
QStringList GluonObjectFactory::objectTypeNames | ( | ) | const |
A list of all the names of the classes in the factory
Definition at line 37 of file gluonobjectfactory.cpp.
QHash< QString, const QMetaObject * > GluonObjectFactory::objectTypes | ( | ) | const |
A hash containing all the metaobjects of all the classes in the factory. The key is the class name, and the value is the metaobject.
Definition at line 49 of file gluonobjectfactory.cpp.
void GluonCore::GluonObjectFactory::registerObjectType | ( | ) | [inline] |
Definition at line 48 of file gluonobjectfactory.h.
QVariant GluonObjectFactory::wrapObject | ( | const QString & | type, | |
GluonObject * | newValue | |||
) |
Wrap the passed GluonObject in a QVariant of the named type. This enables a property to retain its type when changing its value along a class inheritance chain.
type | The name of the type the QVariant should be
|
Definition at line 127 of file gluonobjectfactory.cpp.
QVariant GluonObjectFactory::wrapObject | ( | const QVariant & | original, | |
GluonObject * | newValue | |||
) |
Wrap the passed GluonObject in a QVariant of the same type as the passed QVariant. This enables a property to retain its type when changing its value along a class inheritance chain.
original | The original value of the property
|
Definition at line 105 of file gluonobjectfactory.cpp.
GluonObject * GluonObjectFactory::wrappedObject | ( | const QVariant & | wrappedObject | ) |
Get the GluonObject wrapped inside the passed QVariant
wrappedObject | A GluonObject wrapped inside a QVariant
|
Definition at line 146 of file gluonobjectfactory.cpp.