Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qoverload.qdoc
Go to the documentation of this file.
1// Copyright (C) 2022 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
3
4/*!
5 \headerfile <QOverload>
6 \inmodule QtCore
7 \ingroup funclists
8 \brief Functions for resolving overloads.
9*/
10
11/*! \fn template <typename T> auto qOverload(T functionPointer)
12 \relates <QOverload>
13 \since 5.7
14
15 Returns a pointer to an overloaded function. The template
16 parameter is the list of the argument types of the function.
17 \a functionPointer is the pointer to the (member) function:
18
19 \snippet code/src_corelib_global_qglobal.cpp 52
20
21 If a member function is also const-overloaded \l qConstOverload and
22 \l qNonConstOverload need to be used.
23
24 \sa qConstOverload(), qNonConstOverload(), {Differences between String-Based
25 and Functor-Based Connections}
26*/
27
28/*! \fn template <typename T> auto qConstOverload(T memberFunctionPointer)
29 \relates <QOverload>
30 \since 5.7
31
32 Returns the \a memberFunctionPointer pointer to a constant member function:
33
34 \snippet code/src_corelib_global_qglobal.cpp 54
35
36 \sa qOverload, qNonConstOverload, {Differences between String-Based
37 and Functor-Based Connections}
38*/
39
40/*! \fn template <typename T> auto qNonConstOverload(T memberFunctionPointer)
41 \relates <QOverload>
42 \since 5.7
43
44 Returns the \a memberFunctionPointer pointer to a non-constant member function:
45
46 \snippet code/src_corelib_global_qglobal.cpp 54
47
48 \sa qOverload, qConstOverload, {Differences between String-Based
49 and Functor-Based Connections}
50*/