KTutorial  0.5.1
Public Member Functions
ktutorial::editorsupport::ObjectRegister Class Reference

Register to associate objects with an id. More...

#include <ObjectRegister.h>

List of all members.

Public Member Functions

 ObjectRegister (QObject *parent=0)
 Creates a new ObjectRegister with the given parent.
int idForObject (QObject *object)
 Returns the id assigned to the object.
QObject * objectForId (int objectId)
 Returns object associated to the id.
const QMetaObject * metaObjectForClassName (const QString &className) const
 Returns the meta object with the given class name.
void clear ()
 Removes all the entries in this ObjectRegister.
void registerMetaObject (const QMetaObject *metaObject)
 Registers a meta object and the meta objects of all its super classes.

Detailed Description

Register to associate objects with an id.

The id for an object is assigned after the first time the id is requested for that object, and are valid until the register is cleared or the object is destroyed (if an object is destroyed it is automatically removed from the register). The null object is a special case, and its id is always 0.

When an object is registered, its QMetaObject and the QMetaObject of all its super classes are also registered. The QMetaObject can be got using the class name since then until the register is cleared.

Its purpose is assign QObjects an id to allow the remote KTutorial editor to refer to the objects in the target application.

Definition at line 43 of file ObjectRegister.h.


Constructor & Destructor Documentation

ktutorial::editorsupport::ObjectRegister::ObjectRegister ( QObject *  parent = 0) [explicit]

Creates a new ObjectRegister with the given parent.

Parameters:
parentThe parent QObject.

Definition at line 27 of file ObjectRegister.cpp.


Member Function Documentation

Returns the id assigned to the object.

Parameters:
objectThe object to get its id.
Returns:
The id assigned to the object.

Definition at line 31 of file ObjectRegister.cpp.

References registerMetaObject().

Referenced by ktutorial::editorsupport::ObjectRegisterAdaptor::childObjectIds(), ktutorial::editorsupport::EditorSupport::findObject(), and ktutorial::editorsupport::EditorSupport::mainWindowObjectId().

const QMetaObject * ktutorial::editorsupport::ObjectRegister::metaObjectForClassName ( const QString &  className) const

Returns the meta object with the given class name.

Parameters:
classNameThe class name to get its meta object.
Returns:
The meta object with the given class name.

Definition at line 56 of file ObjectRegister.cpp.

Referenced by ktutorial::editorsupport::ClassRegisterAdaptor::propertyList(), ktutorial::editorsupport::ClassRegisterAdaptor::signalList(), and ktutorial::editorsupport::ClassRegisterAdaptor::superClass().

void ktutorial::editorsupport::ObjectRegister::registerMetaObject ( const QMetaObject *  metaObject)

Registers a meta object and the meta objects of all its super classes.

Parameters:
metaObjectThe meta object to register.

Definition at line 67 of file ObjectRegister.cpp.

Referenced by ktutorial::editorsupport::ObjectRegisterAdaptor::className(), and idForObject().


The documentation for this class was generated from the following files: