diff options
author | Ivan Solovev <ivan.solovev@qt.io> | 2022-09-30 12:28:19 +0200 |
---|---|---|
committer | Ivan Solovev <ivan.solovev@qt.io> | 2022-10-06 11:36:46 +0200 |
commit | d7cca67352c7e6ef69222b340b6488b48f8fae30 (patch) | |
tree | 677f451747caceb309cb7930bcb33675b5310813 /src/corelib/global | |
parent | 0b791f6a90714deb2e46d83e072aa104707fb10f (diff) |
Move QFunctionPointer typedef to a separate header
Task-number: QTBUG-99313
Task-number: QTBUG-106154
Change-Id: I8c62e5c2c2f80d5ce1d4dce69eebbe7d1ebbfd52
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
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> |