diff options
-rw-r--r-- | src/corelib/CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/corelib/global/qglobal.cpp | 3 | ||||
-rw-r--r-- | src/corelib/global/qglobal.h | 1 | ||||
-rw-r--r-- | src/corelib/global/qlibraryinfo.cpp | 4 | ||||
-rw-r--r-- | src/corelib/global/qlibraryinfo.h | 13 | ||||
-rw-r--r-- | src/corelib/global/qtversion.h | 38 |
6 files changed, 44 insertions, 16 deletions
diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index 1d758a7482..fdaef27e5f 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -95,6 +95,7 @@ qt_internal_add_module(Core global/qttranslation.h global/qttypetraits.h global/qtversionchecks.h + global/qtversion.h global/qtypeinfo.h global/qtypes.cpp global/qtypes.h ${core_version_tagging_files} diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 238b9cf4b4..cddf446392 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -100,7 +100,8 @@ using namespace Qt::StringLiterals; \row \li \l <QtTranslation> \li Qt translation helpers \row \li \l <QtTypeTraits> \li Qt type traits \row \li \l <QtTypes> \li Qt fundamental type declarations - \row \li \l <QtVersionChecks> \li Qt Version related checks + \row \li \l <QtVersionChecks> \li QT_VERSION_CHECK and related checks + \row \li \l <QtVersion> \li QT_VERSION_STR and qVersion() \endtable */ diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index f78d7e9445..fe3403fc60 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -37,6 +37,7 @@ #include <QtCore/qtypes.h> #include <QtCore/qtclasshelpermacros.h> +#include <QtCore/qtversion.h> #ifndef __ASSEMBLER__ #if defined(__cplusplus) diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp index 64fc9fff01..715bda488c 100644 --- a/src/corelib/global/qlibraryinfo.cpp +++ b/src/corelib/global/qlibraryinfo.cpp @@ -661,7 +661,7 @@ QStringList QLibraryInfo::platformPluginArguments(const QString &platformName) /*! \macro QT_VERSION_STR - \relates <QLibraryInfo> + \relates <QtVersion> This macro expands to a string that specifies Qt's version number (for example, "6.1.2"). This is the version with which the application is @@ -672,7 +672,7 @@ QStringList QLibraryInfo::platformPluginArguments(const QString &platformName) */ /*! - \relates <QLibraryInfo> + \relates <QtVersion> Returns the version number of Qt at runtime as a string (for example, "6.1.2"). This is the version of the Qt library in use at \e runtime, diff --git a/src/corelib/global/qlibraryinfo.h b/src/corelib/global/qlibraryinfo.h index 71d9a01308..dae050f9cc 100644 --- a/src/corelib/global/qlibraryinfo.h +++ b/src/corelib/global/qlibraryinfo.h @@ -69,19 +69,6 @@ Q_CORE_EXPORT Q_DECL_CONST_FUNCTION bool qSharedBuild() noexcept; #endif // __cplusplus -/* - * If we're compiling C++ code: - * - and this is a non-namespace build, declare qVersion as extern "C" - * - and this is a namespace build, declare it as a regular function - * (we're already inside QT_BEGIN_NAMESPACE / QT_END_NAMESPACE) - * If we're compiling C code, simply declare the function. If Qt was compiled - * in a namespace, qVersion isn't callable anyway. - */ -#if !defined(QT_NAMESPACE) && defined(__cplusplus) && !defined(Q_QDOC) -extern "C" -#endif -Q_CORE_EXPORT Q_DECL_CONST_FUNCTION const char *qVersion(void) Q_DECL_NOEXCEPT; - QT_END_NAMESPACE #endif // QLIBRARYINFO_H diff --git a/src/corelib/global/qtversion.h b/src/corelib/global/qtversion.h new file mode 100644 index 0000000000..775f2479a9 --- /dev/null +++ b/src/corelib/global/qtversion.h @@ -0,0 +1,38 @@ +// Copyright (C) 2016 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 QTVERSION_H +#define QTVERSION_H + +#if 0 +#pragma qt_class(QtVersion) +#pragma qt_sync_stop_processing +#endif + +#ifndef __ASSEMBLER__ + +#include <QtCore/qcompilerdetection.h> +#include <QtCore/qtconfigmacros.h> +#include <QtCore/qtcoreexports.h> + +QT_BEGIN_NAMESPACE + +/* + * If we're compiling C++ code: + * - and this is a non-namespace build, declare qVersion as extern "C" + * - and this is a namespace build, declare it as a regular function + * (we're already inside QT_BEGIN_NAMESPACE / QT_END_NAMESPACE) + * If we're compiling C code, simply declare the function. If Qt was compiled + * in a namespace, qVersion isn't callable anyway. + */ +#if !defined(QT_NAMESPACE) && defined(__cplusplus) && !defined(Q_QDOC) +extern "C" +#endif +/* defined in qlibraryinfo.cpp */ +Q_CORE_EXPORT Q_DECL_CONST_FUNCTION const char *qVersion(void) Q_DECL_NOEXCEPT; + +QT_END_NAMESPACE + +#endif // __ASSEMBLER__ + +#endif // QTVERSION_H |