Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions

QMetaObject Class Reference

The QMetaObject class contains meta information about Qt objects. More...

#include <QMetaObject>

List of all members.

Public Functions

Static Public Members


Detailed Description

The QMetaObject class contains meta information about Qt objects.

The Qt Meta Object System in Qt is responsible for the signals and slots inter-object communication mechanism, runtime type information, and the Qt property system. A single QMetaObject instance is created for each QObject subclass that is used in an application, and this instance stores all the meta information for the QObject subclass.

This class is not normally required for application programming, but it is useful if you write meta applications, such as scripting engines or GUI builders.

The functions you are most likely to find useful are these:

The index functions indexOfSlot(), indexOfSignal(), indexOfEnumerator(), and indexOfProperty() map names of member functions, enumerators, or properties to indices in the meta object. For example, Qt uses indexOfSignal() and indexOfSlot() internally when you connect a signal to a slot.

Classes can also have a list of name--value pairs of additional class information. The number of pairs is returned by classInfoCount(), single pairs are returned by classInfo(), and you can search for pairs with indexOfClassInfo().

See also moc (Meta QObject Compiler).


Member Function Documentation

bool QMetaObject::checkConnectArgs ( const char * signal, const char * member )   [static]

Returns true if the signal and member arguments are compatible; otherwise returns false.

Both signal and member are expected to be normalized.

See also normalizedSignature().

QMetaClassInfo QMetaObject::classInfo ( int index ) const

Returns the meta data for the item of class information with the given index.

See also indexOfClassInfo().

int QMetaObject::classInfoCount () const

Returns the number of items of class information in this class.

int QMetaObject::classInfoOffset () const

Returns the class information offset for this class; i.e. the index position of this class's first class information item. If the class has no super-classes with class information, the offset is 0; otherwise the offset is the sum of all the class information items in the class's super-classes.

const char * QMetaObject::className () const

Returns the class name.

See also superClass().

QMetaEnum QMetaObject::enumerator ( int index ) const

Returns the meta data for the enumerator with the given index.

See also indexOfEnumerator().

int QMetaObject::enumeratorCount () const

Returns the number of enumerators in this class.

See also enumerator().

int QMetaObject::enumeratorOffset () const

Returns the enumerator offset for this class; i.e. the index position of this class's first enumerator. If the class has no super-classes with enumerators, the offset is 0; otherwise the offset is the sum of all the enumerators in the class's super-classes.

int QMetaObject::indexOfClassInfo ( const char * name ) const

Finds class information item name and returns its index; otherwise returns -1.

See also classInfo() and classInfoCount().

int QMetaObject::indexOfEnumerator ( const char * name ) const

Finds enumerator name and returns its index; otherwise returns -1.

See also enumerator() and enumeratorCount().

int QMetaObject::indexOfProperty ( const char * name ) const

Finds property name and returns its index; otherwise returns -1.

See also property() and propertyCount().

int QMetaObject::indexOfSignal ( const char * signal ) const

Finds signal and returns its index; otherwise returns -1.

See also signal() and signalCount().

int QMetaObject::indexOfSlot ( const char * slot ) const

Finds slot and returns its index; otherwise returns -1.

See also slot() and slotCount().

QByteArray QMetaObject::normalizedSignature ( const char * member )   [static]

Normalizes the signature of the given member.

Qt uses normalized signatures to decide whether two given signals and slots are compatible. Normalization reduces whitespace to a minimum, moves 'const' to the front where appropriate, removes 'const' from value types and replaces const references with values.

See also checkConnectArgs().

QMetaProperty QMetaObject::property ( int index ) const

Returns the meta data for the property with the given index.

See also indexOfProperty().

int QMetaObject::propertyCount () const

Returns the number of properties in this class.

See also property().

int QMetaObject::propertyOffset () const

Returns the property offset for this class; i.e. the index position of this class's first property. The offset is the sum of all the properties in the class's super-classes (which is always positive since QObject has the name() property).

QMetaMember QMetaObject::signal ( int index ) const

Returns the meta data for the signal with the given index.

See also indexOfSignal().

int QMetaObject::signalCount () const

Returns the number of signals in this class.

See also signal().

int QMetaObject::signalOffset () const

Returns the signal offset for this class; i.e. the index position of this class's first signal. The offset is the sum of all the signals in the class's super-classes (which is always positive since QObject has the slots destroyed() and destroyed(QObject*)).

QMetaMember QMetaObject::slot ( int index ) const

Returns the meta data for the slot with the given index.

See also indexOfSlot().

int QMetaObject::slotCount () const

Returns the number of slots in this class.

See also slot().

int QMetaObject::slotOffset () const

Returns the slot offset for this class; i.e. the index position of this class's first slot. The offset is the sum of all the slots in the class's super-classes (which is always positive since QObject has the deleteLater() slot).

const QMetaObject * QMetaObject::superClass () const

Returns the meta object of the super-class, or 0 if there is no such object.


Copyright © 2004 Trolltech. Trademarks
Qt 4.0.0-tp1