summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qglobal.cpp
diff options
context:
space:
mode:
authorPeter Kümmel <syntheticpp@gmx.net>2015-11-10 18:57:40 +0100
committerOlivier Goffart (Woboq GmbH) <ogoffart@woboq.com>2016-02-15 12:33:24 +0000
commitab8cc8387f1891ccf99721bfe5a6182c507e332f (patch)
treea892939a744e2fa65dba687f0f42e293b45963f5 /src/corelib/global/qglobal.cpp
parente41e0346698c4578da4625ef3cce7f5417b71e08 (diff)
Add qOverload to select overloaded functions
[ChangeLog][QtCore][Global] qOverload added to select overloaded functions. Change-Id: I7c9b1b054e6631eca0b5594db59e1202ef552c33 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib/global/qglobal.cpp')
-rw-r--r--src/corelib/global/qglobal.cpp43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index a7ed29d859..e4fa0f7391 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -921,6 +921,49 @@ Q_STATIC_ASSERT_X(QT_POINTER_SIZE == sizeof(void *), "QT_POINTER_SIZE defined in
\sa qMin(), qMax()
*/
+/*! \fn auto qOverload(T functionPointer)
+ \relates <QtGlobal>
+ \since 5.7
+
+ qOverload() returns a pointer to an overloaded function. The template
+ parameter is the list of the argument types of the function.
+ \a functionPointer is the pointer to the (member) function:
+
+ \snippet code/src_corelib_global_qglobal.cpp 52
+
+ If a member function is also const-overladed \l qConstOverload and
+ \l qNonConstOverload needs to be used.
+
+ qOverload() needs C++14 enabled. In C++11 only code the helper
+ classes QOverload, QConstOverload, and QNonConstOverload could be used directly:
+
+ \snippet code/src_corelib_global_qglobal.cpp 53
+
+ \sa qConstOverload(), qNonConstOverload()
+*/
+
+/*! \fn auto qConstOverload(T memberFunctionPointer)
+ \relates <QtGlobal>
+ \since 5.7
+
+ qConstOverload() returns a pointer to an constant member function:
+
+ \snippet code/src_corelib_global_qglobal.cpp 54
+
+ \sa qOverload, qNonConstOverload
+*/
+
+/*! \fn auto qNonConstOverload(T memberFunctionPointer)
+ \relates <QtGlobal>
+ \since 5.7
+
+ qNonConstOverload() eturns a pointer to an non constant member function:
+
+ \snippet code/src_corelib_global_qglobal.cpp 54
+
+ \sa qOverload, qNonConstOverload
+*/
+
/*!
\macro QT_VERSION_CHECK
\relates <QtGlobal>