.. _api_MetaObject: MetaObject ========== Inherited: None .. _api_MetaObject_description: Description ----------- This class is a part of Object-Introspection-Mechanism. MetaObject provides information about one particular class inherited from base Object class. Developers are able to retrieve information about properties, methods and inheritance chains. This class is actively used in Signal-Slot mechanism. .. _api_MetaObject_public: Public Methods -------------- +-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | | :ref:`MetaObject` (const char * name, const MetaObject * super, const MetaObject::Constructor constructor, const MetaMethod::Table * methods, const MetaProperty::Table * props, const MetaEnum::Table * enums) | +-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | bool | :ref:`canCastTo` (const char * type) const | +-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Object` * | :ref:`createInstance` () const | +-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`MetaEnum` | :ref:`enumerator` (int index) const | +-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | int | :ref:`enumeratorCount` () const | +-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | int | :ref:`enumeratorOffset` () const | +-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | int | :ref:`indexOfEnumerator` (const char * name) const | +-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | int | :ref:`indexOfMethod` (const char * signature) const | +-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | int | :ref:`indexOfProperty` (const char * name) const | +-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | int | :ref:`indexOfSignal` (const char * signature) const | +-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | int | :ref:`indexOfSlot` (const char * signature) const | +-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`MetaMethod` | :ref:`method` (int index) const | +-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | int | :ref:`methodCount` () const | +-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | int | :ref:`methodOffset` () const | +-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | const char | :ref:`name` () const | +-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`MetaProperty` | :ref:`property` (int index) const | +-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | int | :ref:`propertyCount` () const | +-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | int | :ref:`propertyOffset` () const | +-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | const :ref:`MetaObject` * | :ref:`super` () const | +-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. _api_MetaObject_static: Static Methods -------------- None .. _api_MetaObject_methods: Methods Description ------------------- .. _api_MetaObject_MetaObject: **MetaObject::MetaObject** (char * *name*, :ref:`MetaObject` * *super*, :ref:`MetaObject::Constructor` *constructor*, :ref:`MetaMethod::Table` * *methods*, :ref:`MetaProperty::Table` * *props*, :ref:`MetaEnum::Table` * *enums*) Constructs MetaObject object for Object with type *name*, inherited from *super* class and provided *constructor*, *methods*, *props* and *enums*. ---- .. _api_MetaObject_canCastTo: bool **MetaObject::canCastTo** (char * *type*) const Checks the abillity to cast the current object to *type*. **Note:** This method tries to go through inheritance to find a common parent class. Returns true if object can be cast to *type*; otherwise returns false. ---- .. _api_MetaObject_createInstance: :ref:`Object` * **MetaObject::createInstance** () const Constructs and return a new instance of associated class. ---- .. _api_MetaObject_enumerator: :ref:`MetaEnum` **MetaObject::enumerator** (int *index*) const Returns MetaEnum object by provided *index* of enumerator. **Note:** This method looks through class hierarchy. ---- .. _api_MetaObject_enumeratorCount: int **MetaObject::enumeratorCount** () const Returns the sum of enumerators for the current class and parent classes. ---- .. _api_MetaObject_enumeratorOffset: int **MetaObject::enumeratorOffset** () const Returns the first index of enumerator for current class. The offset is the sum of all enumerator in parent classes. ---- .. _api_MetaObject_indexOfEnumerator: int **MetaObject::indexOfEnumerator** (char * *name*) const Returns index of class enumerator by provided *name*; otherwise returns -1. **Note:** This method looks through class hierarchy. ---- .. _api_MetaObject_indexOfMethod: int **MetaObject::indexOfMethod** (char * *signature*) const Returns index of class method by provided *signature*; otherwise returns -1. **Note:** This method looks through class hierarchy. ---- .. _api_MetaObject_indexOfProperty: int **MetaObject::indexOfProperty** (char * *name*) const Returns index of class property by provided *name*; otherwise returns -1. **Note:** This method looks through class hierarchy. ---- .. _api_MetaObject_indexOfSignal: int **MetaObject::indexOfSignal** (char * *signature*) const Returns index of class signal by provided *signature*; otherwise returns -1. **Note:** This method looks through class hierarchy. ---- .. _api_MetaObject_indexOfSlot: int **MetaObject::indexOfSlot** (char * *signature*) const Returns index of class slot by provided *signature*; otherwise returns -1. **Note:** This method looks through class hierarchy. ---- .. _api_MetaObject_method: :ref:`MetaMethod` **MetaObject::method** (int *index*) const Returns MetaMethod object by provided *index* of method. **Note:** This method looks through class hierarchy. ---- .. _api_MetaObject_methodCount: int **MetaObject::methodCount** () const Returns the sum of methods for the current class and parent classes. It's includes signals and slots. ---- .. _api_MetaObject_methodOffset: int **MetaObject::methodOffset** () const Returns the first index of method for current class. The offset is the sum of all methods in parent classes. ---- .. _api_MetaObject_name: const char **MetaObject::name** () const Returns the name of the object type. ---- .. _api_MetaObject_property: :ref:`MetaProperty` **MetaObject::property** (int *index*) const Returns MetaProperty object by provided *index* of property. **Note:** This method looks through class hierarchy. ---- .. _api_MetaObject_propertyCount: int **MetaObject::propertyCount** () const Returns the sum of properties for the current class and parent classes. ---- .. _api_MetaObject_propertyOffset: int **MetaObject::propertyOffset** () const Returns the first index of property for current class. The offset is the sum of all properties in parent classes. ---- .. _api_MetaObject_super: const :ref:`MetaObject` * **MetaObject::super** () const Returns an introspection object for parent class.