summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2010-05-28 09:49:20 (GMT)
committerOlivier Goffart <olivier.goffart@nokia.com>2010-05-28 09:53:04 (GMT)
commit49a5cf7cd44584e04d1f54f3fbd0d5c86fe55c83 (patch)
tree4ec9718878fd6788c89a1538c57247c26cc05eab /src/corelib/kernel
parentb9d899339118f24b34182e7dbe7aed5956d927e7 (diff)
downloadQt-49a5cf7cd44584e04d1f54f3fbd0d5c86fe55c83.zip
Qt-49a5cf7cd44584e04d1f54f3fbd0d5c86fe55c83.tar.gz
Qt-49a5cf7cd44584e04d1f54f3fbd0d5c86fe55c83.tar.bz2
QMetaMethod::invoke: Document that the function does not check the arguments
And added an assert to ease debugging Task-number: QTBUG-10945
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r--src/corelib/kernel/qmetaobject.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp
index 4ad78fd..79a38cd 100644
--- a/src/corelib/kernel/qmetaobject.cpp
+++ b/src/corelib/kernel/qmetaobject.cpp
@@ -1454,6 +1454,11 @@ QMetaMethod::MethodType QMetaMethod::methodType() const
If the "compute" slot does not take exactly one QString, one int
and one double in the specified order, the call will fail.
+ \warning this method will not test the validity of the arguments: \a object
+ must be an instance of the class of the QMetaObject of which this QMetaMethod
+ has been constructed with. The arguments must have the same type as the ones
+ expected by the method, else, the behaviour is undefined.
+
\sa Q_ARG(), Q_RETURN_ARG(), qRegisterMetaType(), QMetaObject::invokeMethod()
*/
bool QMetaMethod::invoke(QObject *object,
@@ -1473,6 +1478,8 @@ bool QMetaMethod::invoke(QObject *object,
if (!object || !mobj)
return false;
+ Q_ASSERT(mobj->cast(object));
+
// check return type
if (returnValue.data()) {
const char *retType = typeName();