Logo Search packages:      
Sourcecode: qt4-x11 version File versions  Download package

QMetaObject Class Reference

Inherited by QDBusMetaObject.

List of all 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 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: className() returns the name of a class. superClass() returns the superclass's meta-object. method() and methodCount() provide information about a class's meta-methods (signals, slots and other member functions). enumerator() and enumeratorCount() and provide information about a class's enumerators. propertyCount() and property() provide information about a class's properties.

The index functions indexOfMethod(), indexOfEnumerator(), and indexOfProperty() map names of 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 {name}--{value} 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().

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

Definition at line 261 of file qobjectdefs.h.


Public Types

enum  Call {
  InvokeMetaMethod, ReadProperty, WriteProperty, ResetProperty,
  QueryPropertyDesignable, QueryPropertyScriptable, QueryPropertyStored, QueryPropertyEditable,
  QueryPropertyUser
}

Public Member Functions

QObjectcast (QObject *obj) const
QMetaClassInfo classInfo (int index) const
int classInfoCount () const
int classInfoOffset () const
const char * className () const
QMetaEnum enumerator (int index) const
int enumeratorCount () const
int enumeratorOffset () const
int indexOfClassInfo (const char *name) const
int indexOfEnumerator (const char *name) const
int indexOfMethod (const char *method) const
int indexOfProperty (const char *name) const
int indexOfSignal (const char *signal) const
int indexOfSlot (const char *slot) const
QMetaMethod method (int index) const
int methodCount () const
int methodOffset () const
QMetaProperty property (int index) const
int propertyCount () const
int propertyOffset () const
const QMetaObjectsuperClass () const
QString tr (const char *s, const char *c, int n) const
QString tr (const char *s, const char *c) const
QString trUtf8 (const char *s, const char *c, int n) const
QString trUtf8 (const char *s, const char *c) const
QMetaProperty userProperty () const

Static Public Member Functions

static void activate (QObject *sender, const QMetaObject *, int from_local_signal_index, int to_local_signal_index, void **argv)
static void activate (QObject *sender, const QMetaObject *, int local_signal_index, void **argv)
static void activate (QObject *sender, int from_signal_index, int to_signal_index, void **argv)
static void activate (QObject *sender, int signal_index, void **argv)
static void addGuard (QObject **ptr)
static void changeGuard (QObject **ptr, QObject *o)
static bool checkConnectArgs (const char *signal, const char *method)
static bool connect (const QObject *sender, int signal_index, const QObject *receiver, int method_index, int type=0, int *types=0)
static void connectSlotsByName (QObject *o)
static bool disconnect (const QObject *sender, int signal_index, const QObject *receiver, int method_index)
static bool invokeMethod (QObject *obj, const char *member, QGenericArgument val0=QGenericArgument(0), QGenericArgument val1=QGenericArgument(), QGenericArgument val2=QGenericArgument(), QGenericArgument val3=QGenericArgument(), QGenericArgument val4=QGenericArgument(), QGenericArgument val5=QGenericArgument(), QGenericArgument val6=QGenericArgument(), QGenericArgument val7=QGenericArgument(), QGenericArgument val8=QGenericArgument(), QGenericArgument val9=QGenericArgument())
static bool invokeMethod (QObject *obj, const char *member, Qt::ConnectionType type, QGenericArgument val0=QGenericArgument(0), QGenericArgument val1=QGenericArgument(), QGenericArgument val2=QGenericArgument(), QGenericArgument val3=QGenericArgument(), QGenericArgument val4=QGenericArgument(), QGenericArgument val5=QGenericArgument(), QGenericArgument val6=QGenericArgument(), QGenericArgument val7=QGenericArgument(), QGenericArgument val8=QGenericArgument(), QGenericArgument val9=QGenericArgument())
static bool invokeMethod (QObject *obj, const char *member, QGenericReturnArgument ret, QGenericArgument val0=QGenericArgument(0), QGenericArgument val1=QGenericArgument(), QGenericArgument val2=QGenericArgument(), QGenericArgument val3=QGenericArgument(), QGenericArgument val4=QGenericArgument(), QGenericArgument val5=QGenericArgument(), QGenericArgument val6=QGenericArgument(), QGenericArgument val7=QGenericArgument(), QGenericArgument val8=QGenericArgument(), QGenericArgument val9=QGenericArgument())
static bool invokeMethod (QObject *obj, const char *member, Qt::ConnectionType, QGenericReturnArgument ret, QGenericArgument val0=QGenericArgument(0), QGenericArgument val1=QGenericArgument(), QGenericArgument val2=QGenericArgument(), QGenericArgument val3=QGenericArgument(), QGenericArgument val4=QGenericArgument(), QGenericArgument val5=QGenericArgument(), QGenericArgument val6=QGenericArgument(), QGenericArgument val7=QGenericArgument(), QGenericArgument val8=QGenericArgument(), QGenericArgument val9=QGenericArgument())
static QByteArray normalizedSignature (const char *method)
static QByteArray normalizedType (const char *type)
static void removeGuard (QObject **ptr)

Public Attributes

struct {
   const uint *   data
   const QMetaObject **   extradata
   const char *   stringdata
   const QMetaObject *   superdata
d

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

Generated by  Doxygen 1.6.0   Back to index