summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qmetaobject.cpp
diff options
context:
space:
mode:
authorAhmad Samir <a.samirh78@gmail.com>2025-09-26 23:33:46 +0300
committerAhmad Samir <a.samirh78@gmail.com>2025-09-30 21:56:49 +0300
commit7818d38b706ba53e586a5d92955367b74845632a (patch)
treefc841dae621fe75ad744e5dcfa4a3310e6a6ac45 /src/corelib/kernel/qmetaobject.cpp
parentf79245495bb8fde3b581da35f2e4357e41e7018f (diff)
QMetaObject: document what a "cloned" function is wrt. the meta-object
This is copied, with some modifications, from the comment in handleDefaultArguments() in moc.cpp. Change-Id: Idef95f3873ae3e7447ee4065adbc14ca5e34a57f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/kernel/qmetaobject.cpp')
-rw-r--r--src/corelib/kernel/qmetaobject.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp
index db10b1cbd2f..221e84c65d3 100644
--- a/src/corelib/kernel/qmetaobject.cpp
+++ b/src/corelib/kernel/qmetaobject.cpp
@@ -1883,7 +1883,7 @@ bool QMetaObject::invokeMethodImpl(QObject *object, QtPrivate::QSlotObjectBase *
\internal
\value Compatibility
- \value Cloned
+ \value Cloned // See QMetaObjectPrivate::originalClone()
\value Scriptable
*/
@@ -4563,9 +4563,15 @@ const char *QMetaClassInfo::value() const
/*!
\internal
- If the local_method_index is a cloned method, return the index of the original.
+ If the \a local_method_index is a cloned method, return the index of the original.
- Example: if the index of "destroyed()" is passed, the index of "destroyed(QObject*)" is returned
+ A "cloned" method is a function with a default argument, this is handled by
+ pretending there is an overload without the argument, and the original function
+ is the overload with all arguments present.
+
+ Example: for a function \c {QObject::destroyed(QObject *o = nullptr}, if the
+ index of \c {destroyed()} is passed, the index of \c {destroyed(QObject*)}
+ is returned.
*/
int QMetaObjectPrivate::originalClone(const QMetaObject *mobj, int local_method_index)
{