Skip to content

PythonQt.QtCore.QMetaObject

QMetaObject

PythonQtInstanceWrapper object

Native bases: PythonQtInstanceWrapper

Supplemental documentation: Qt 5 reference:

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 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().

Note: 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.

Source: https://doc.qt.io/archives/qt-5.15/qmetaobject.html

Complete member index

Every captured member retains its own identity. Identical captured declaration text is linked once; this does not establish native inheritance or interchangeable objects.

Member Kind Signature Summary
__init__ function (self, *args: Any, **kwargs: Any) -> None Native constructor; consult class documentation for supported overloads. (shared captured text)
checkConnectArgs function (self, signal: Any, method: Any) -> bool X.checkConnectArgs(signal, method) -> bool
classInfo function (self, index: int) -> Any X.classInfo(index) -> PythonQt.QtCore.QMetaClassInfo
classInfoCount function (self) -> int X.classInfoCount() -> int
classInfoOffset function (self) -> int X.classInfoOffset() -> int
className function (self, *args: Any, **kwargs: Any) -> str Return the classname of the object
constructor function (self, index: int) -> Any X.constructor(index) -> PythonQt.QtCore.QMetaMethod
constructorCount function (self) -> int X.constructorCount() -> int
delete function (self, *args: Any, **kwargs: Any) -> Any Deletes the C++ object (at your own risk, my friend!) (shared captured text)
enumerator function (self, index: int) -> Any X.enumerator(index) -> PythonQt.QtCore.QMetaEnum
enumeratorCount function (self) -> int X.enumeratorCount() -> int
enumeratorOffset function (self) -> int X.enumeratorOffset() -> int
getClassName function (self) -> int X.getClassName() -> int
help function (self, *args: Any, **kwargs: Any) -> Any Shows the help of available methods for this class (shared captured text)
indexOfClassInfo function (self, name: str) -> int X.indexOfClassInfo(name) -> int
indexOfConstructor function (self, constructor: str) -> int X.indexOfConstructor(constructor) -> int
indexOfEnumerator function (self, name: str) -> int X.indexOfEnumerator(name) -> int
indexOfMethod function (self, method: str) -> int X.indexOfMethod(method) -> int
indexOfProperty function (self, name: str) -> int X.indexOfProperty(name) -> int
indexOfSignal function (self, signal: str) -> int X.indexOfSignal(signal) -> int
indexOfSlot function (self, slot: str) -> int X.indexOfSlot(slot) -> int
inherits function (self, *args: Any, **kwargs: Any) -> bool Returns if the class inherits or is of given type name
method function (self, index: int) -> Any X.method(index) -> PythonQt.QtCore.QMetaMethod
methodCount function (self) -> int X.methodCount() -> int
methodOffset function (self) -> int X.methodOffset() -> int
normalizedSignature function (self, method: str) -> Any X.normalizedSignature(method) -> PythonQt.QtCore.QByteArray
normalizedType function (self, type: str) -> Any X.normalizedType(type) -> PythonQt.QtCore.QByteArray
property function (self, index: int) -> Any X.property(index) -> PythonQt.QtCore.QMetaProperty
propertyCount function (self) -> int X.propertyCount() -> int
propertyOffset function (self) -> int X.propertyOffset() -> int
superClass function (self) -> Any X.superClass() -> PythonQt.QtCore.QMetaObject
userProperty function (self) -> Any X.userProperty() -> PythonQt.QtCore.QMetaProperty