The PySide.QtCore.QMetaMethod class provides meta-data about a member function.
A PySide.QtCore.QMetaMethod has a PySide.QtCore.QMetaMethod.methodType() , a PySide.QtCore.QMetaMethod.signature() , a list of PySide.QtCore.QMetaMethod.parameterTypes() and PySide.QtCore.QMetaMethod.parameterNames() , a return PySide.QtCore.QMetaMethod.typeName() , a PySide.QtCore.QMetaMethod.tag() , and an PySide.QtCore.QMetaMethod.access() specifier. You can use PySide.QtCore.QMetaMethod.invoke() to invoke the method on an arbitrary PySide.QtCore.QObject .
A method will only be registered with the meta-object system if it is a slot, a signal, or declared with the Q_INVOKABLE() macro. Constructors can also be registered with Q_INVOKABLE() .
See also
PySide.QtCore.QMetaObject PySide.QtCore.QMetaEnum PySide.QtCore.QMetaProperty Qt’s Property System
Parameters: | QMetaMethod – PySide.QtCore.QMetaMethod |
---|
This enum describes the access level of a method, following the conventions used in C++.
Constant | Description |
---|---|
QMetaMethod.Private | |
QMetaMethod.Protected | |
QMetaMethod.Public |
Constant | Description |
---|---|
QMetaMethod.Method | The function is a plain member function. |
QMetaMethod.Signal | The function is a signal. |
QMetaMethod.Slot | The function is a slot. |
QMetaMethod.Constructor | The function is a constructor. |
Return type: | PySide.QtCore.QMetaMethod.Access |
---|
Returns the access specification of this method (private, protected, or public).
Signals are always protected, meaning that you can only emit them from the class or from a subclass.
Return type: | PySide.QtCore.QMetaObject |
---|
Parameters: |
|
---|---|
Return type: | PySide.QtCore.bool |
Parameters: |
|
---|---|
Return type: | PySide.QtCore.bool |
Parameters: |
|
---|---|
Return type: | PySide.QtCore.bool |
This function overloads PySide.QtCore.QMetaMethod.invoke() .
This overload always invokes this method using the connection type Qt.AutoConnection .
Parameters: |
|
---|---|
Return type: | PySide.QtCore.bool |
This function overloads PySide.QtCore.QMetaMethod.invoke() .
This overload invokes this method using the connection type Qt.AutoConnection and ignores return values.
Return type: | PySide.QtCore.int |
---|
Returns this method’s index.
Return type: | PySide.QtCore.QMetaMethod.MethodType |
---|
Returns the type of this method (signal, slot, or method).
See also
Return type: |
---|
Returns a list of parameter names.
Return type: |
---|
Returns a list of parameter types.
Return type: | PySide.QtCore.int |
---|
Returns the method revision if one was specified by Q_REVISION, otherwise returns 0.
Return type: | str |
---|
Returns the signature of this method (e.g., setValue(double) ).
Return type: | str |
---|
Returns the tag associated with this method.
Tags are special macros recognized by moc that make it possible to add extra information about a method.
Tag information can be added in the following way in the function declaration:
#define THISISTESTTAG // tag text
...
private slots:
THISISTESTTAG void testFunc();
and the information can be accessed by using:
MainWindow win;
win.show();
int functionIndex = win.metaObject()->indexOfSlot("testFunc()");
QMetaMethod mm = metaObject()->method(functionIndex);
qDebug() << mm.tag(); // prints THISISTESTTAG
For the moment, moc doesn’t support any special tags.
Return type: | str |
---|
Returns the return type of this method, or an empty string if the return type is void .