• Header: QMetaObject

  • qmake: QT += core

  • Group: QMetaObject is part of objectmodel

Detailed Description

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 object is available as QObject::metaObject().

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 indexOfConstructor(), indexOfMethod(), indexOfEnumerator(), and indexOfProperty() map names of constructors, member functions, enumerators, or properties to indexes in the meta-object. For example, Qt uses indexOfMethod() internally when you connect a signal to a slot.

Classes can also have a list of namevalue pairs of additional class information, stored in QMetaClassInfo objects. The number of pairs is returned by classInfoCount(), single pairs are returned by classInfo(), and you can search for pairs with indexOfClassInfo().

Operations that use the meta object system are generally thread- safe, as QMetaObjects are typically static read-only instances generated at compile time. However, if meta objects are dynamically modified by the application (for instance, when using QQmlPropertyMap), then the application has to explicitly synchronize access to the respective meta object.

See Also

See also QMetaClassInfo, QMetaEnum, QMetaMethod, QMetaProperty, QMetaType, Meta-Object System

Member Function Documentation

 

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

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

Both signal and method are expected to be normalized.

See Also

See also