Qyoto
4.0.5
Qyoto is a C# language binding for Qt
|
The QMetaObject class contains meta-information about Qt objects. More...
Public Types | |
enum | Call { CreateInstance = 9, InvokeMetaMethod = 0, QueryPropertyDesignable = 4, QueryPropertyEditable = 7, QueryPropertyScriptable = 5, QueryPropertyStored = 6, QueryPropertyUser = 8, ReadProperty = 1, ResetProperty = 3, WriteProperty = 2 } |
Protected Member Functions | |
QMetaObject (System.Type dummy) | |
Protected Attributes | |
SmokeInvocation | interceptor |
Properties | |
virtual System.IntPtr | SmokeObject [get, set] |
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 invokable member functions).
enumerator() and enumeratorCount() and provide information about a class's enumerators.
propertyCount() and property() provide information about a class's properties.
constructor() and constructorCount() provide information about a class's meta-constructors.
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().
See also QMetaClassInfo, QMetaEnum, QMetaMethod, QMetaProperty, QMetaType, and Meta-Object System.
|
protected |
QtCore.QMetaObject.QMetaObject | ( | ) |
QtCore.QMetaObject.QMetaObject | ( | QMetaObject | copy | ) |
|
static |
|
static |
Returns true if the signal and method arguments are compatible; otherwise returns false.
Both signal and method are expected to be normalized.
See also normalizedSignature().
new QMetaClassInfo QtCore.QMetaObject.ClassInfo | ( | int | index | ) |
Returns the meta-data for the item of class information with the given index.
Example:
class MyClass : public QObject
{
Q_OBJECT
Q_CLASSINFO("author", "Sabrina Schweinsteiger")
Q_CLASSINFO("url", "http://doc.moosesoft.co.uk/1.0/")
public:
...
};
See also classInfoCount(), classInfoOffset(), and indexOfClassInfo().
new int QtCore.QMetaObject.ClassInfoCount | ( | ) |
Returns the number of items of class information in this class.
See also classInfo(), classInfoOffset(), and indexOfClassInfo().
new int QtCore.QMetaObject.ClassInfoOffset | ( | ) |
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 superclasses with class information, the offset is 0; otherwise the offset is the sum of all the class information items in the class's superclasses.
See also classInfo(), classInfoCount(), and indexOfClassInfo().
new string QtCore.QMetaObject.ClassName | ( | ) |
Returns the class name.
See also superClass().
|
static |
|
static |
|
static |
Searches recursively for all child objects of the given object, and connects matching signals from them to slots of object that follow the following form:
void on_<object name>_<signal name>(<signal parameters>);
Let's assume our object has a child object of type QPushButton with the object name button1. The slot to catch the button's clicked() signal would be:
void on_button1_clicked();
See also QObject::setObjectName().
new QMetaMethod QtCore.QMetaObject.Constructor | ( | int | index | ) |
Returns the meta-data for the constructor with the given index.
This function was introduced in Qt 4.5.
See also constructorCount() and newInstance().
new int QtCore.QMetaObject.ConstructorCount | ( | ) |
Returns the number of constructors in this class.
This function was introduced in Qt 4.5.
See also constructor() and indexOfConstructor().
|
virtual |
|
static |
|
static |
new void QtCore.QMetaObject.Dispose | ( | ) |
new QMetaEnum QtCore.QMetaObject.Enumerator | ( | int | index | ) |
Returns the meta-data for the enumerator with the given index.
See also enumeratorCount(), enumeratorOffset(), and indexOfEnumerator().
new int QtCore.QMetaObject.EnumeratorCount | ( | ) |
Returns the number of enumerators in this class.
See also enumerator(), enumeratorOffset(), and indexOfEnumerator().
new int QtCore.QMetaObject.EnumeratorOffset | ( | ) |
Returns the enumerator offset for this class; i.e. the index position of this class's first enumerator.
If the class has no superclasses with enumerators, the offset is 0; otherwise the offset is the sum of all the enumerators in the class's superclasses.
See also enumerator(), enumeratorCount(), and indexOfEnumerator().
new int QtCore.QMetaObject.IndexOfClassInfo | ( | string | name | ) |
Finds class information item name and returns its index; otherwise returns -1.
See also classInfo(), classInfoCount(), and classInfoOffset().
new int QtCore.QMetaObject.IndexOfConstructor | ( | string | constructor | ) |
Finds constructor and returns its index; otherwise returns -1.
Note that the constructor has to be in normalized form, as returned by normalizedSignature().
This function was introduced in Qt 4.5.
See also constructor(), constructorCount(), and normalizedSignature().
new int QtCore.QMetaObject.IndexOfEnumerator | ( | string | name | ) |
Finds enumerator name and returns its index; otherwise returns -1.
See also enumerator(), enumeratorCount(), and enumeratorOffset().
new int QtCore.QMetaObject.IndexOfMethod | ( | string | method | ) |
Finds method and returns its index; otherwise returns -1.
Note that the method has to be in normalized form, as returned by normalizedSignature().
See also method(), methodCount(), methodOffset(), and normalizedSignature().
new int QtCore.QMetaObject.IndexOfProperty | ( | string | name | ) |
Finds property name and returns its index; otherwise returns -1.
See also property(), propertyCount(), and propertyOffset().
new int QtCore.QMetaObject.IndexOfSignal | ( | string | signal | ) |
Finds signal and returns its index; otherwise returns -1.
This is the same as indexOfMethod(), except that it will return -1 if the method exists but isn't a signal.
Note that the signal has to be in normalized form, as returned by normalizedSignature().
See also indexOfMethod(), normalizedSignature(), method(), methodCount(), and methodOffset().
new int QtCore.QMetaObject.IndexOfSlot | ( | string | slot | ) |
Finds slot and returns its index; otherwise returns -1.
This is the same as indexOfMethod(), except that it will return -1 if the method exists but isn't a slot.
See also indexOfMethod(), method(), methodCount(), and methodOffset().
|
static |
Invokes the member (a signal or a slot name) on the object obj. Returns true if the member could be invoked. Returns false if there is no such member or the parameters did not match.
The invocation can be either synchronous or asynchronous, depending on type:
If type is Qt::DirectConnection, the member will be invoked immediately.
If type is Qt::QueuedConnection, a QEvent will be sent and the member is invoked as soon as the application enters the main event loop.
If type is Qt::BlockingQueuedConnection, the method will be invoked in the same way as for Qt::QueuedConnection, except that the current thread will block until the event is delivered. Using this connection type to communicate between objects in the same thread will lead to deadlocks.
If type is Qt::AutoConnection, the member is invoked synchronously if obj lives in the same thread as the caller; otherwise it will invoke the member asynchronously.
The return value of the member function call is placed in ret. If the invocation is asynchronous, the return value cannot be evaluated. You can pass up to ten arguments (val0, val1, val2, val3, val4, val5, val6, val7, val8, and val9) to the member function.
QGenericArgument and QGenericReturnArgument are internal helper classes. Because signals and slots can be dynamically invoked, you must enclose the arguments using the Q_ARG() and Q_RETURN_ARG() macros. Q_ARG() takes a type name and a const reference of that type; Q_RETURN_ARG() takes a type name and a non-const reference.
You only need to pass the name of the signal or slot to this function, not the entire signature. For example, to asynchronously invoke the animateClick() slot on a QPushButton, use the following code:
QMetaObject::invokeMethod(pushButton, "animateClick",
Qt::QueuedConnection);
With asynchronous method invocations, the parameters must be of types that are known to Qt's meta-object system, because Qt needs to copy the arguments to store them in an event behind the scenes. If you try to use a queued connection and get the error message
QMetaObject::invokeMethod: Unable to handle unregistered datatype 'MyType'
call qRegisterMetaType() to register the data type before you call invokeMethod().
To synchronously invoke the compute(QString, int, double) slot on some arbitrary object obj retrieve its return value:
QString retVal;
QMetaObject::invokeMethod(obj, "compute", Qt::DirectConnection,
Q_RETURN_ARG(QString, retVal),
Q_ARG(QString, "sqrt"),
Q_ARG(int, 42),
Q_ARG(double, 9.7));
If the "compute" slot does not take exactly one QString, one int and one double in the specified order, the call will fail.
See also Q_ARG(), Q_RETURN_ARG(), qRegisterMetaType(), and QMetaMethod::invoke().
|
static |
Invokes the member (a signal or a slot name) on the object obj. Returns true if the member could be invoked. Returns false if there is no such member or the parameters did not match.
The invocation can be either synchronous or asynchronous, depending on type:
If type is Qt::DirectConnection, the member will be invoked immediately.
If type is Qt::QueuedConnection, a QEvent will be sent and the member is invoked as soon as the application enters the main event loop.
If type is Qt::BlockingQueuedConnection, the method will be invoked in the same way as for Qt::QueuedConnection, except that the current thread will block until the event is delivered. Using this connection type to communicate between objects in the same thread will lead to deadlocks.
If type is Qt::AutoConnection, the member is invoked synchronously if obj lives in the same thread as the caller; otherwise it will invoke the member asynchronously.
The return value of the member function call is placed in ret. If the invocation is asynchronous, the return value cannot be evaluated. You can pass up to ten arguments (val0, val1, val2, val3, val4, val5, val6, val7, val8, and val9) to the member function.
QGenericArgument and QGenericReturnArgument are internal helper classes. Because signals and slots can be dynamically invoked, you must enclose the arguments using the Q_ARG() and Q_RETURN_ARG() macros. Q_ARG() takes a type name and a const reference of that type; Q_RETURN_ARG() takes a type name and a non-const reference.
You only need to pass the name of the signal or slot to this function, not the entire signature. For example, to asynchronously invoke the animateClick() slot on a QPushButton, use the following code:
QMetaObject::invokeMethod(pushButton, "animateClick",
Qt::QueuedConnection);
With asynchronous method invocations, the parameters must be of types that are known to Qt's meta-object system, because Qt needs to copy the arguments to store them in an event behind the scenes. If you try to use a queued connection and get the error message
QMetaObject::invokeMethod: Unable to handle unregistered datatype 'MyType'
call qRegisterMetaType() to register the data type before you call invokeMethod().
To synchronously invoke the compute(QString, int, double) slot on some arbitrary object obj retrieve its return value:
QString retVal;
QMetaObject::invokeMethod(obj, "compute", Qt::DirectConnection,
Q_RETURN_ARG(QString, retVal),
Q_ARG(QString, "sqrt"),
Q_ARG(int, 42),
Q_ARG(double, 9.7));
If the "compute" slot does not take exactly one QString, one int and one double in the specified order, the call will fail.
See also Q_ARG(), Q_RETURN_ARG(), qRegisterMetaType(), and QMetaMethod::invoke().
|
static |
Invokes the member (a signal or a slot name) on the object obj. Returns true if the member could be invoked. Returns false if there is no such member or the parameters did not match.
The invocation can be either synchronous or asynchronous, depending on type:
If type is Qt::DirectConnection, the member will be invoked immediately.
If type is Qt::QueuedConnection, a QEvent will be sent and the member is invoked as soon as the application enters the main event loop.
If type is Qt::BlockingQueuedConnection, the method will be invoked in the same way as for Qt::QueuedConnection, except that the current thread will block until the event is delivered. Using this connection type to communicate between objects in the same thread will lead to deadlocks.
If type is Qt::AutoConnection, the member is invoked synchronously if obj lives in the same thread as the caller; otherwise it will invoke the member asynchronously.
The return value of the member function call is placed in ret. If the invocation is asynchronous, the return value cannot be evaluated. You can pass up to ten arguments (val0, val1, val2, val3, val4, val5, val6, val7, val8, and val9) to the member function.
QGenericArgument and QGenericReturnArgument are internal helper classes. Because signals and slots can be dynamically invoked, you must enclose the arguments using the Q_ARG() and Q_RETURN_ARG() macros. Q_ARG() takes a type name and a const reference of that type; Q_RETURN_ARG() takes a type name and a non-const reference.
You only need to pass the name of the signal or slot to this function, not the entire signature. For example, to asynchronously invoke the animateClick() slot on a QPushButton, use the following code:
QMetaObject::invokeMethod(pushButton, "animateClick",
Qt::QueuedConnection);
With asynchronous method invocations, the parameters must be of types that are known to Qt's meta-object system, because Qt needs to copy the arguments to store them in an event behind the scenes. If you try to use a queued connection and get the error message
QMetaObject::invokeMethod: Unable to handle unregistered datatype 'MyType'
call qRegisterMetaType() to register the data type before you call invokeMethod().
To synchronously invoke the compute(QString, int, double) slot on some arbitrary object obj retrieve its return value:
QString retVal;
QMetaObject::invokeMethod(obj, "compute", Qt::DirectConnection,
Q_RETURN_ARG(QString, retVal),
Q_ARG(QString, "sqrt"),
Q_ARG(int, 42),
Q_ARG(double, 9.7));
If the "compute" slot does not take exactly one QString, one int and one double in the specified order, the call will fail.
See also Q_ARG(), Q_RETURN_ARG(), qRegisterMetaType(), and QMetaMethod::invoke().
|
static |
Invokes the member (a signal or a slot name) on the object obj. Returns true if the member could be invoked. Returns false if there is no such member or the parameters did not match.
The invocation can be either synchronous or asynchronous, depending on type:
If type is Qt::DirectConnection, the member will be invoked immediately.
If type is Qt::QueuedConnection, a QEvent will be sent and the member is invoked as soon as the application enters the main event loop.
If type is Qt::BlockingQueuedConnection, the method will be invoked in the same way as for Qt::QueuedConnection, except that the current thread will block until the event is delivered. Using this connection type to communicate between objects in the same thread will lead to deadlocks.
If type is Qt::AutoConnection, the member is invoked synchronously if obj lives in the same thread as the caller; otherwise it will invoke the member asynchronously.
The return value of the member function call is placed in ret. If the invocation is asynchronous, the return value cannot be evaluated. You can pass up to ten arguments (val0, val1, val2, val3, val4, val5, val6, val7, val8, and val9) to the member function.
QGenericArgument and QGenericReturnArgument are internal helper classes. Because signals and slots can be dynamically invoked, you must enclose the arguments using the Q_ARG() and Q_RETURN_ARG() macros. Q_ARG() takes a type name and a const reference of that type; Q_RETURN_ARG() takes a type name and a non-const reference.
You only need to pass the name of the signal or slot to this function, not the entire signature. For example, to asynchronously invoke the animateClick() slot on a QPushButton, use the following code:
QMetaObject::invokeMethod(pushButton, "animateClick",
Qt::QueuedConnection);
With asynchronous method invocations, the parameters must be of types that are known to Qt's meta-object system, because Qt needs to copy the arguments to store them in an event behind the scenes. If you try to use a queued connection and get the error message
QMetaObject::invokeMethod: Unable to handle unregistered datatype 'MyType'
call qRegisterMetaType() to register the data type before you call invokeMethod().
To synchronously invoke the compute(QString, int, double) slot on some arbitrary object obj retrieve its return value:
QString retVal;
QMetaObject::invokeMethod(obj, "compute", Qt::DirectConnection,
Q_RETURN_ARG(QString, retVal),
Q_ARG(QString, "sqrt"),
Q_ARG(int, 42),
Q_ARG(double, 9.7));
If the "compute" slot does not take exactly one QString, one int and one double in the specified order, the call will fail.
See also Q_ARG(), Q_RETURN_ARG(), qRegisterMetaType(), and QMetaMethod::invoke().
|
static |
Invokes the member (a signal or a slot name) on the object obj. Returns true if the member could be invoked. Returns false if there is no such member or the parameters did not match.
The invocation can be either synchronous or asynchronous, depending on type:
If type is Qt::DirectConnection, the member will be invoked immediately.
If type is Qt::QueuedConnection, a QEvent will be sent and the member is invoked as soon as the application enters the main event loop.
If type is Qt::BlockingQueuedConnection, the method will be invoked in the same way as for Qt::QueuedConnection, except that the current thread will block until the event is delivered. Using this connection type to communicate between objects in the same thread will lead to deadlocks.
If type is Qt::AutoConnection, the member is invoked synchronously if obj lives in the same thread as the caller; otherwise it will invoke the member asynchronously.
The return value of the member function call is placed in ret. If the invocation is asynchronous, the return value cannot be evaluated. You can pass up to ten arguments (val0, val1, val2, val3, val4, val5, val6, val7, val8, and val9) to the member function.
QGenericArgument and QGenericReturnArgument are internal helper classes. Because signals and slots can be dynamically invoked, you must enclose the arguments using the Q_ARG() and Q_RETURN_ARG() macros. Q_ARG() takes a type name and a const reference of that type; Q_RETURN_ARG() takes a type name and a non-const reference.
You only need to pass the name of the signal or slot to this function, not the entire signature. For example, to asynchronously invoke the animateClick() slot on a QPushButton, use the following code:
QMetaObject::invokeMethod(pushButton, "animateClick",
Qt::QueuedConnection);
With asynchronous method invocations, the parameters must be of types that are known to Qt's meta-object system, because Qt needs to copy the arguments to store them in an event behind the scenes. If you try to use a queued connection and get the error message
QMetaObject::invokeMethod: Unable to handle unregistered datatype 'MyType'
call qRegisterMetaType() to register the data type before you call invokeMethod().
To synchronously invoke the compute(QString, int, double) slot on some arbitrary object obj retrieve its return value:
QString retVal;
QMetaObject::invokeMethod(obj, "compute", Qt::DirectConnection,
Q_RETURN_ARG(QString, retVal),
Q_ARG(QString, "sqrt"),
Q_ARG(int, 42),
Q_ARG(double, 9.7));
If the "compute" slot does not take exactly one QString, one int and one double in the specified order, the call will fail.
See also Q_ARG(), Q_RETURN_ARG(), qRegisterMetaType(), and QMetaMethod::invoke().
|
static |
Invokes the member (a signal or a slot name) on the object obj. Returns true if the member could be invoked. Returns false if there is no such member or the parameters did not match.
The invocation can be either synchronous or asynchronous, depending on type:
If type is Qt::DirectConnection, the member will be invoked immediately.
If type is Qt::QueuedConnection, a QEvent will be sent and the member is invoked as soon as the application enters the main event loop.
If type is Qt::BlockingQueuedConnection, the method will be invoked in the same way as for Qt::QueuedConnection, except that the current thread will block until the event is delivered. Using this connection type to communicate between objects in the same thread will lead to deadlocks.
If type is Qt::AutoConnection, the member is invoked synchronously if obj lives in the same thread as the caller; otherwise it will invoke the member asynchronously.
The return value of the member function call is placed in ret. If the invocation is asynchronous, the return value cannot be evaluated. You can pass up to ten arguments (val0, val1, val2, val3, val4, val5, val6, val7, val8, and val9) to the member function.
QGenericArgument and QGenericReturnArgument are internal helper classes. Because signals and slots can be dynamically invoked, you must enclose the arguments using the Q_ARG() and Q_RETURN_ARG() macros. Q_ARG() takes a type name and a const reference of that type; Q_RETURN_ARG() takes a type name and a non-const reference.
You only need to pass the name of the signal or slot to this function, not the entire signature. For example, to asynchronously invoke the animateClick() slot on a QPushButton, use the following code:
QMetaObject::invokeMethod(pushButton, "animateClick",
Qt::QueuedConnection);
With asynchronous method invocations, the parameters must be of types that are known to Qt's meta-object system, because Qt needs to copy the arguments to store them in an event behind the scenes. If you try to use a queued connection and get the error message
QMetaObject::invokeMethod: Unable to handle unregistered datatype 'MyType'
call qRegisterMetaType() to register the data type before you call invokeMethod().
To synchronously invoke the compute(QString, int, double) slot on some arbitrary object obj retrieve its return value:
QString retVal;
QMetaObject::invokeMethod(obj, "compute", Qt::DirectConnection,
Q_RETURN_ARG(QString, retVal),
Q_ARG(QString, "sqrt"),
Q_ARG(int, 42),
Q_ARG(double, 9.7));
If the "compute" slot does not take exactly one QString, one int and one double in the specified order, the call will fail.
See also Q_ARG(), Q_RETURN_ARG(), qRegisterMetaType(), and QMetaMethod::invoke().
|
static |
Invokes the member (a signal or a slot name) on the object obj. Returns true if the member could be invoked. Returns false if there is no such member or the parameters did not match.
The invocation can be either synchronous or asynchronous, depending on type:
If type is Qt::DirectConnection, the member will be invoked immediately.
If type is Qt::QueuedConnection, a QEvent will be sent and the member is invoked as soon as the application enters the main event loop.
If type is Qt::BlockingQueuedConnection, the method will be invoked in the same way as for Qt::QueuedConnection, except that the current thread will block until the event is delivered. Using this connection type to communicate between objects in the same thread will lead to deadlocks.
If type is Qt::AutoConnection, the member is invoked synchronously if obj lives in the same thread as the caller; otherwise it will invoke the member asynchronously.
The return value of the member function call is placed in ret. If the invocation is asynchronous, the return value cannot be evaluated. You can pass up to ten arguments (val0, val1, val2, val3, val4, val5, val6, val7, val8, and val9) to the member function.
QGenericArgument and QGenericReturnArgument are internal helper classes. Because signals and slots can be dynamically invoked, you must enclose the arguments using the Q_ARG() and Q_RETURN_ARG() macros. Q_ARG() takes a type name and a const reference of that type; Q_RETURN_ARG() takes a type name and a non-const reference.
You only need to pass the name of the signal or slot to this function, not the entire signature. For example, to asynchronously invoke the animateClick() slot on a QPushButton, use the following code:
QMetaObject::invokeMethod(pushButton, "animateClick",
Qt::QueuedConnection);
With asynchronous method invocations, the parameters must be of types that are known to Qt's meta-object system, because Qt needs to copy the arguments to store them in an event behind the scenes. If you try to use a queued connection and get the error message
QMetaObject::invokeMethod: Unable to handle unregistered datatype 'MyType'
call qRegisterMetaType() to register the data type before you call invokeMethod().
To synchronously invoke the compute(QString, int, double) slot on some arbitrary object obj retrieve its return value:
QString retVal;
QMetaObject::invokeMethod(obj, "compute", Qt::DirectConnection,
Q_RETURN_ARG(QString, retVal),
Q_ARG(QString, "sqrt"),
Q_ARG(int, 42),
Q_ARG(double, 9.7));
If the "compute" slot does not take exactly one QString, one int and one double in the specified order, the call will fail.
See also Q_ARG(), Q_RETURN_ARG(), qRegisterMetaType(), and QMetaMethod::invoke().
|
static |
Invokes the member (a signal or a slot name) on the object obj. Returns true if the member could be invoked. Returns false if there is no such member or the parameters did not match.
The invocation can be either synchronous or asynchronous, depending on type:
If type is Qt::DirectConnection, the member will be invoked immediately.
If type is Qt::QueuedConnection, a QEvent will be sent and the member is invoked as soon as the application enters the main event loop.
If type is Qt::BlockingQueuedConnection, the method will be invoked in the same way as for Qt::QueuedConnection, except that the current thread will block until the event is delivered. Using this connection type to communicate between objects in the same thread will lead to deadlocks.
If type is Qt::AutoConnection, the member is invoked synchronously if obj lives in the same thread as the caller; otherwise it will invoke the member asynchronously.
The return value of the member function call is placed in ret. If the invocation is asynchronous, the return value cannot be evaluated. You can pass up to ten arguments (val0, val1, val2, val3, val4, val5, val6, val7, val8, and val9) to the member function.
QGenericArgument and QGenericReturnArgument are internal helper classes. Because signals and slots can be dynamically invoked, you must enclose the arguments using the Q_ARG() and Q_RETURN_ARG() macros. Q_ARG() takes a type name and a const reference of that type; Q_RETURN_ARG() takes a type name and a non-const reference.
You only need to pass the name of the signal or slot to this function, not the entire signature. For example, to asynchronously invoke the animateClick() slot on a QPushButton, use the following code:
QMetaObject::invokeMethod(pushButton, "animateClick",
Qt::QueuedConnection);
With asynchronous method invocations, the parameters must be of types that are known to Qt's meta-object system, because Qt needs to copy the arguments to store them in an event behind the scenes. If you try to use a queued connection and get the error message
QMetaObject::invokeMethod: Unable to handle unregistered datatype 'MyType'
call qRegisterMetaType() to register the data type before you call invokeMethod().
To synchronously invoke the compute(QString, int, double) slot on some arbitrary object obj retrieve its return value:
QString retVal;
QMetaObject::invokeMethod(obj, "compute", Qt::DirectConnection,
Q_RETURN_ARG(QString, retVal),
Q_ARG(QString, "sqrt"),
Q_ARG(int, 42),
Q_ARG(double, 9.7));
If the "compute" slot does not take exactly one QString, one int and one double in the specified order, the call will fail.
See also Q_ARG(), Q_RETURN_ARG(), qRegisterMetaType(), and QMetaMethod::invoke().
|
static |
Invokes the member (a signal or a slot name) on the object obj. Returns true if the member could be invoked. Returns false if there is no such member or the parameters did not match.
The invocation can be either synchronous or asynchronous, depending on type:
If type is Qt::DirectConnection, the member will be invoked immediately.
If type is Qt::QueuedConnection, a QEvent will be sent and the member is invoked as soon as the application enters the main event loop.
If type is Qt::BlockingQueuedConnection, the method will be invoked in the same way as for Qt::QueuedConnection, except that the current thread will block until the event is delivered. Using this connection type to communicate between objects in the same thread will lead to deadlocks.
If type is Qt::AutoConnection, the member is invoked synchronously if obj lives in the same thread as the caller; otherwise it will invoke the member asynchronously.
The return value of the member function call is placed in ret. If the invocation is asynchronous, the return value cannot be evaluated. You can pass up to ten arguments (val0, val1, val2, val3, val4, val5, val6, val7, val8, and val9) to the member function.
QGenericArgument and QGenericReturnArgument are internal helper classes. Because signals and slots can be dynamically invoked, you must enclose the arguments using the Q_ARG() and Q_RETURN_ARG() macros. Q_ARG() takes a type name and a const reference of that type; Q_RETURN_ARG() takes a type name and a non-const reference.
You only need to pass the name of the signal or slot to this function, not the entire signature. For example, to asynchronously invoke the animateClick() slot on a QPushButton, use the following code:
QMetaObject::invokeMethod(pushButton, "animateClick",
Qt::QueuedConnection);
With asynchronous method invocations, the parameters must be of types that are known to Qt's meta-object system, because Qt needs to copy the arguments to store them in an event behind the scenes. If you try to use a queued connection and get the error message
QMetaObject::invokeMethod: Unable to handle unregistered datatype 'MyType'
call qRegisterMetaType() to register the data type before you call invokeMethod().
To synchronously invoke the compute(QString, int, double) slot on some arbitrary object obj retrieve its return value:
QString retVal;
QMetaObject::invokeMethod(obj, "compute", Qt::DirectConnection,
Q_RETURN_ARG(QString, retVal),
Q_ARG(QString, "sqrt"),
Q_ARG(int, 42),
Q_ARG(double, 9.7));
If the "compute" slot does not take exactly one QString, one int and one double in the specified order, the call will fail.
See also Q_ARG(), Q_RETURN_ARG(), qRegisterMetaType(), and QMetaMethod::invoke().
|
static |
Invokes the member (a signal or a slot name) on the object obj. Returns true if the member could be invoked. Returns false if there is no such member or the parameters did not match.
The invocation can be either synchronous or asynchronous, depending on type:
If type is Qt::DirectConnection, the member will be invoked immediately.
If type is Qt::QueuedConnection, a QEvent will be sent and the member is invoked as soon as the application enters the main event loop.
If type is Qt::BlockingQueuedConnection, the method will be invoked in the same way as for Qt::QueuedConnection, except that the current thread will block until the event is delivered. Using this connection type to communicate between objects in the same thread will lead to deadlocks.
If type is Qt::AutoConnection, the member is invoked synchronously if obj lives in the same thread as the caller; otherwise it will invoke the member asynchronously.
The return value of the member function call is placed in ret. If the invocation is asynchronous, the return value cannot be evaluated. You can pass up to ten arguments (val0, val1, val2, val3, val4, val5, val6, val7, val8, and val9) to the member function.
QGenericArgument and QGenericReturnArgument are internal helper classes. Because signals and slots can be dynamically invoked, you must enclose the arguments using the Q_ARG() and Q_RETURN_ARG() macros. Q_ARG() takes a type name and a const reference of that type; Q_RETURN_ARG() takes a type name and a non-const reference.
You only need to pass the name of the signal or slot to this function, not the entire signature. For example, to asynchronously invoke the animateClick() slot on a QPushButton, use the following code:
QMetaObject::invokeMethod(pushButton, "animateClick",
Qt::QueuedConnection);
With asynchronous method invocations, the parameters must be of types that are known to Qt's meta-object system, because Qt needs to copy the arguments to store them in an event behind the scenes. If you try to use a queued connection and get the error message
QMetaObject::invokeMethod: Unable to handle unregistered datatype 'MyType'
call qRegisterMetaType() to register the data type before you call invokeMethod().
To synchronously invoke the compute(QString, int, double) slot on some arbitrary object obj retrieve its return value:
QString retVal;
QMetaObject::invokeMethod(obj, "compute", Qt::DirectConnection,
Q_RETURN_ARG(QString, retVal),
Q_ARG(QString, "sqrt"),
Q_ARG(int, 42),
Q_ARG(double, 9.7));
If the "compute" slot does not take exactly one QString, one int and one double in the specified order, the call will fail.
See also Q_ARG(), Q_RETURN_ARG(), qRegisterMetaType(), and QMetaMethod::invoke().
|
static |
Invokes the member (a signal or a slot name) on the object obj. Returns true if the member could be invoked. Returns false if there is no such member or the parameters did not match.
The invocation can be either synchronous or asynchronous, depending on type:
If type is Qt::DirectConnection, the member will be invoked immediately.
If type is Qt::QueuedConnection, a QEvent will be sent and the member is invoked as soon as the application enters the main event loop.
If type is Qt::BlockingQueuedConnection, the method will be invoked in the same way as for Qt::QueuedConnection, except that the current thread will block until the event is delivered. Using this connection type to communicate between objects in the same thread will lead to deadlocks.
If type is Qt::AutoConnection, the member is invoked synchronously if obj lives in the same thread as the caller; otherwise it will invoke the member asynchronously.
The return value of the member function call is placed in ret. If the invocation is asynchronous, the return value cannot be evaluated. You can pass up to ten arguments (val0, val1, val2, val3, val4, val5, val6, val7, val8, and val9) to the member function.
QGenericArgument and QGenericReturnArgument are internal helper classes. Because signals and slots can be dynamically invoked, you must enclose the arguments using the Q_ARG() and Q_RETURN_ARG() macros. Q_ARG() takes a type name and a const reference of that type; Q_RETURN_ARG() takes a type name and a non-const reference.
You only need to pass the name of the signal or slot to this function, not the entire signature. For example, to asynchronously invoke the animateClick() slot on a QPushButton, use the following code:
QMetaObject::invokeMethod(pushButton, "animateClick",
Qt::QueuedConnection);
With asynchronous method invocations, the parameters must be of types that are known to Qt's meta-object system, because Qt needs to copy the arguments to store them in an event behind the scenes. If you try to use a queued connection and get the error message
QMetaObject::invokeMethod: Unable to handle unregistered datatype 'MyType'
call qRegisterMetaType() to register the data type before you call invokeMethod().
To synchronously invoke the compute(QString, int, double) slot on some arbitrary object obj retrieve its return value:
QString retVal;
QMetaObject::invokeMethod(obj, "compute", Qt::DirectConnection,
Q_RETURN_ARG(QString, retVal),
Q_ARG(QString, "sqrt"),
Q_ARG(int, 42),
Q_ARG(double, 9.7));
If the "compute" slot does not take exactly one QString, one int and one double in the specified order, the call will fail.
See also Q_ARG(), Q_RETURN_ARG(), qRegisterMetaType(), and QMetaMethod::invoke().
|
static |
Invokes the member (a signal or a slot name) on the object obj. Returns true if the member could be invoked. Returns false if there is no such member or the parameters did not match.
The invocation can be either synchronous or asynchronous, depending on type:
If type is Qt::DirectConnection, the member will be invoked immediately.
If type is Qt::QueuedConnection, a QEvent will be sent and the member is invoked as soon as the application enters the main event loop.
If type is Qt::BlockingQueuedConnection, the method will be invoked in the same way as for Qt::QueuedConnection, except that the current thread will block until the event is delivered. Using this connection type to communicate between objects in the same thread will lead to deadlocks.
If type is Qt::AutoConnection, the member is invoked synchronously if obj lives in the same thread as the caller; otherwise it will invoke the member asynchronously.
The return value of the member function call is placed in ret. If the invocation is asynchronous, the return value cannot be evaluated. You can pass up to ten arguments (val0, val1, val2, val3, val4, val5, val6, val7, val8, and val9) to the member function.
QGenericArgument and QGenericReturnArgument are internal helper classes. Because signals and slots can be dynamically invoked, you must enclose the arguments using the Q_ARG() and Q_RETURN_ARG() macros. Q_ARG() takes a type name and a const reference of that type; Q_RETURN_ARG() takes a type name and a non-const reference.
You only need to pass the name of the signal or slot to this function, not the entire signature. For example, to asynchronously invoke the animateClick() slot on a QPushButton, use the following code:
QMetaObject::invokeMethod(pushButton, "animateClick",
Qt::QueuedConnection);
With asynchronous method invocations, the parameters must be of types that are known to Qt's meta-object system, because Qt needs to copy the arguments to store them in an event behind the scenes. If you try to use a queued connection and get the error message
QMetaObject::invokeMethod: Unable to handle unregistered datatype 'MyType'
call qRegisterMetaType() to register the data type before you call invokeMethod().
To synchronously invoke the compute(QString, int, double) slot on some arbitrary object obj retrieve its return value:
QString retVal;
QMetaObject::invokeMethod(obj, "compute", Qt::DirectConnection,
Q_RETURN_ARG(QString, retVal),
Q_ARG(QString, "sqrt"),
Q_ARG(int, 42),
Q_ARG(double, 9.7));
If the "compute" slot does not take exactly one QString, one int and one double in the specified order, the call will fail.
See also Q_ARG(), Q_RETURN_ARG(), qRegisterMetaType(), and QMetaMethod::invoke().
|
static |
Invokes the member (a signal or a slot name) on the object obj. Returns true if the member could be invoked. Returns false if there is no such member or the parameters did not match.
The invocation can be either synchronous or asynchronous, depending on type:
If type is Qt::DirectConnection, the member will be invoked immediately.
If type is Qt::QueuedConnection, a QEvent will be sent and the member is invoked as soon as the application enters the main event loop.
If type is Qt::BlockingQueuedConnection, the method will be invoked in the same way as for Qt::QueuedConnection, except that the current thread will block until the event is delivered. Using this connection type to communicate between objects in the same thread will lead to deadlocks.
If type is Qt::AutoConnection, the member is invoked synchronously if obj lives in the same thread as the caller; otherwise it will invoke the member asynchronously.
The return value of the member function call is placed in ret. If the invocation is asynchronous, the return value cannot be evaluated. You can pass up to ten arguments (val0, val1, val2, val3, val4, val5, val6, val7, val8, and val9) to the member function.
QGenericArgument and QGenericReturnArgument are internal helper classes. Because signals and slots can be dynamically invoked, you must enclose the arguments using the Q_ARG() and Q_RETURN_ARG() macros. Q_ARG() takes a type name and a const reference of that type; Q_RETURN_ARG() takes a type name and a non-const reference.
You only need to pass the name of the signal or slot to this function, not the entire signature. For example, to asynchronously invoke the animateClick() slot on a QPushButton, use the following code:
QMetaObject::invokeMethod(pushButton, "animateClick",
Qt::QueuedConnection);
With asynchronous method invocations, the parameters must be of types that are known to Qt's meta-object system, because Qt needs to copy the arguments to store them in an event behind the scenes. If you try to use a queued connection and get the error message
QMetaObject::invokeMethod: Unable to handle unregistered datatype 'MyType'
call qRegisterMetaType() to register the data type before you call invokeMethod().
To synchronously invoke the compute(QString, int, double) slot on some arbitrary object obj retrieve its return value:
QString retVal;
QMetaObject::invokeMethod(obj, "compute", Qt::DirectConnection,
Q_RETURN_ARG(QString, retVal),
Q_ARG(QString, "sqrt"),
Q_ARG(int, 42),
Q_ARG(double, 9.7));
If the "compute" slot does not take exactly one QString, one int and one double in the specified order, the call will fail.
See also Q_ARG(), Q_RETURN_ARG(), qRegisterMetaType(), and QMetaMethod::invoke().
|
static |
Invokes the member (a signal or a slot name) on the object obj. Returns true if the member could be invoked. Returns false if there is no such member or the parameters did not match.
The invocation can be either synchronous or asynchronous, depending on type:
If type is Qt::DirectConnection, the member will be invoked immediately.
If type is Qt::QueuedConnection, a QEvent will be sent and the member is invoked as soon as the application enters the main event loop.
If type is Qt::BlockingQueuedConnection, the method will be invoked in the same way as for Qt::QueuedConnection, except that the current thread will block until the event is delivered. Using this connection type to communicate between objects in the same thread will lead to deadlocks.
If type is Qt::AutoConnection, the member is invoked synchronously if obj lives in the same thread as the caller; otherwise it will invoke the member asynchronously.
The return value of the member function call is placed in ret. If the invocation is asynchronous, the return value cannot be evaluated. You can pass up to ten arguments (val0, val1, val2, val3, val4, val5, val6, val7, val8, and val9) to the member function.
QGenericArgument and QGenericReturnArgument are internal helper classes. Because signals and slots can be dynamically invoked, you must enclose the arguments using the Q_ARG() and Q_RETURN_ARG() macros. Q_ARG() takes a type name and a const reference of that type; Q_RETURN_ARG() takes a type name and a non-const reference.
You only need to pass the name of the signal or slot to this function, not the entire signature. For example, to asynchronously invoke the animateClick() slot on a QPushButton, use the following code:
QMetaObject::invokeMethod(pushButton, "animateClick",
Qt::QueuedConnection);
With asynchronous method invocations, the parameters must be of types that are known to Qt's meta-object system, because Qt needs to copy the arguments to store them in an event behind the scenes. If you try to use a queued connection and get the error message
QMetaObject::invokeMethod: Unable to handle unregistered datatype 'MyType'
call qRegisterMetaType() to register the data type before you call invokeMethod().
To synchronously invoke the compute(QString, int, double) slot on some arbitrary object obj retrieve its return value:
QString retVal;
QMetaObject::invokeMethod(obj, "compute", Qt::DirectConnection,
Q_RETURN_ARG(QString, retVal),
Q_ARG(QString, "sqrt"),
Q_ARG(int, 42),
Q_ARG(double, 9.7));
If the "compute" slot does not take exactly one QString, one int and one double in the specified order, the call will fail.
See also Q_ARG(), Q_RETURN_ARG(), qRegisterMetaType(), and QMetaMethod::invoke().
|
static |
Invokes the member (a signal or a slot name) on the object obj. Returns true if the member could be invoked. Returns false if there is no such member or the parameters did not match.
The invocation can be either synchronous or asynchronous, depending on type:
If type is Qt::DirectConnection, the member will be invoked immediately.
If type is Qt::QueuedConnection, a QEvent will be sent and the member is invoked as soon as the application enters the main event loop.
If type is Qt::BlockingQueuedConnection, the method will be invoked in the same way as for Qt::QueuedConnection, except that the current thread will block until the event is delivered. Using this connection type to communicate between objects in the same thread will lead to deadlocks.
If type is Qt::AutoConnection, the member is invoked synchronously if obj lives in the same thread as the caller; otherwise it will invoke the member asynchronously.
The return value of the member function call is placed in ret. If the invocation is asynchronous, the return value cannot be evaluated. You can pass up to ten arguments (val0, val1, val2, val3, val4, val5, val6, val7, val8, and val9) to the member function.
QGenericArgument and QGenericReturnArgument are internal helper classes. Because signals and slots can be dynamically invoked, you must enclose the arguments using the Q_ARG() and Q_RETURN_ARG() macros. Q_ARG() takes a type name and a const reference of that type; Q_RETURN_ARG() takes a type name and a non-const reference.
You only need to pass the name of the signal or slot to this function, not the entire signature. For example, to asynchronously invoke the animateClick() slot on a QPushButton, use the following code:
QMetaObject::invokeMethod(pushButton, "animateClick",
Qt::QueuedConnection);
With asynchronous method invocations, the parameters must be of types that are known to Qt's meta-object system, because Qt needs to copy the arguments to store them in an event behind the scenes. If you try to use a queued connection and get the error message
QMetaObject::invokeMethod: Unable to handle unregistered datatype 'MyType'
call qRegisterMetaType() to register the data type before you call invokeMethod().
To synchronously invoke the compute(QString, int, double) slot on some arbitrary object obj retrieve its return value:
QString retVal;
QMetaObject::invokeMethod(obj, "compute", Qt::DirectConnection,
Q_RETURN_ARG(QString, retVal),
Q_ARG(QString, "sqrt"),
Q_ARG(int, 42),
Q_ARG(double, 9.7));
If the "compute" slot does not take exactly one QString, one int and one double in the specified order, the call will fail.
See also Q_ARG(), Q_RETURN_ARG(), qRegisterMetaType(), and QMetaMethod::invoke().
|
static |
Invokes the member (a signal or a slot name) on the object obj. Returns true if the member could be invoked. Returns false if there is no such member or the parameters did not match.
The invocation can be either synchronous or asynchronous, depending on type:
If type is Qt::DirectConnection, the member will be invoked immediately.
If type is Qt::QueuedConnection, a QEvent will be sent and the member is invoked as soon as the application enters the main event loop.
If type is Qt::BlockingQueuedConnection, the method will be invoked in the same way as for Qt::QueuedConnection, except that the current thread will block until the event is delivered. Using this connection type to communicate between objects in the same thread will lead to deadlocks.
If type is Qt::AutoConnection, the member is invoked synchronously if obj lives in the same thread as the caller; otherwise it will invoke the member asynchronously.
The return value of the member function call is placed in ret. If the invocation is asynchronous, the return value cannot be evaluated. You can pass up to ten arguments (val0, val1, val2, val3, val4, val5, val6, val7, val8, and val9) to the member function.
QGenericArgument and QGenericReturnArgument are internal helper classes. Because signals and slots can be dynamically invoked, you must enclose the arguments using the Q_ARG() and Q_RETURN_ARG() macros. Q_ARG() takes a type name and a const reference of that type; Q_RETURN_ARG() takes a type name and a non-const reference.
You only need to pass the name of the signal or slot to this function, not the entire signature. For example, to asynchronously invoke the animateClick() slot on a QPushButton, use the following code:
QMetaObject::invokeMethod(pushButton, "animateClick",
Qt::QueuedConnection);
With asynchronous method invocations, the parameters must be of types that are known to Qt's meta-object system, because Qt needs to copy the arguments to store them in an event behind the scenes. If you try to use a queued connection and get the error message
QMetaObject::invokeMethod: Unable to handle unregistered datatype 'MyType'
call qRegisterMetaType() to register the data type before you call invokeMethod().
To synchronously invoke the compute(QString, int, double) slot on some arbitrary object obj retrieve its return value:
QString retVal;
QMetaObject::invokeMethod(obj, "compute", Qt::DirectConnection,
Q_RETURN_ARG(QString, retVal),
Q_ARG(QString, "sqrt"),
Q_ARG(int, 42),
Q_ARG(double, 9.7));
If the "compute" slot does not take exactly one QString, one int and one double in the specified order, the call will fail.
See also Q_ARG(), Q_RETURN_ARG(), qRegisterMetaType(), and QMetaMethod::invoke().
|
static |
Invokes the member (a signal or a slot name) on the object obj. Returns true if the member could be invoked. Returns false if there is no such member or the parameters did not match.
The invocation can be either synchronous or asynchronous, depending on type:
If type is Qt::DirectConnection, the member will be invoked immediately.
If type is Qt::QueuedConnection, a QEvent will be sent and the member is invoked as soon as the application enters the main event loop.
If type is Qt::BlockingQueuedConnection, the method will be invoked in the same way as for Qt::QueuedConnection, except that the current thread will block until the event is delivered. Using this connection type to communicate between objects in the same thread will lead to deadlocks.
If type is Qt::AutoConnection, the member is invoked synchronously if obj lives in the same thread as the caller; otherwise it will invoke the member asynchronously.
The return value of the member function call is placed in ret. If the invocation is asynchronous, the return value cannot be evaluated. You can pass up to ten arguments (val0, val1, val2, val3, val4, val5, val6, val7, val8, and val9) to the member function.
QGenericArgument and QGenericReturnArgument are internal helper classes. Because signals and slots can be dynamically invoked, you must enclose the arguments using the Q_ARG() and Q_RETURN_ARG() macros. Q_ARG() takes a type name and a const reference of that type; Q_RETURN_ARG() takes a type name and a non-const reference.
You only need to pass the name of the signal or slot to this function, not the entire signature. For example, to asynchronously invoke the animateClick() slot on a QPushButton, use the following code:
QMetaObject::invokeMethod(pushButton, "animateClick",
Qt::QueuedConnection);
With asynchronous method invocations, the parameters must be of types that are known to Qt's meta-object system, because Qt needs to copy the arguments to store them in an event behind the scenes. If you try to use a queued connection and get the error message
QMetaObject::invokeMethod: Unable to handle unregistered datatype 'MyType'
call qRegisterMetaType() to register the data type before you call invokeMethod().
To synchronously invoke the compute(QString, int, double) slot on some arbitrary object obj retrieve its return value:
QString retVal;
QMetaObject::invokeMethod(obj, "compute", Qt::DirectConnection,
Q_RETURN_ARG(QString, retVal),
Q_ARG(QString, "sqrt"),
Q_ARG(int, 42),
Q_ARG(double, 9.7));
If the "compute" slot does not take exactly one QString, one int and one double in the specified order, the call will fail.
See also Q_ARG(), Q_RETURN_ARG(), qRegisterMetaType(), and QMetaMethod::invoke().
|
static |
Invokes the member (a signal or a slot name) on the object obj. Returns true if the member could be invoked. Returns false if there is no such member or the parameters did not match.
The invocation can be either synchronous or asynchronous, depending on type:
If type is Qt::DirectConnection, the member will be invoked immediately.
If type is Qt::QueuedConnection, a QEvent will be sent and the member is invoked as soon as the application enters the main event loop.
If type is Qt::BlockingQueuedConnection, the method will be invoked in the same way as for Qt::QueuedConnection, except that the current thread will block until the event is delivered. Using this connection type to communicate between objects in the same thread will lead to deadlocks.
If type is Qt::AutoConnection, the member is invoked synchronously if obj lives in the same thread as the caller; otherwise it will invoke the member asynchronously.
The return value of the member function call is placed in ret. If the invocation is asynchronous, the return value cannot be evaluated. You can pass up to ten arguments (val0, val1, val2, val3, val4, val5, val6, val7, val8, and val9) to the member function.
QGenericArgument and QGenericReturnArgument are internal helper classes. Because signals and slots can be dynamically invoked, you must enclose the arguments using the Q_ARG() and Q_RETURN_ARG() macros. Q_ARG() takes a type name and a const reference of that type; Q_RETURN_ARG() takes a type name and a non-const reference.
You only need to pass the name of the signal or slot to this function, not the entire signature. For example, to asynchronously invoke the animateClick() slot on a QPushButton, use the following code:
QMetaObject::invokeMethod(pushButton, "animateClick",
Qt::QueuedConnection);
With asynchronous method invocations, the parameters must be of types that are known to Qt's meta-object system, because Qt needs to copy the arguments to store them in an event behind the scenes. If you try to use a queued connection and get the error message
QMetaObject::invokeMethod: Unable to handle unregistered datatype 'MyType'
call qRegisterMetaType() to register the data type before you call invokeMethod().
To synchronously invoke the compute(QString, int, double) slot on some arbitrary object obj retrieve its return value:
QString retVal;
QMetaObject::invokeMethod(obj, "compute", Qt::DirectConnection,
Q_RETURN_ARG(QString, retVal),
Q_ARG(QString, "sqrt"),
Q_ARG(int, 42),
Q_ARG(double, 9.7));
If the "compute" slot does not take exactly one QString, one int and one double in the specified order, the call will fail.
See also Q_ARG(), Q_RETURN_ARG(), qRegisterMetaType(), and QMetaMethod::invoke().
|
static |
Invokes the member (a signal or a slot name) on the object obj. Returns true if the member could be invoked. Returns false if there is no such member or the parameters did not match.
The invocation can be either synchronous or asynchronous, depending on type:
If type is Qt::DirectConnection, the member will be invoked immediately.
If type is Qt::QueuedConnection, a QEvent will be sent and the member is invoked as soon as the application enters the main event loop.
If type is Qt::BlockingQueuedConnection, the method will be invoked in the same way as for Qt::QueuedConnection, except that the current thread will block until the event is delivered. Using this connection type to communicate between objects in the same thread will lead to deadlocks.
If type is Qt::AutoConnection, the member is invoked synchronously if obj lives in the same thread as the caller; otherwise it will invoke the member asynchronously.
The return value of the member function call is placed in ret. If the invocation is asynchronous, the return value cannot be evaluated. You can pass up to ten arguments (val0, val1, val2, val3, val4, val5, val6, val7, val8, and val9) to the member function.
QGenericArgument and QGenericReturnArgument are internal helper classes. Because signals and slots can be dynamically invoked, you must enclose the arguments using the Q_ARG() and Q_RETURN_ARG() macros. Q_ARG() takes a type name and a const reference of that type; Q_RETURN_ARG() takes a type name and a non-const reference.
You only need to pass the name of the signal or slot to this function, not the entire signature. For example, to asynchronously invoke the animateClick() slot on a QPushButton, use the following code:
QMetaObject::invokeMethod(pushButton, "animateClick",
Qt::QueuedConnection);
With asynchronous method invocations, the parameters must be of types that are known to Qt's meta-object system, because Qt needs to copy the arguments to store them in an event behind the scenes. If you try to use a queued connection and get the error message
QMetaObject::invokeMethod: Unable to handle unregistered datatype 'MyType'
call qRegisterMetaType() to register the data type before you call invokeMethod().
To synchronously invoke the compute(QString, int, double) slot on some arbitrary object obj retrieve its return value:
QString retVal;
QMetaObject::invokeMethod(obj, "compute", Qt::DirectConnection,
Q_RETURN_ARG(QString, retVal),
Q_ARG(QString, "sqrt"),
Q_ARG(int, 42),
Q_ARG(double, 9.7));
If the "compute" slot does not take exactly one QString, one int and one double in the specified order, the call will fail.
See also Q_ARG(), Q_RETURN_ARG(), qRegisterMetaType(), and QMetaMethod::invoke().
|
static |
Invokes the member (a signal or a slot name) on the object obj. Returns true if the member could be invoked. Returns false if there is no such member or the parameters did not match.
The invocation can be either synchronous or asynchronous, depending on type:
If type is Qt::DirectConnection, the member will be invoked immediately.
If type is Qt::QueuedConnection, a QEvent will be sent and the member is invoked as soon as the application enters the main event loop.
If type is Qt::BlockingQueuedConnection, the method will be invoked in the same way as for Qt::QueuedConnection, except that the current thread will block until the event is delivered. Using this connection type to communicate between objects in the same thread will lead to deadlocks.
If type is Qt::AutoConnection, the member is invoked synchronously if obj lives in the same thread as the caller; otherwise it will invoke the member asynchronously.
The return value of the member function call is placed in ret. If the invocation is asynchronous, the return value cannot be evaluated. You can pass up to ten arguments (val0, val1, val2, val3, val4, val5, val6, val7, val8, and val9) to the member function.
QGenericArgument and QGenericReturnArgument are internal helper classes. Because signals and slots can be dynamically invoked, you must enclose the arguments using the Q_ARG() and Q_RETURN_ARG() macros. Q_ARG() takes a type name and a const reference of that type; Q_RETURN_ARG() takes a type name and a non-const reference.
You only need to pass the name of the signal or slot to this function, not the entire signature. For example, to asynchronously invoke the animateClick() slot on a QPushButton, use the following code:
QMetaObject::invokeMethod(pushButton, "animateClick",
Qt::QueuedConnection);
With asynchronous method invocations, the parameters must be of types that are known to Qt's meta-object system, because Qt needs to copy the arguments to store them in an event behind the scenes. If you try to use a queued connection and get the error message
QMetaObject::invokeMethod: Unable to handle unregistered datatype 'MyType'
call qRegisterMetaType() to register the data type before you call invokeMethod().
To synchronously invoke the compute(QString, int, double) slot on some arbitrary object obj retrieve its return value:
QString retVal;
QMetaObject::invokeMethod(obj, "compute", Qt::DirectConnection,
Q_RETURN_ARG(QString, retVal),
Q_ARG(QString, "sqrt"),
Q_ARG(int, 42),
Q_ARG(double, 9.7));
If the "compute" slot does not take exactly one QString, one int and one double in the specified order, the call will fail.
See also Q_ARG(), Q_RETURN_ARG(), qRegisterMetaType(), and QMetaMethod::invoke().
|
static |
Invokes the member (a signal or a slot name) on the object obj. Returns true if the member could be invoked. Returns false if there is no such member or the parameters did not match.
The invocation can be either synchronous or asynchronous, depending on type:
If type is Qt::DirectConnection, the member will be invoked immediately.
If type is Qt::QueuedConnection, a QEvent will be sent and the member is invoked as soon as the application enters the main event loop.
If type is Qt::BlockingQueuedConnection, the method will be invoked in the same way as for Qt::QueuedConnection, except that the current thread will block until the event is delivered. Using this connection type to communicate between objects in the same thread will lead to deadlocks.
If type is Qt::AutoConnection, the member is invoked synchronously if obj lives in the same thread as the caller; otherwise it will invoke the member asynchronously.
The return value of the member function call is placed in ret. If the invocation is asynchronous, the return value cannot be evaluated. You can pass up to ten arguments (val0, val1, val2, val3, val4, val5, val6, val7, val8, and val9) to the member function.
QGenericArgument and QGenericReturnArgument are internal helper classes. Because signals and slots can be dynamically invoked, you must enclose the arguments using the Q_ARG() and Q_RETURN_ARG() macros. Q_ARG() takes a type name and a const reference of that type; Q_RETURN_ARG() takes a type name and a non-const reference.
You only need to pass the name of the signal or slot to this function, not the entire signature. For example, to asynchronously invoke the animateClick() slot on a QPushButton, use the following code:
QMetaObject::invokeMethod(pushButton, "animateClick",
Qt::QueuedConnection);
With asynchronous method invocations, the parameters must be of types that are known to Qt's meta-object system, because Qt needs to copy the arguments to store them in an event behind the scenes. If you try to use a queued connection and get the error message
QMetaObject::invokeMethod: Unable to handle unregistered datatype 'MyType'
call qRegisterMetaType() to register the data type before you call invokeMethod().
To synchronously invoke the compute(QString, int, double) slot on some arbitrary object obj retrieve its return value:
QString retVal;
QMetaObject::invokeMethod(obj, "compute", Qt::DirectConnection,
Q_RETURN_ARG(QString, retVal),
Q_ARG(QString, "sqrt"),
Q_ARG(int, 42),
Q_ARG(double, 9.7));
If the "compute" slot does not take exactly one QString, one int and one double in the specified order, the call will fail.
See also Q_ARG(), Q_RETURN_ARG(), qRegisterMetaType(), and QMetaMethod::invoke().
|
static |
Invokes the member (a signal or a slot name) on the object obj. Returns true if the member could be invoked. Returns false if there is no such member or the parameters did not match.
The invocation can be either synchronous or asynchronous, depending on type:
If type is Qt::DirectConnection, the member will be invoked immediately.
If type is Qt::QueuedConnection, a QEvent will be sent and the member is invoked as soon as the application enters the main event loop.
If type is Qt::BlockingQueuedConnection, the method will be invoked in the same way as for Qt::QueuedConnection, except that the current thread will block until the event is delivered. Using this connection type to communicate between objects in the same thread will lead to deadlocks.
If type is Qt::AutoConnection, the member is invoked synchronously if obj lives in the same thread as the caller; otherwise it will invoke the member asynchronously.
The return value of the member function call is placed in ret. If the invocation is asynchronous, the return value cannot be evaluated. You can pass up to ten arguments (val0, val1, val2, val3, val4, val5, val6, val7, val8, and val9) to the member function.
QGenericArgument and QGenericReturnArgument are internal helper classes. Because signals and slots can be dynamically invoked, you must enclose the arguments using the Q_ARG() and Q_RETURN_ARG() macros. Q_ARG() takes a type name and a const reference of that type; Q_RETURN_ARG() takes a type name and a non-const reference.
You only need to pass the name of the signal or slot to this function, not the entire signature. For example, to asynchronously invoke the animateClick() slot on a QPushButton, use the following code:
QMetaObject::invokeMethod(pushButton, "animateClick",
Qt::QueuedConnection);
With asynchronous method invocations, the parameters must be of types that are known to Qt's meta-object system, because Qt needs to copy the arguments to store them in an event behind the scenes. If you try to use a queued connection and get the error message
QMetaObject::invokeMethod: Unable to handle unregistered datatype 'MyType'
call qRegisterMetaType() to register the data type before you call invokeMethod().
To synchronously invoke the compute(QString, int, double) slot on some arbitrary object obj retrieve its return value:
QString retVal;
QMetaObject::invokeMethod(obj, "compute", Qt::DirectConnection,
Q_RETURN_ARG(QString, retVal),
Q_ARG(QString, "sqrt"),
Q_ARG(int, 42),
Q_ARG(double, 9.7));
If the "compute" slot does not take exactly one QString, one int and one double in the specified order, the call will fail.
See also Q_ARG(), Q_RETURN_ARG(), qRegisterMetaType(), and QMetaMethod::invoke().
|
static |
Invokes the member (a signal or a slot name) on the object obj. Returns true if the member could be invoked. Returns false if there is no such member or the parameters did not match.
The invocation can be either synchronous or asynchronous, depending on type:
If type is Qt::DirectConnection, the member will be invoked immediately.
If type is Qt::QueuedConnection, a QEvent will be sent and the member is invoked as soon as the application enters the main event loop.
If type is Qt::BlockingQueuedConnection, the method will be invoked in the same way as for Qt::QueuedConnection, except that the current thread will block until the event is delivered. Using this connection type to communicate between objects in the same thread will lead to deadlocks.
If type is Qt::AutoConnection, the member is invoked synchronously if obj lives in the same thread as the caller; otherwise it will invoke the member asynchronously.
The return value of the member function call is placed in ret. If the invocation is asynchronous, the return value cannot be evaluated. You can pass up to ten arguments (val0, val1, val2, val3, val4, val5, val6, val7, val8, and val9) to the member function.
QGenericArgument and QGenericReturnArgument are internal helper classes. Because signals and slots can be dynamically invoked, you must enclose the arguments using the Q_ARG() and Q_RETURN_ARG() macros. Q_ARG() takes a type name and a const reference of that type; Q_RETURN_ARG() takes a type name and a non-const reference.
You only need to pass the name of the signal or slot to this function, not the entire signature. For example, to asynchronously invoke the animateClick() slot on a QPushButton, use the following code:
QMetaObject::invokeMethod(pushButton, "animateClick",
Qt::QueuedConnection);
With asynchronous method invocations, the parameters must be of types that are known to Qt's meta-object system, because Qt needs to copy the arguments to store them in an event behind the scenes. If you try to use a queued connection and get the error message
QMetaObject::invokeMethod: Unable to handle unregistered datatype 'MyType'
call qRegisterMetaType() to register the data type before you call invokeMethod().
To synchronously invoke the compute(QString, int, double) slot on some arbitrary object obj retrieve its return value:
QString retVal;
QMetaObject::invokeMethod(obj, "compute", Qt::DirectConnection,
Q_RETURN_ARG(QString, retVal),
Q_ARG(QString, "sqrt"),
Q_ARG(int, 42),
Q_ARG(double, 9.7));
If the "compute" slot does not take exactly one QString, one int and one double in the specified order, the call will fail.
See also Q_ARG(), Q_RETURN_ARG(), qRegisterMetaType(), and QMetaMethod::invoke().
|
static |
Invokes the member (a signal or a slot name) on the object obj. Returns true if the member could be invoked. Returns false if there is no such member or the parameters did not match.
The invocation can be either synchronous or asynchronous, depending on type:
If type is Qt::DirectConnection, the member will be invoked immediately.
If type is Qt::QueuedConnection, a QEvent will be sent and the member is invoked as soon as the application enters the main event loop.
If type is Qt::BlockingQueuedConnection, the method will be invoked in the same way as for Qt::QueuedConnection, except that the current thread will block until the event is delivered. Using this connection type to communicate between objects in the same thread will lead to deadlocks.
If type is Qt::AutoConnection, the member is invoked synchronously if obj lives in the same thread as the caller; otherwise it will invoke the member asynchronously.
The return value of the member function call is placed in ret. If the invocation is asynchronous, the return value cannot be evaluated. You can pass up to ten arguments (val0, val1, val2, val3, val4, val5, val6, val7, val8, and val9) to the member function.
QGenericArgument and QGenericReturnArgument are internal helper classes. Because signals and slots can be dynamically invoked, you must enclose the arguments using the Q_ARG() and Q_RETURN_ARG() macros. Q_ARG() takes a type name and a const reference of that type; Q_RETURN_ARG() takes a type name and a non-const reference.
You only need to pass the name of the signal or slot to this function, not the entire signature. For example, to asynchronously invoke the animateClick() slot on a QPushButton, use the following code:
QMetaObject::invokeMethod(pushButton, "animateClick",
Qt::QueuedConnection);
With asynchronous method invocations, the parameters must be of types that are known to Qt's meta-object system, because Qt needs to copy the arguments to store them in an event behind the scenes. If you try to use a queued connection and get the error message
QMetaObject::invokeMethod: Unable to handle unregistered datatype 'MyType'
call qRegisterMetaType() to register the data type before you call invokeMethod().
To synchronously invoke the compute(QString, int, double) slot on some arbitrary object obj retrieve its return value:
QString retVal;
QMetaObject::invokeMethod(obj, "compute", Qt::DirectConnection,
Q_RETURN_ARG(QString, retVal),
Q_ARG(QString, "sqrt"),
Q_ARG(int, 42),
Q_ARG(double, 9.7));
If the "compute" slot does not take exactly one QString, one int and one double in the specified order, the call will fail.
See also Q_ARG(), Q_RETURN_ARG(), qRegisterMetaType(), and QMetaMethod::invoke().
|
static |
Invokes the member (a signal or a slot name) on the object obj. Returns true if the member could be invoked. Returns false if there is no such member or the parameters did not match.
The invocation can be either synchronous or asynchronous, depending on type:
If type is Qt::DirectConnection, the member will be invoked immediately.
If type is Qt::QueuedConnection, a QEvent will be sent and the member is invoked as soon as the application enters the main event loop.
If type is Qt::BlockingQueuedConnection, the method will be invoked in the same way as for Qt::QueuedConnection, except that the current thread will block until the event is delivered. Using this connection type to communicate between objects in the same thread will lead to deadlocks.
If type is Qt::AutoConnection, the member is invoked synchronously if obj lives in the same thread as the caller; otherwise it will invoke the member asynchronously.
The return value of the member function call is placed in ret. If the invocation is asynchronous, the return value cannot be evaluated. You can pass up to ten arguments (val0, val1, val2, val3, val4, val5, val6, val7, val8, and val9) to the member function.
QGenericArgument and QGenericReturnArgument are internal helper classes. Because signals and slots can be dynamically invoked, you must enclose the arguments using the Q_ARG() and Q_RETURN_ARG() macros. Q_ARG() takes a type name and a const reference of that type; Q_RETURN_ARG() takes a type name and a non-const reference.
You only need to pass the name of the signal or slot to this function, not the entire signature. For example, to asynchronously invoke the animateClick() slot on a QPushButton, use the following code:
QMetaObject::invokeMethod(pushButton, "animateClick",
Qt::QueuedConnection);
With asynchronous method invocations, the parameters must be of types that are known to Qt's meta-object system, because Qt needs to copy the arguments to store them in an event behind the scenes. If you try to use a queued connection and get the error message
QMetaObject::invokeMethod: Unable to handle unregistered datatype 'MyType'
call qRegisterMetaType() to register the data type before you call invokeMethod().
To synchronously invoke the compute(QString, int, double) slot on some arbitrary object obj retrieve its return value:
QString retVal;
QMetaObject::invokeMethod(obj, "compute", Qt::DirectConnection,
Q_RETURN_ARG(QString, retVal),
Q_ARG(QString, "sqrt"),
Q_ARG(int, 42),
Q_ARG(double, 9.7));
If the "compute" slot does not take exactly one QString, one int and one double in the specified order, the call will fail.
See also Q_ARG(), Q_RETURN_ARG(), qRegisterMetaType(), and QMetaMethod::invoke().
|
static |
Invokes the member (a signal or a slot name) on the object obj. Returns true if the member could be invoked. Returns false if there is no such member or the parameters did not match.
The invocation can be either synchronous or asynchronous, depending on type:
If type is Qt::DirectConnection, the member will be invoked immediately.
If type is Qt::QueuedConnection, a QEvent will be sent and the member is invoked as soon as the application enters the main event loop.
If type is Qt::BlockingQueuedConnection, the method will be invoked in the same way as for Qt::QueuedConnection, except that the current thread will block until the event is delivered. Using this connection type to communicate between objects in the same thread will lead to deadlocks.
If type is Qt::AutoConnection, the member is invoked synchronously if obj lives in the same thread as the caller; otherwise it will invoke the member asynchronously.
The return value of the member function call is placed in ret. If the invocation is asynchronous, the return value cannot be evaluated. You can pass up to ten arguments (val0, val1, val2, val3, val4, val5, val6, val7, val8, and val9) to the member function.
QGenericArgument and QGenericReturnArgument are internal helper classes. Because signals and slots can be dynamically invoked, you must enclose the arguments using the Q_ARG() and Q_RETURN_ARG() macros. Q_ARG() takes a type name and a const reference of that type; Q_RETURN_ARG() takes a type name and a non-const reference.
You only need to pass the name of the signal or slot to this function, not the entire signature. For example, to asynchronously invoke the animateClick() slot on a QPushButton, use the following code:
QMetaObject::invokeMethod(pushButton, "animateClick",
Qt::QueuedConnection);
With asynchronous method invocations, the parameters must be of types that are known to Qt's meta-object system, because Qt needs to copy the arguments to store them in an event behind the scenes. If you try to use a queued connection and get the error message
QMetaObject::invokeMethod: Unable to handle unregistered datatype 'MyType'
call qRegisterMetaType() to register the data type before you call invokeMethod().
To synchronously invoke the compute(QString, int, double) slot on some arbitrary object obj retrieve its return value:
QString retVal;
QMetaObject::invokeMethod(obj, "compute", Qt::DirectConnection,
Q_RETURN_ARG(QString, retVal),
Q_ARG(QString, "sqrt"),
Q_ARG(int, 42),
Q_ARG(double, 9.7));
If the "compute" slot does not take exactly one QString, one int and one double in the specified order, the call will fail.
See also Q_ARG(), Q_RETURN_ARG(), qRegisterMetaType(), and QMetaMethod::invoke().
|
static |
Invokes the member (a signal or a slot name) on the object obj. Returns true if the member could be invoked. Returns false if there is no such member or the parameters did not match.
The invocation can be either synchronous or asynchronous, depending on type:
If type is Qt::DirectConnection, the member will be invoked immediately.
If type is Qt::QueuedConnection, a QEvent will be sent and the member is invoked as soon as the application enters the main event loop.
If type is Qt::BlockingQueuedConnection, the method will be invoked in the same way as for Qt::QueuedConnection, except that the current thread will block until the event is delivered. Using this connection type to communicate between objects in the same thread will lead to deadlocks.
If type is Qt::AutoConnection, the member is invoked synchronously if obj lives in the same thread as the caller; otherwise it will invoke the member asynchronously.
The return value of the member function call is placed in ret. If the invocation is asynchronous, the return value cannot be evaluated. You can pass up to ten arguments (val0, val1, val2, val3, val4, val5, val6, val7, val8, and val9) to the member function.
QGenericArgument and QGenericReturnArgument are internal helper classes. Because signals and slots can be dynamically invoked, you must enclose the arguments using the Q_ARG() and Q_RETURN_ARG() macros. Q_ARG() takes a type name and a const reference of that type; Q_RETURN_ARG() takes a type name and a non-const reference.
You only need to pass the name of the signal or slot to this function, not the entire signature. For example, to asynchronously invoke the animateClick() slot on a QPushButton, use the following code:
QMetaObject::invokeMethod(pushButton, "animateClick",
Qt::QueuedConnection);
With asynchronous method invocations, the parameters must be of types that are known to Qt's meta-object system, because Qt needs to copy the arguments to store them in an event behind the scenes. If you try to use a queued connection and get the error message
QMetaObject::invokeMethod: Unable to handle unregistered datatype 'MyType'
call qRegisterMetaType() to register the data type before you call invokeMethod().
To synchronously invoke the compute(QString, int, double) slot on some arbitrary object obj retrieve its return value:
QString retVal;
QMetaObject::invokeMethod(obj, "compute", Qt::DirectConnection,
Q_RETURN_ARG(QString, retVal),
Q_ARG(QString, "sqrt"),
Q_ARG(int, 42),
Q_ARG(double, 9.7));
If the "compute" slot does not take exactly one QString, one int and one double in the specified order, the call will fail.
See also Q_ARG(), Q_RETURN_ARG(), qRegisterMetaType(), and QMetaMethod::invoke().
|
static |
Invokes the member (a signal or a slot name) on the object obj. Returns true if the member could be invoked. Returns false if there is no such member or the parameters did not match.
The invocation can be either synchronous or asynchronous, depending on type:
If type is Qt::DirectConnection, the member will be invoked immediately.
If type is Qt::QueuedConnection, a QEvent will be sent and the member is invoked as soon as the application enters the main event loop.
If type is Qt::BlockingQueuedConnection, the method will be invoked in the same way as for Qt::QueuedConnection, except that the current thread will block until the event is delivered. Using this connection type to communicate between objects in the same thread will lead to deadlocks.
If type is Qt::AutoConnection, the member is invoked synchronously if obj lives in the same thread as the caller; otherwise it will invoke the member asynchronously.
The return value of the member function call is placed in ret. If the invocation is asynchronous, the return value cannot be evaluated. You can pass up to ten arguments (val0, val1, val2, val3, val4, val5, val6, val7, val8, and val9) to the member function.
QGenericArgument and QGenericReturnArgument are internal helper classes. Because signals and slots can be dynamically invoked, you must enclose the arguments using the Q_ARG() and Q_RETURN_ARG() macros. Q_ARG() takes a type name and a const reference of that type; Q_RETURN_ARG() takes a type name and a non-const reference.
You only need to pass the name of the signal or slot to this function, not the entire signature. For example, to asynchronously invoke the animateClick() slot on a QPushButton, use the following code:
QMetaObject::invokeMethod(pushButton, "animateClick",
Qt::QueuedConnection);
With asynchronous method invocations, the parameters must be of types that are known to Qt's meta-object system, because Qt needs to copy the arguments to store them in an event behind the scenes. If you try to use a queued connection and get the error message
QMetaObject::invokeMethod: Unable to handle unregistered datatype 'MyType'
call qRegisterMetaType() to register the data type before you call invokeMethod().
To synchronously invoke the compute(QString, int, double) slot on some arbitrary object obj retrieve its return value:
QString retVal;
QMetaObject::invokeMethod(obj, "compute", Qt::DirectConnection,
Q_RETURN_ARG(QString, retVal),
Q_ARG(QString, "sqrt"),
Q_ARG(int, 42),
Q_ARG(double, 9.7));
If the "compute" slot does not take exactly one QString, one int and one double in the specified order, the call will fail.
See also Q_ARG(), Q_RETURN_ARG(), qRegisterMetaType(), and QMetaMethod::invoke().
|
static |
Invokes the member (a signal or a slot name) on the object obj. Returns true if the member could be invoked. Returns false if there is no such member or the parameters did not match.
The invocation can be either synchronous or asynchronous, depending on type:
If type is Qt::DirectConnection, the member will be invoked immediately.
If type is Qt::QueuedConnection, a QEvent will be sent and the member is invoked as soon as the application enters the main event loop.
If type is Qt::BlockingQueuedConnection, the method will be invoked in the same way as for Qt::QueuedConnection, except that the current thread will block until the event is delivered. Using this connection type to communicate between objects in the same thread will lead to deadlocks.
If type is Qt::AutoConnection, the member is invoked synchronously if obj lives in the same thread as the caller; otherwise it will invoke the member asynchronously.
The return value of the member function call is placed in ret. If the invocation is asynchronous, the return value cannot be evaluated. You can pass up to ten arguments (val0, val1, val2, val3, val4, val5, val6, val7, val8, and val9) to the member function.
QGenericArgument and QGenericReturnArgument are internal helper classes. Because signals and slots can be dynamically invoked, you must enclose the arguments using the Q_ARG() and Q_RETURN_ARG() macros. Q_ARG() takes a type name and a const reference of that type; Q_RETURN_ARG() takes a type name and a non-const reference.
You only need to pass the name of the signal or slot to this function, not the entire signature. For example, to asynchronously invoke the animateClick() slot on a QPushButton, use the following code:
QMetaObject::invokeMethod(pushButton, "animateClick",
Qt::QueuedConnection);
With asynchronous method invocations, the parameters must be of types that are known to Qt's meta-object system, because Qt needs to copy the arguments to store them in an event behind the scenes. If you try to use a queued connection and get the error message
QMetaObject::invokeMethod: Unable to handle unregistered datatype 'MyType'
call qRegisterMetaType() to register the data type before you call invokeMethod().
To synchronously invoke the compute(QString, int, double) slot on some arbitrary object obj retrieve its return value:
QString retVal;
QMetaObject::invokeMethod(obj, "compute", Qt::DirectConnection,
Q_RETURN_ARG(QString, retVal),
Q_ARG(QString, "sqrt"),
Q_ARG(int, 42),
Q_ARG(double, 9.7));
If the "compute" slot does not take exactly one QString, one int and one double in the specified order, the call will fail.
See also Q_ARG(), Q_RETURN_ARG(), qRegisterMetaType(), and QMetaMethod::invoke().
|
static |
Invokes the member (a signal or a slot name) on the object obj. Returns true if the member could be invoked. Returns false if there is no such member or the parameters did not match.
The invocation can be either synchronous or asynchronous, depending on type:
If type is Qt::DirectConnection, the member will be invoked immediately.
If type is Qt::QueuedConnection, a QEvent will be sent and the member is invoked as soon as the application enters the main event loop.
If type is Qt::BlockingQueuedConnection, the method will be invoked in the same way as for Qt::QueuedConnection, except that the current thread will block until the event is delivered. Using this connection type to communicate between objects in the same thread will lead to deadlocks.
If type is Qt::AutoConnection, the member is invoked synchronously if obj lives in the same thread as the caller; otherwise it will invoke the member asynchronously.
The return value of the member function call is placed in ret. If the invocation is asynchronous, the return value cannot be evaluated. You can pass up to ten arguments (val0, val1, val2, val3, val4, val5, val6, val7, val8, and val9) to the member function.
QGenericArgument and QGenericReturnArgument are internal helper classes. Because signals and slots can be dynamically invoked, you must enclose the arguments using the Q_ARG() and Q_RETURN_ARG() macros. Q_ARG() takes a type name and a const reference of that type; Q_RETURN_ARG() takes a type name and a non-const reference.
You only need to pass the name of the signal or slot to this function, not the entire signature. For example, to asynchronously invoke the animateClick() slot on a QPushButton, use the following code:
QMetaObject::invokeMethod(pushButton, "animateClick",
Qt::QueuedConnection);
With asynchronous method invocations, the parameters must be of types that are known to Qt's meta-object system, because Qt needs to copy the arguments to store them in an event behind the scenes. If you try to use a queued connection and get the error message
QMetaObject::invokeMethod: Unable to handle unregistered datatype 'MyType'
call qRegisterMetaType() to register the data type before you call invokeMethod().
To synchronously invoke the compute(QString, int, double) slot on some arbitrary object obj retrieve its return value:
QString retVal;
QMetaObject::invokeMethod(obj, "compute", Qt::DirectConnection,
Q_RETURN_ARG(QString, retVal),
Q_ARG(QString, "sqrt"),
Q_ARG(int, 42),
Q_ARG(double, 9.7));
If the "compute" slot does not take exactly one QString, one int and one double in the specified order, the call will fail.
See also Q_ARG(), Q_RETURN_ARG(), qRegisterMetaType(), and QMetaMethod::invoke().
|
static |
Invokes the member (a signal or a slot name) on the object obj. Returns true if the member could be invoked. Returns false if there is no such member or the parameters did not match.
The invocation can be either synchronous or asynchronous, depending on type:
If type is Qt::DirectConnection, the member will be invoked immediately.
If type is Qt::QueuedConnection, a QEvent will be sent and the member is invoked as soon as the application enters the main event loop.
If type is Qt::BlockingQueuedConnection, the method will be invoked in the same way as for Qt::QueuedConnection, except that the current thread will block until the event is delivered. Using this connection type to communicate between objects in the same thread will lead to deadlocks.
If type is Qt::AutoConnection, the member is invoked synchronously if obj lives in the same thread as the caller; otherwise it will invoke the member asynchronously.
The return value of the member function call is placed in ret. If the invocation is asynchronous, the return value cannot be evaluated. You can pass up to ten arguments (val0, val1, val2, val3, val4, val5, val6, val7, val8, and val9) to the member function.
QGenericArgument and QGenericReturnArgument are internal helper classes. Because signals and slots can be dynamically invoked, you must enclose the arguments using the Q_ARG() and Q_RETURN_ARG() macros. Q_ARG() takes a type name and a const reference of that type; Q_RETURN_ARG() takes a type name and a non-const reference.
You only need to pass the name of the signal or slot to this function, not the entire signature. For example, to asynchronously invoke the animateClick() slot on a QPushButton, use the following code:
QMetaObject::invokeMethod(pushButton, "animateClick",
Qt::QueuedConnection);
With asynchronous method invocations, the parameters must be of types that are known to Qt's meta-object system, because Qt needs to copy the arguments to store them in an event behind the scenes. If you try to use a queued connection and get the error message
QMetaObject::invokeMethod: Unable to handle unregistered datatype 'MyType'
call qRegisterMetaType() to register the data type before you call invokeMethod().
To synchronously invoke the compute(QString, int, double) slot on some arbitrary object obj retrieve its return value:
QString retVal;
QMetaObject::invokeMethod(obj, "compute", Qt::DirectConnection,
Q_RETURN_ARG(QString, retVal),
Q_ARG(QString, "sqrt"),
Q_ARG(int, 42),
Q_ARG(double, 9.7));
If the "compute" slot does not take exactly one QString, one int and one double in the specified order, the call will fail.
See also Q_ARG(), Q_RETURN_ARG(), qRegisterMetaType(), and QMetaMethod::invoke().
|
static |
Invokes the member (a signal or a slot name) on the object obj. Returns true if the member could be invoked. Returns false if there is no such member or the parameters did not match.
The invocation can be either synchronous or asynchronous, depending on type:
If type is Qt::DirectConnection, the member will be invoked immediately.
If type is Qt::QueuedConnection, a QEvent will be sent and the member is invoked as soon as the application enters the main event loop.
If type is Qt::BlockingQueuedConnection, the method will be invoked in the same way as for Qt::QueuedConnection, except that the current thread will block until the event is delivered. Using this connection type to communicate between objects in the same thread will lead to deadlocks.
If type is Qt::AutoConnection, the member is invoked synchronously if obj lives in the same thread as the caller; otherwise it will invoke the member asynchronously.
The return value of the member function call is placed in ret. If the invocation is asynchronous, the return value cannot be evaluated. You can pass up to ten arguments (val0, val1, val2, val3, val4, val5, val6, val7, val8, and val9) to the member function.
QGenericArgument and QGenericReturnArgument are internal helper classes. Because signals and slots can be dynamically invoked, you must enclose the arguments using the Q_ARG() and Q_RETURN_ARG() macros. Q_ARG() takes a type name and a const reference of that type; Q_RETURN_ARG() takes a type name and a non-const reference.
You only need to pass the name of the signal or slot to this function, not the entire signature. For example, to asynchronously invoke the animateClick() slot on a QPushButton, use the following code:
QMetaObject::invokeMethod(pushButton, "animateClick",
Qt::QueuedConnection);
With asynchronous method invocations, the parameters must be of types that are known to Qt's meta-object system, because Qt needs to copy the arguments to store them in an event behind the scenes. If you try to use a queued connection and get the error message
QMetaObject::invokeMethod: Unable to handle unregistered datatype 'MyType'
call qRegisterMetaType() to register the data type before you call invokeMethod().
To synchronously invoke the compute(QString, int, double) slot on some arbitrary object obj retrieve its return value:
QString retVal;
QMetaObject::invokeMethod(obj, "compute", Qt::DirectConnection,
Q_RETURN_ARG(QString, retVal),
Q_ARG(QString, "sqrt"),
Q_ARG(int, 42),
Q_ARG(double, 9.7));
If the "compute" slot does not take exactly one QString, one int and one double in the specified order, the call will fail.
See also Q_ARG(), Q_RETURN_ARG(), qRegisterMetaType(), and QMetaMethod::invoke().
|
static |
Invokes the member (a signal or a slot name) on the object obj. Returns true if the member could be invoked. Returns false if there is no such member or the parameters did not match.
The invocation can be either synchronous or asynchronous, depending on type:
If type is Qt::DirectConnection, the member will be invoked immediately.
If type is Qt::QueuedConnection, a QEvent will be sent and the member is invoked as soon as the application enters the main event loop.
If type is Qt::BlockingQueuedConnection, the method will be invoked in the same way as for Qt::QueuedConnection, except that the current thread will block until the event is delivered. Using this connection type to communicate between objects in the same thread will lead to deadlocks.
If type is Qt::AutoConnection, the member is invoked synchronously if obj lives in the same thread as the caller; otherwise it will invoke the member asynchronously.
The return value of the member function call is placed in ret. If the invocation is asynchronous, the return value cannot be evaluated. You can pass up to ten arguments (val0, val1, val2, val3, val4, val5, val6, val7, val8, and val9) to the member function.
QGenericArgument and QGenericReturnArgument are internal helper classes. Because signals and slots can be dynamically invoked, you must enclose the arguments using the Q_ARG() and Q_RETURN_ARG() macros. Q_ARG() takes a type name and a const reference of that type; Q_RETURN_ARG() takes a type name and a non-const reference.
You only need to pass the name of the signal or slot to this function, not the entire signature. For example, to asynchronously invoke the animateClick() slot on a QPushButton, use the following code:
QMetaObject::invokeMethod(pushButton, "animateClick",
Qt::QueuedConnection);
With asynchronous method invocations, the parameters must be of types that are known to Qt's meta-object system, because Qt needs to copy the arguments to store them in an event behind the scenes. If you try to use a queued connection and get the error message
QMetaObject::invokeMethod: Unable to handle unregistered datatype 'MyType'
call qRegisterMetaType() to register the data type before you call invokeMethod().
To synchronously invoke the compute(QString, int, double) slot on some arbitrary object obj retrieve its return value:
QString retVal;
QMetaObject::invokeMethod(obj, "compute", Qt::DirectConnection,
Q_RETURN_ARG(QString, retVal),
Q_ARG(QString, "sqrt"),
Q_ARG(int, 42),
Q_ARG(double, 9.7));
If the "compute" slot does not take exactly one QString, one int and one double in the specified order, the call will fail.
See also Q_ARG(), Q_RETURN_ARG(), qRegisterMetaType(), and QMetaMethod::invoke().
|
static |
Invokes the member (a signal or a slot name) on the object obj. Returns true if the member could be invoked. Returns false if there is no such member or the parameters did not match.
The invocation can be either synchronous or asynchronous, depending on type:
If type is Qt::DirectConnection, the member will be invoked immediately.
If type is Qt::QueuedConnection, a QEvent will be sent and the member is invoked as soon as the application enters the main event loop.
If type is Qt::BlockingQueuedConnection, the method will be invoked in the same way as for Qt::QueuedConnection, except that the current thread will block until the event is delivered. Using this connection type to communicate between objects in the same thread will lead to deadlocks.
If type is Qt::AutoConnection, the member is invoked synchronously if obj lives in the same thread as the caller; otherwise it will invoke the member asynchronously.
The return value of the member function call is placed in ret. If the invocation is asynchronous, the return value cannot be evaluated. You can pass up to ten arguments (val0, val1, val2, val3, val4, val5, val6, val7, val8, and val9) to the member function.
QGenericArgument and QGenericReturnArgument are internal helper classes. Because signals and slots can be dynamically invoked, you must enclose the arguments using the Q_ARG() and Q_RETURN_ARG() macros. Q_ARG() takes a type name and a const reference of that type; Q_RETURN_ARG() takes a type name and a non-const reference.
You only need to pass the name of the signal or slot to this function, not the entire signature. For example, to asynchronously invoke the animateClick() slot on a QPushButton, use the following code:
QMetaObject::invokeMethod(pushButton, "animateClick",
Qt::QueuedConnection);
With asynchronous method invocations, the parameters must be of types that are known to Qt's meta-object system, because Qt needs to copy the arguments to store them in an event behind the scenes. If you try to use a queued connection and get the error message
QMetaObject::invokeMethod: Unable to handle unregistered datatype 'MyType'
call qRegisterMetaType() to register the data type before you call invokeMethod().
To synchronously invoke the compute(QString, int, double) slot on some arbitrary object obj retrieve its return value:
QString retVal;
QMetaObject::invokeMethod(obj, "compute", Qt::DirectConnection,
Q_RETURN_ARG(QString, retVal),
Q_ARG(QString, "sqrt"),
Q_ARG(int, 42),
Q_ARG(double, 9.7));
If the "compute" slot does not take exactly one QString, one int and one double in the specified order, the call will fail.
See also Q_ARG(), Q_RETURN_ARG(), qRegisterMetaType(), and QMetaMethod::invoke().
|
static |
Invokes the member (a signal or a slot name) on the object obj. Returns true if the member could be invoked. Returns false if there is no such member or the parameters did not match.
The invocation can be either synchronous or asynchronous, depending on type:
If type is Qt::DirectConnection, the member will be invoked immediately.
If type is Qt::QueuedConnection, a QEvent will be sent and the member is invoked as soon as the application enters the main event loop.
If type is Qt::BlockingQueuedConnection, the method will be invoked in the same way as for Qt::QueuedConnection, except that the current thread will block until the event is delivered. Using this connection type to communicate between objects in the same thread will lead to deadlocks.
If type is Qt::AutoConnection, the member is invoked synchronously if obj lives in the same thread as the caller; otherwise it will invoke the member asynchronously.
The return value of the member function call is placed in ret. If the invocation is asynchronous, the return value cannot be evaluated. You can pass up to ten arguments (val0, val1, val2, val3, val4, val5, val6, val7, val8, and val9) to the member function.
QGenericArgument and QGenericReturnArgument are internal helper classes. Because signals and slots can be dynamically invoked, you must enclose the arguments using the Q_ARG() and Q_RETURN_ARG() macros. Q_ARG() takes a type name and a const reference of that type; Q_RETURN_ARG() takes a type name and a non-const reference.
You only need to pass the name of the signal or slot to this function, not the entire signature. For example, to asynchronously invoke the animateClick() slot on a QPushButton, use the following code:
QMetaObject::invokeMethod(pushButton, "animateClick",
Qt::QueuedConnection);
With asynchronous method invocations, the parameters must be of types that are known to Qt's meta-object system, because Qt needs to copy the arguments to store them in an event behind the scenes. If you try to use a queued connection and get the error message
QMetaObject::invokeMethod: Unable to handle unregistered datatype 'MyType'
call qRegisterMetaType() to register the data type before you call invokeMethod().
To synchronously invoke the compute(QString, int, double) slot on some arbitrary object obj retrieve its return value:
QString retVal;
QMetaObject::invokeMethod(obj, "compute", Qt::DirectConnection,
Q_RETURN_ARG(QString, retVal),
Q_ARG(QString, "sqrt"),
Q_ARG(int, 42),
Q_ARG(double, 9.7));
If the "compute" slot does not take exactly one QString, one int and one double in the specified order, the call will fail.
See also Q_ARG(), Q_RETURN_ARG(), qRegisterMetaType(), and QMetaMethod::invoke().
|
static |
Invokes the member (a signal or a slot name) on the object obj. Returns true if the member could be invoked. Returns false if there is no such member or the parameters did not match.
The invocation can be either synchronous or asynchronous, depending on type:
If type is Qt::DirectConnection, the member will be invoked immediately.
If type is Qt::QueuedConnection, a QEvent will be sent and the member is invoked as soon as the application enters the main event loop.
If type is Qt::BlockingQueuedConnection, the method will be invoked in the same way as for Qt::QueuedConnection, except that the current thread will block until the event is delivered. Using this connection type to communicate between objects in the same thread will lead to deadlocks.
If type is Qt::AutoConnection, the member is invoked synchronously if obj lives in the same thread as the caller; otherwise it will invoke the member asynchronously.
The return value of the member function call is placed in ret. If the invocation is asynchronous, the return value cannot be evaluated. You can pass up to ten arguments (val0, val1, val2, val3, val4, val5, val6, val7, val8, and val9) to the member function.
QGenericArgument and QGenericReturnArgument are internal helper classes. Because signals and slots can be dynamically invoked, you must enclose the arguments using the Q_ARG() and Q_RETURN_ARG() macros. Q_ARG() takes a type name and a const reference of that type; Q_RETURN_ARG() takes a type name and a non-const reference.
You only need to pass the name of the signal or slot to this function, not the entire signature. For example, to asynchronously invoke the animateClick() slot on a QPushButton, use the following code:
QMetaObject::invokeMethod(pushButton, "animateClick",
Qt::QueuedConnection);
With asynchronous method invocations, the parameters must be of types that are known to Qt's meta-object system, because Qt needs to copy the arguments to store them in an event behind the scenes. If you try to use a queued connection and get the error message
QMetaObject::invokeMethod: Unable to handle unregistered datatype 'MyType'
call qRegisterMetaType() to register the data type before you call invokeMethod().
To synchronously invoke the compute(QString, int, double) slot on some arbitrary object obj retrieve its return value:
QString retVal;
QMetaObject::invokeMethod(obj, "compute", Qt::DirectConnection,
Q_RETURN_ARG(QString, retVal),
Q_ARG(QString, "sqrt"),
Q_ARG(int, 42),
Q_ARG(double, 9.7));
If the "compute" slot does not take exactly one QString, one int and one double in the specified order, the call will fail.
See also Q_ARG(), Q_RETURN_ARG(), qRegisterMetaType(), and QMetaMethod::invoke().
|
static |
Invokes the member (a signal or a slot name) on the object obj. Returns true if the member could be invoked. Returns false if there is no such member or the parameters did not match.
The invocation can be either synchronous or asynchronous, depending on type:
If type is Qt::DirectConnection, the member will be invoked immediately.
If type is Qt::QueuedConnection, a QEvent will be sent and the member is invoked as soon as the application enters the main event loop.
If type is Qt::BlockingQueuedConnection, the method will be invoked in the same way as for Qt::QueuedConnection, except that the current thread will block until the event is delivered. Using this connection type to communicate between objects in the same thread will lead to deadlocks.
If type is Qt::AutoConnection, the member is invoked synchronously if obj lives in the same thread as the caller; otherwise it will invoke the member asynchronously.
The return value of the member function call is placed in ret. If the invocation is asynchronous, the return value cannot be evaluated. You can pass up to ten arguments (val0, val1, val2, val3, val4, val5, val6, val7, val8, and val9) to the member function.
QGenericArgument and QGenericReturnArgument are internal helper classes. Because signals and slots can be dynamically invoked, you must enclose the arguments using the Q_ARG() and Q_RETURN_ARG() macros. Q_ARG() takes a type name and a const reference of that type; Q_RETURN_ARG() takes a type name and a non-const reference.
You only need to pass the name of the signal or slot to this function, not the entire signature. For example, to asynchronously invoke the animateClick() slot on a QPushButton, use the following code:
QMetaObject::invokeMethod(pushButton, "animateClick",
Qt::QueuedConnection);
With asynchronous method invocations, the parameters must be of types that are known to Qt's meta-object system, because Qt needs to copy the arguments to store them in an event behind the scenes. If you try to use a queued connection and get the error message
QMetaObject::invokeMethod: Unable to handle unregistered datatype 'MyType'
call qRegisterMetaType() to register the data type before you call invokeMethod().
To synchronously invoke the compute(QString, int, double) slot on some arbitrary object obj retrieve its return value:
QString retVal;
QMetaObject::invokeMethod(obj, "compute", Qt::DirectConnection,
Q_RETURN_ARG(QString, retVal),
Q_ARG(QString, "sqrt"),
Q_ARG(int, 42),
Q_ARG(double, 9.7));
If the "compute" slot does not take exactly one QString, one int and one double in the specified order, the call will fail.
See also Q_ARG(), Q_RETURN_ARG(), qRegisterMetaType(), and QMetaMethod::invoke().
|
static |
Invokes the member (a signal or a slot name) on the object obj. Returns true if the member could be invoked. Returns false if there is no such member or the parameters did not match.
The invocation can be either synchronous or asynchronous, depending on type:
If type is Qt::DirectConnection, the member will be invoked immediately.
If type is Qt::QueuedConnection, a QEvent will be sent and the member is invoked as soon as the application enters the main event loop.
If type is Qt::BlockingQueuedConnection, the method will be invoked in the same way as for Qt::QueuedConnection, except that the current thread will block until the event is delivered. Using this connection type to communicate between objects in the same thread will lead to deadlocks.
If type is Qt::AutoConnection, the member is invoked synchronously if obj lives in the same thread as the caller; otherwise it will invoke the member asynchronously.
The return value of the member function call is placed in ret. If the invocation is asynchronous, the return value cannot be evaluated. You can pass up to ten arguments (val0, val1, val2, val3, val4, val5, val6, val7, val8, and val9) to the member function.
QGenericArgument and QGenericReturnArgument are internal helper classes. Because signals and slots can be dynamically invoked, you must enclose the arguments using the Q_ARG() and Q_RETURN_ARG() macros. Q_ARG() takes a type name and a const reference of that type; Q_RETURN_ARG() takes a type name and a non-const reference.
You only need to pass the name of the signal or slot to this function, not the entire signature. For example, to asynchronously invoke the animateClick() slot on a QPushButton, use the following code:
QMetaObject::invokeMethod(pushButton, "animateClick",
Qt::QueuedConnection);
With asynchronous method invocations, the parameters must be of types that are known to Qt's meta-object system, because Qt needs to copy the arguments to store them in an event behind the scenes. If you try to use a queued connection and get the error message
QMetaObject::invokeMethod: Unable to handle unregistered datatype 'MyType'
call qRegisterMetaType() to register the data type before you call invokeMethod().
To synchronously invoke the compute(QString, int, double) slot on some arbitrary object obj retrieve its return value:
QString retVal;
QMetaObject::invokeMethod(obj, "compute", Qt::DirectConnection,
Q_RETURN_ARG(QString, retVal),
Q_ARG(QString, "sqrt"),
Q_ARG(int, 42),
Q_ARG(double, 9.7));
If the "compute" slot does not take exactly one QString, one int and one double in the specified order, the call will fail.
See also Q_ARG(), Q_RETURN_ARG(), qRegisterMetaType(), and QMetaMethod::invoke().
|
static |
Invokes the member (a signal or a slot name) on the object obj. Returns true if the member could be invoked. Returns false if there is no such member or the parameters did not match.
The invocation can be either synchronous or asynchronous, depending on type:
If type is Qt::DirectConnection, the member will be invoked immediately.
If type is Qt::QueuedConnection, a QEvent will be sent and the member is invoked as soon as the application enters the main event loop.
If type is Qt::BlockingQueuedConnection, the method will be invoked in the same way as for Qt::QueuedConnection, except that the current thread will block until the event is delivered. Using this connection type to communicate between objects in the same thread will lead to deadlocks.
If type is Qt::AutoConnection, the member is invoked synchronously if obj lives in the same thread as the caller; otherwise it will invoke the member asynchronously.
The return value of the member function call is placed in ret. If the invocation is asynchronous, the return value cannot be evaluated. You can pass up to ten arguments (val0, val1, val2, val3, val4, val5, val6, val7, val8, and val9) to the member function.
QGenericArgument and QGenericReturnArgument are internal helper classes. Because signals and slots can be dynamically invoked, you must enclose the arguments using the Q_ARG() and Q_RETURN_ARG() macros. Q_ARG() takes a type name and a const reference of that type; Q_RETURN_ARG() takes a type name and a non-const reference.
You only need to pass the name of the signal or slot to this function, not the entire signature. For example, to asynchronously invoke the animateClick() slot on a QPushButton, use the following code:
QMetaObject::invokeMethod(pushButton, "animateClick",
Qt::QueuedConnection);
With asynchronous method invocations, the parameters must be of types that are known to Qt's meta-object system, because Qt needs to copy the arguments to store them in an event behind the scenes. If you try to use a queued connection and get the error message
QMetaObject::invokeMethod: Unable to handle unregistered datatype 'MyType'
call qRegisterMetaType() to register the data type before you call invokeMethod().
To synchronously invoke the compute(QString, int, double) slot on some arbitrary object obj retrieve its return value:
QString retVal;
QMetaObject::invokeMethod(obj, "compute", Qt::DirectConnection,
Q_RETURN_ARG(QString, retVal),
Q_ARG(QString, "sqrt"),
Q_ARG(int, 42),
Q_ARG(double, 9.7));
If the "compute" slot does not take exactly one QString, one int and one double in the specified order, the call will fail.
See also Q_ARG(), Q_RETURN_ARG(), qRegisterMetaType(), and QMetaMethod::invoke().
|
static |
Invokes the member (a signal or a slot name) on the object obj. Returns true if the member could be invoked. Returns false if there is no such member or the parameters did not match.
The invocation can be either synchronous or asynchronous, depending on type:
If type is Qt::DirectConnection, the member will be invoked immediately.
If type is Qt::QueuedConnection, a QEvent will be sent and the member is invoked as soon as the application enters the main event loop.
If type is Qt::BlockingQueuedConnection, the method will be invoked in the same way as for Qt::QueuedConnection, except that the current thread will block until the event is delivered. Using this connection type to communicate between objects in the same thread will lead to deadlocks.
If type is Qt::AutoConnection, the member is invoked synchronously if obj lives in the same thread as the caller; otherwise it will invoke the member asynchronously.
The return value of the member function call is placed in ret. If the invocation is asynchronous, the return value cannot be evaluated. You can pass up to ten arguments (val0, val1, val2, val3, val4, val5, val6, val7, val8, and val9) to the member function.
QGenericArgument and QGenericReturnArgument are internal helper classes. Because signals and slots can be dynamically invoked, you must enclose the arguments using the Q_ARG() and Q_RETURN_ARG() macros. Q_ARG() takes a type name and a const reference of that type; Q_RETURN_ARG() takes a type name and a non-const reference.
You only need to pass the name of the signal or slot to this function, not the entire signature. For example, to asynchronously invoke the animateClick() slot on a QPushButton, use the following code:
QMetaObject::invokeMethod(pushButton, "animateClick",
Qt::QueuedConnection);
With asynchronous method invocations, the parameters must be of types that are known to Qt's meta-object system, because Qt needs to copy the arguments to store them in an event behind the scenes. If you try to use a queued connection and get the error message
QMetaObject::invokeMethod: Unable to handle unregistered datatype 'MyType'
call qRegisterMetaType() to register the data type before you call invokeMethod().
To synchronously invoke the compute(QString, int, double) slot on some arbitrary object obj retrieve its return value:
QString retVal;
QMetaObject::invokeMethod(obj, "compute", Qt::DirectConnection,
Q_RETURN_ARG(QString, retVal),
Q_ARG(QString, "sqrt"),
Q_ARG(int, 42),
Q_ARG(double, 9.7));
If the "compute" slot does not take exactly one QString, one int and one double in the specified order, the call will fail.
See also Q_ARG(), Q_RETURN_ARG(), qRegisterMetaType(), and QMetaMethod::invoke().
|
static |
Invokes the member (a signal or a slot name) on the object obj. Returns true if the member could be invoked. Returns false if there is no such member or the parameters did not match.
The invocation can be either synchronous or asynchronous, depending on type:
If type is Qt::DirectConnection, the member will be invoked immediately.
If type is Qt::QueuedConnection, a QEvent will be sent and the member is invoked as soon as the application enters the main event loop.
If type is Qt::BlockingQueuedConnection, the method will be invoked in the same way as for Qt::QueuedConnection, except that the current thread will block until the event is delivered. Using this connection type to communicate between objects in the same thread will lead to deadlocks.
If type is Qt::AutoConnection, the member is invoked synchronously if obj lives in the same thread as the caller; otherwise it will invoke the member asynchronously.
The return value of the member function call is placed in ret. If the invocation is asynchronous, the return value cannot be evaluated. You can pass up to ten arguments (val0, val1, val2, val3, val4, val5, val6, val7, val8, and val9) to the member function.
QGenericArgument and QGenericReturnArgument are internal helper classes. Because signals and slots can be dynamically invoked, you must enclose the arguments using the Q_ARG() and Q_RETURN_ARG() macros. Q_ARG() takes a type name and a const reference of that type; Q_RETURN_ARG() takes a type name and a non-const reference.
You only need to pass the name of the signal or slot to this function, not the entire signature. For example, to asynchronously invoke the animateClick() slot on a QPushButton, use the following code:
QMetaObject::invokeMethod(pushButton, "animateClick",
Qt::QueuedConnection);
With asynchronous method invocations, the parameters must be of types that are known to Qt's meta-object system, because Qt needs to copy the arguments to store them in an event behind the scenes. If you try to use a queued connection and get the error message
QMetaObject::invokeMethod: Unable to handle unregistered datatype 'MyType'
call qRegisterMetaType() to register the data type before you call invokeMethod().
To synchronously invoke the compute(QString, int, double) slot on some arbitrary object obj retrieve its return value:
QString retVal;
QMetaObject::invokeMethod(obj, "compute", Qt::DirectConnection,
Q_RETURN_ARG(QString, retVal),
Q_ARG(QString, "sqrt"),
Q_ARG(int, 42),
Q_ARG(double, 9.7));
If the "compute" slot does not take exactly one QString, one int and one double in the specified order, the call will fail.
See also Q_ARG(), Q_RETURN_ARG(), qRegisterMetaType(), and QMetaMethod::invoke().
|
static |
Invokes the member (a signal or a slot name) on the object obj. Returns true if the member could be invoked. Returns false if there is no such member or the parameters did not match.
The invocation can be either synchronous or asynchronous, depending on type:
If type is Qt::DirectConnection, the member will be invoked immediately.
If type is Qt::QueuedConnection, a QEvent will be sent and the member is invoked as soon as the application enters the main event loop.
If type is Qt::BlockingQueuedConnection, the method will be invoked in the same way as for Qt::QueuedConnection, except that the current thread will block until the event is delivered. Using this connection type to communicate between objects in the same thread will lead to deadlocks.
If type is Qt::AutoConnection, the member is invoked synchronously if obj lives in the same thread as the caller; otherwise it will invoke the member asynchronously.
The return value of the member function call is placed in ret. If the invocation is asynchronous, the return value cannot be evaluated. You can pass up to ten arguments (val0, val1, val2, val3, val4, val5, val6, val7, val8, and val9) to the member function.
QGenericArgument and QGenericReturnArgument are internal helper classes. Because signals and slots can be dynamically invoked, you must enclose the arguments using the Q_ARG() and Q_RETURN_ARG() macros. Q_ARG() takes a type name and a const reference of that type; Q_RETURN_ARG() takes a type name and a non-const reference.
You only need to pass the name of the signal or slot to this function, not the entire signature. For example, to asynchronously invoke the animateClick() slot on a QPushButton, use the following code:
QMetaObject::invokeMethod(pushButton, "animateClick",
Qt::QueuedConnection);
With asynchronous method invocations, the parameters must be of types that are known to Qt's meta-object system, because Qt needs to copy the arguments to store them in an event behind the scenes. If you try to use a queued connection and get the error message
QMetaObject::invokeMethod: Unable to handle unregistered datatype 'MyType'
call qRegisterMetaType() to register the data type before you call invokeMethod().
To synchronously invoke the compute(QString, int, double) slot on some arbitrary object obj retrieve its return value:
QString retVal;
QMetaObject::invokeMethod(obj, "compute", Qt::DirectConnection,
Q_RETURN_ARG(QString, retVal),
Q_ARG(QString, "sqrt"),
Q_ARG(int, 42),
Q_ARG(double, 9.7));
If the "compute" slot does not take exactly one QString, one int and one double in the specified order, the call will fail.
See also Q_ARG(), Q_RETURN_ARG(), qRegisterMetaType(), and QMetaMethod::invoke().
|
static |
Invokes the member (a signal or a slot name) on the object obj. Returns true if the member could be invoked. Returns false if there is no such member or the parameters did not match.
The invocation can be either synchronous or asynchronous, depending on type:
If type is Qt::DirectConnection, the member will be invoked immediately.
If type is Qt::QueuedConnection, a QEvent will be sent and the member is invoked as soon as the application enters the main event loop.
If type is Qt::BlockingQueuedConnection, the method will be invoked in the same way as for Qt::QueuedConnection, except that the current thread will block until the event is delivered. Using this connection type to communicate between objects in the same thread will lead to deadlocks.
If type is Qt::AutoConnection, the member is invoked synchronously if obj lives in the same thread as the caller; otherwise it will invoke the member asynchronously.
The return value of the member function call is placed in ret. If the invocation is asynchronous, the return value cannot be evaluated. You can pass up to ten arguments (val0, val1, val2, val3, val4, val5, val6, val7, val8, and val9) to the member function.
QGenericArgument and QGenericReturnArgument are internal helper classes. Because signals and slots can be dynamically invoked, you must enclose the arguments using the Q_ARG() and Q_RETURN_ARG() macros. Q_ARG() takes a type name and a const reference of that type; Q_RETURN_ARG() takes a type name and a non-const reference.
You only need to pass the name of the signal or slot to this function, not the entire signature. For example, to asynchronously invoke the animateClick() slot on a QPushButton, use the following code:
QMetaObject::invokeMethod(pushButton, "animateClick",
Qt::QueuedConnection);
With asynchronous method invocations, the parameters must be of types that are known to Qt's meta-object system, because Qt needs to copy the arguments to store them in an event behind the scenes. If you try to use a queued connection and get the error message
QMetaObject::invokeMethod: Unable to handle unregistered datatype 'MyType'
call qRegisterMetaType() to register the data type before you call invokeMethod().
To synchronously invoke the compute(QString, int, double) slot on some arbitrary object obj retrieve its return value:
QString retVal;
QMetaObject::invokeMethod(obj, "compute", Qt::DirectConnection,
Q_RETURN_ARG(QString, retVal),
Q_ARG(QString, "sqrt"),
Q_ARG(int, 42),
Q_ARG(double, 9.7));
If the "compute" slot does not take exactly one QString, one int and one double in the specified order, the call will fail.
See also Q_ARG(), Q_RETURN_ARG(), qRegisterMetaType(), and QMetaMethod::invoke().
|
static |
Invokes the member (a signal or a slot name) on the object obj. Returns true if the member could be invoked. Returns false if there is no such member or the parameters did not match.
The invocation can be either synchronous or asynchronous, depending on type:
If type is Qt::DirectConnection, the member will be invoked immediately.
If type is Qt::QueuedConnection, a QEvent will be sent and the member is invoked as soon as the application enters the main event loop.
If type is Qt::BlockingQueuedConnection, the method will be invoked in the same way as for Qt::QueuedConnection, except that the current thread will block until the event is delivered. Using this connection type to communicate between objects in the same thread will lead to deadlocks.
If type is Qt::AutoConnection, the member is invoked synchronously if obj lives in the same thread as the caller; otherwise it will invoke the member asynchronously.
The return value of the member function call is placed in ret. If the invocation is asynchronous, the return value cannot be evaluated. You can pass up to ten arguments (val0, val1, val2, val3, val4, val5, val6, val7, val8, and val9) to the member function.
QGenericArgument and QGenericReturnArgument are internal helper classes. Because signals and slots can be dynamically invoked, you must enclose the arguments using the Q_ARG() and Q_RETURN_ARG() macros. Q_ARG() takes a type name and a const reference of that type; Q_RETURN_ARG() takes a type name and a non-const reference.
You only need to pass the name of the signal or slot to this function, not the entire signature. For example, to asynchronously invoke the animateClick() slot on a QPushButton, use the following code:
QMetaObject::invokeMethod(pushButton, "animateClick",
Qt::QueuedConnection);
With asynchronous method invocations, the parameters must be of types that are known to Qt's meta-object system, because Qt needs to copy the arguments to store them in an event behind the scenes. If you try to use a queued connection and get the error message
QMetaObject::invokeMethod: Unable to handle unregistered datatype 'MyType'
call qRegisterMetaType() to register the data type before you call invokeMethod().
To synchronously invoke the compute(QString, int, double) slot on some arbitrary object obj retrieve its return value:
QString retVal;
QMetaObject::invokeMethod(obj, "compute", Qt::DirectConnection,
Q_RETURN_ARG(QString, retVal),
Q_ARG(QString, "sqrt"),
Q_ARG(int, 42),
Q_ARG(double, 9.7));
If the "compute" slot does not take exactly one QString, one int and one double in the specified order, the call will fail.
See also Q_ARG(), Q_RETURN_ARG(), qRegisterMetaType(), and QMetaMethod::invoke().
new QMetaMethod QtCore.QMetaObject.Method | ( | int | index | ) |
Returns the meta-data for the method with the given index.
See also methodCount(), methodOffset(), and indexOfMethod().
new int QtCore.QMetaObject.MethodCount | ( | ) |
Returns the number of methods known to the meta-object system in this class, including the number of properties provided by each base class. These include signals and slots as well as member functions declared with the Q_INVOKABLE macro.
Use code like the following to obtain a QStringList containing the methods specific to a given class:
const QMetaObject* metaObject = obj->metaObject();
QStringList methods;
for(int i = metaObject->methodOffset(); i < metaObject->methodCount(); ++i)
methods << QString::fromLatin1(metaObject->method(i).signature());
See also method(), methodOffset(), and indexOfMethod().
new int QtCore.QMetaObject.MethodOffset | ( | ) |
Returns the method offset for this class; i.e. the index position of this class's first member function.
The offset is the sum of all the methods in the class's superclasses (which is always positive since QObject has the deleteLater() slot and a destroyed() signal).
See also method(), methodCount(), and indexOfMethod().
new QObject QtCore.QMetaObject.NewInstance | ( | ) |
Constructs a new instance of this class. You can pass up to ten arguments (val0, val1, val2, val3, val4, val5, val6, val7, val8, and val9) to the constructor. Returns the new object, or 0 if no suitable constructor is available.
Note that only constructors that are declared with the Q_INVOKABLE modifier are made available through the meta-object system.
This function was introduced in Qt 4.5.
See also Q_ARG() and constructor().
new QObject QtCore.QMetaObject.NewInstance | ( | QGenericArgument | val0 | ) |
Constructs a new instance of this class. You can pass up to ten arguments (val0, val1, val2, val3, val4, val5, val6, val7, val8, and val9) to the constructor. Returns the new object, or 0 if no suitable constructor is available.
Note that only constructors that are declared with the Q_INVOKABLE modifier are made available through the meta-object system.
This function was introduced in Qt 4.5.
See also Q_ARG() and constructor().
new QObject QtCore.QMetaObject.NewInstance | ( | QGenericArgument | val0, |
QGenericArgument | val1 | ||
) |
Constructs a new instance of this class. You can pass up to ten arguments (val0, val1, val2, val3, val4, val5, val6, val7, val8, and val9) to the constructor. Returns the new object, or 0 if no suitable constructor is available.
Note that only constructors that are declared with the Q_INVOKABLE modifier are made available through the meta-object system.
This function was introduced in Qt 4.5.
See also Q_ARG() and constructor().
new QObject QtCore.QMetaObject.NewInstance | ( | QGenericArgument | val0, |
QGenericArgument | val1, | ||
QGenericArgument | val2 | ||
) |
Constructs a new instance of this class. You can pass up to ten arguments (val0, val1, val2, val3, val4, val5, val6, val7, val8, and val9) to the constructor. Returns the new object, or 0 if no suitable constructor is available.
Note that only constructors that are declared with the Q_INVOKABLE modifier are made available through the meta-object system.
This function was introduced in Qt 4.5.
See also Q_ARG() and constructor().
new QObject QtCore.QMetaObject.NewInstance | ( | QGenericArgument | val0, |
QGenericArgument | val1, | ||
QGenericArgument | val2, | ||
QGenericArgument | val3 | ||
) |
Constructs a new instance of this class. You can pass up to ten arguments (val0, val1, val2, val3, val4, val5, val6, val7, val8, and val9) to the constructor. Returns the new object, or 0 if no suitable constructor is available.
Note that only constructors that are declared with the Q_INVOKABLE modifier are made available through the meta-object system.
This function was introduced in Qt 4.5.
See also Q_ARG() and constructor().
new QObject QtCore.QMetaObject.NewInstance | ( | QGenericArgument | val0, |
QGenericArgument | val1, | ||
QGenericArgument | val2, | ||
QGenericArgument | val3, | ||
QGenericArgument | val4 | ||
) |
Constructs a new instance of this class. You can pass up to ten arguments (val0, val1, val2, val3, val4, val5, val6, val7, val8, and val9) to the constructor. Returns the new object, or 0 if no suitable constructor is available.
Note that only constructors that are declared with the Q_INVOKABLE modifier are made available through the meta-object system.
This function was introduced in Qt 4.5.
See also Q_ARG() and constructor().
new QObject QtCore.QMetaObject.NewInstance | ( | QGenericArgument | val0, |
QGenericArgument | val1, | ||
QGenericArgument | val2, | ||
QGenericArgument | val3, | ||
QGenericArgument | val4, | ||
QGenericArgument | val5 | ||
) |
Constructs a new instance of this class. You can pass up to ten arguments (val0, val1, val2, val3, val4, val5, val6, val7, val8, and val9) to the constructor. Returns the new object, or 0 if no suitable constructor is available.
Note that only constructors that are declared with the Q_INVOKABLE modifier are made available through the meta-object system.
This function was introduced in Qt 4.5.
See also Q_ARG() and constructor().
new QObject QtCore.QMetaObject.NewInstance | ( | QGenericArgument | val0, |
QGenericArgument | val1, | ||
QGenericArgument | val2, | ||
QGenericArgument | val3, | ||
QGenericArgument | val4, | ||
QGenericArgument | val5, | ||
QGenericArgument | val6 | ||
) |
Constructs a new instance of this class. You can pass up to ten arguments (val0, val1, val2, val3, val4, val5, val6, val7, val8, and val9) to the constructor. Returns the new object, or 0 if no suitable constructor is available.
Note that only constructors that are declared with the Q_INVOKABLE modifier are made available through the meta-object system.
This function was introduced in Qt 4.5.
See also Q_ARG() and constructor().
new QObject QtCore.QMetaObject.NewInstance | ( | QGenericArgument | val0, |
QGenericArgument | val1, | ||
QGenericArgument | val2, | ||
QGenericArgument | val3, | ||
QGenericArgument | val4, | ||
QGenericArgument | val5, | ||
QGenericArgument | val6, | ||
QGenericArgument | val7 | ||
) |
Constructs a new instance of this class. You can pass up to ten arguments (val0, val1, val2, val3, val4, val5, val6, val7, val8, and val9) to the constructor. Returns the new object, or 0 if no suitable constructor is available.
Note that only constructors that are declared with the Q_INVOKABLE modifier are made available through the meta-object system.
This function was introduced in Qt 4.5.
See also Q_ARG() and constructor().
new QObject QtCore.QMetaObject.NewInstance | ( | QGenericArgument | val0, |
QGenericArgument | val1, | ||
QGenericArgument | val2, | ||
QGenericArgument | val3, | ||
QGenericArgument | val4, | ||
QGenericArgument | val5, | ||
QGenericArgument | val6, | ||
QGenericArgument | val7, | ||
QGenericArgument | val8 | ||
) |
Constructs a new instance of this class. You can pass up to ten arguments (val0, val1, val2, val3, val4, val5, val6, val7, val8, and val9) to the constructor. Returns the new object, or 0 if no suitable constructor is available.
Note that only constructors that are declared with the Q_INVOKABLE modifier are made available through the meta-object system.
This function was introduced in Qt 4.5.
See also Q_ARG() and constructor().
new QObject QtCore.QMetaObject.NewInstance | ( | QGenericArgument | val0, |
QGenericArgument | val1, | ||
QGenericArgument | val2, | ||
QGenericArgument | val3, | ||
QGenericArgument | val4, | ||
QGenericArgument | val5, | ||
QGenericArgument | val6, | ||
QGenericArgument | val7, | ||
QGenericArgument | val8, | ||
QGenericArgument | val9 | ||
) |
Constructs a new instance of this class. You can pass up to ten arguments (val0, val1, val2, val3, val4, val5, val6, val7, val8, and val9) to the constructor. Returns the new object, or 0 if no suitable constructor is available.
Note that only constructors that are declared with the Q_INVOKABLE modifier are made available through the meta-object system.
This function was introduced in Qt 4.5.
See also Q_ARG() and constructor().
|
static |
Normalizes the signature of the given method.
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() and normalizedType().
|
static |
Normalizes a type.
See QMetaObject::normalizedSignature() for a description on how Qt normalizes.
Example:
QByteArray normType = QMetaObject::normalizedType(" int const *");
// normType is now "const int*"
This function was introduced in Qt 4.2.
See also normalizedSignature().
new QMetaProperty QtCore.QMetaObject.Property | ( | int | index | ) |
Returns the meta-data for the property with the given index. If no such property exists, a null QMetaProperty is returned.
See also propertyCount(), propertyOffset(), and indexOfProperty().
new int QtCore.QMetaObject.PropertyCount | ( | ) |
Returns the number of properties in this class, including the number of properties provided by each base class.
Use code like the following to obtain a QStringList containing the properties specific to a given class:
const QMetaObject* metaObject = obj->metaObject();
QStringList properties;
for(int i = metaObject->propertyOffset(); i < metaObject->propertyCount(); ++i)
properties << QString::fromLatin1(metaObject->property(i).name());
See also property(), propertyOffset(), and indexOfProperty().
new int QtCore.QMetaObject.PropertyOffset | ( | ) |
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 superclasses (which is always positive since QObject has the name() property).
See also property(), propertyCount(), and indexOfProperty().
|
static |
new QMetaObject QtCore.QMetaObject.SuperClass | ( | ) |
Returns the meta-object of the superclass, or 0 if there is no such object.
See also className().
new string QtCore.QMetaObject.Tr | ( | string | s, |
string | c | ||
) |
new string QtCore.QMetaObject.Tr | ( | string | s, |
string | c, | ||
int | n | ||
) |
new string QtCore.QMetaObject.TrUtf8 | ( | string | s, |
string | c | ||
) |
new string QtCore.QMetaObject.TrUtf8 | ( | string | s, |
string | c, | ||
int | n | ||
) |
new QMetaProperty QtCore.QMetaObject.UserProperty | ( | ) |
Returns the property that has the USER flag set to true.
This function was introduced in Qt 4.2.
See also QMetaProperty::isUser().
|
protected |
|
getset |