diff options
Diffstat (limited to 'src/corelib/global')
-rw-r--r-- | src/corelib/global/qfunctionpointer.h | 23 | ||||
-rw-r--r-- | src/corelib/global/qfunctionpointer.qdoc | 9 | ||||
-rw-r--r-- | src/corelib/global/qglobal.cpp | 7 | ||||
-rw-r--r-- | src/corelib/global/qglobal.h | 6 |
4 files changed, 33 insertions, 12 deletions
diff --git a/src/corelib/global/qfunctionpointer.h b/src/corelib/global/qfunctionpointer.h new file mode 100644 index 0000000000..3884954f89 --- /dev/null +++ b/src/corelib/global/qfunctionpointer.h @@ -0,0 +1,23 @@ +// Copyright (C) 2022 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +#ifndef QFUNCTIONPOINTER_H +#define QFUNCTIONPOINTER_H + +#include <QtCore/qtconfigmacros.h> + +#if 0 +#pragma qt_class(QFunctionPointer) +#endif + +#if defined(__cplusplus) + +QT_BEGIN_NAMESPACE + +typedef void (*QFunctionPointer)(); + +QT_END_NAMESPACE + +#endif // __cplusplus + +#endif // QFUNCTIONPOINTER_H diff --git a/src/corelib/global/qfunctionpointer.qdoc b/src/corelib/global/qfunctionpointer.qdoc new file mode 100644 index 0000000000..13f82bc011 --- /dev/null +++ b/src/corelib/global/qfunctionpointer.qdoc @@ -0,0 +1,9 @@ +// Copyright (C) 2022 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only + +/*! \typedef QFunctionPointer + \relates <QFunctionPointer> + + This is a typedef for \c{void (*)()}, a pointer to a function that takes + no arguments and returns void. +*/ diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 171232e3dc..7077efb662 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -166,13 +166,6 @@ using namespace Qt::StringLiterals; \sa <QtAlgorithms>, QSysInfo */ -/*! \typedef QFunctionPointer - \relates <QFunctionPointer> - - This is a typedef for \c{void (*)()}, a pointer to a function that takes - no arguments and returns void. -*/ - /* Dijkstra's bisection algorithm to find the square root of an integer. Deliberately not exported as part of the Qt API, but used in both diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 3bccae6729..4e9e0609f1 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -50,11 +50,6 @@ QT_BEGIN_NAMESPACE #if defined(__cplusplus) -#if 0 -#pragma qt_class(QFunctionPointer) -#endif -typedef void (*QFunctionPointer)(); - #if !defined(Q_UNIMPLEMENTED) # define Q_UNIMPLEMENTED() qWarning("Unimplemented code.") #endif @@ -92,6 +87,7 @@ QT_END_NAMESPACE #include <QtCore/qdarwinhelpers.h> #include <QtCore/qexceptionhandling.h> #include <QtCore/qforeach.h> +#include <QtCore/qfunctionpointer.h> #include <QtCore/qglobalstatic.h> #include <QtCore/qmalloc.h> #include <QtCore/qminmax.h> |