diff options
Diffstat (limited to 'src/corelib/kernel/qtmetamacros.h')
-rw-r--r-- | src/corelib/kernel/qtmetamacros.h | 78 |
1 files changed, 23 insertions, 55 deletions
diff --git a/src/corelib/kernel/qtmetamacros.h b/src/corelib/kernel/qtmetamacros.h index 96b1ada57e..ae68abcfee 100644 --- a/src/corelib/kernel/qtmetamacros.h +++ b/src/corelib/kernel/qtmetamacros.h @@ -1,42 +1,6 @@ -/**************************************************************************** -** -** Copyright (C) 2019 The Qt Company Ltd. -** Copyright (C) 2019 Olivier Goffart <ogoffart@woboq.com> -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtCore module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2019 The Qt Company Ltd. +// Copyright (C) 2019 Olivier Goffart <ogoffart@woboq.com> +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QTMETAMACROS_H #define QTMETAMACROS_H @@ -125,26 +89,27 @@ QT_BEGIN_NAMESPACE # define QT_TR_FUNCTIONS #endif -#ifdef Q_CLANG_QDOC +#ifdef Q_QDOC #define QT_TR_FUNCTIONS #endif -#if defined(Q_CC_INTEL) -// Cannot redefine the visibility of a method in an exported class -# define Q_DECL_HIDDEN_STATIC_METACALL -#else -# define Q_DECL_HIDDEN_STATIC_METACALL Q_DECL_HIDDEN -#endif +#define Q_DECL_HIDDEN_STATIC_METACALL Q_DECL_HIDDEN -#if defined(Q_CC_CLANG) && Q_CC_CLANG >= 306 -# define Q_OBJECT_NO_OVERRIDE_WARNING QT_WARNING_DISABLE_CLANG("-Winconsistent-missing-override") -#elif defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && Q_CC_GNU >= 501 +#if defined(Q_CC_CLANG) +# if Q_CC_CLANG >= 1100 +# define Q_OBJECT_NO_OVERRIDE_WARNING QT_WARNING_DISABLE_CLANG("-Winconsistent-missing-override") QT_WARNING_DISABLE_CLANG("-Wsuggest-override") +# elif Q_CC_CLANG >= 306 +# define Q_OBJECT_NO_OVERRIDE_WARNING QT_WARNING_DISABLE_CLANG("-Winconsistent-missing-override") +# endif +#elif defined(Q_CC_GNU) && Q_CC_GNU >= 501 # define Q_OBJECT_NO_OVERRIDE_WARNING QT_WARNING_DISABLE_GCC("-Wsuggest-override") +#elif defined(Q_CC_MSVC) +# define Q_OBJECT_NO_OVERRIDE_WARNING QT_WARNING_DISABLE_MSVC(26433) #else # define Q_OBJECT_NO_OVERRIDE_WARNING #endif -#if defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && Q_CC_GNU >= 600 +#if defined(Q_CC_GNU) && Q_CC_GNU >= 600 # define Q_OBJECT_NO_ATTRIBUTES_WARNING QT_WARNING_DISABLE_GCC("-Wattributes") #else # define Q_OBJECT_NO_ATTRIBUTES_WARNING @@ -164,17 +129,17 @@ private: \ Q_OBJECT_NO_ATTRIBUTES_WARNING \ Q_DECL_HIDDEN_STATIC_METACALL static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **); \ QT_WARNING_POP \ - struct QPrivateSignal {}; \ + struct QPrivateSignal { explicit QPrivateSignal() = default; }; \ QT_ANNOTATE_CLASS(qt_qobject, "") /* qmake ignore Q_OBJECT */ #define Q_OBJECT_FAKE Q_OBJECT QT_ANNOTATE_CLASS(qt_fake, "") #ifndef QT_NO_META_MACROS -/* qmake ignore Q_GADGET */ -#define Q_GADGET \ +/* qmake ignore Q_GADGET_EXPORT */ +#define Q_GADGET_EXPORT(...) \ public: \ - static const QMetaObject staticMetaObject; \ + static __VA_ARGS__ const QMetaObject staticMetaObject; \ void qt_check_for_QGADGET_macro(); \ typedef void QtGadgetHelper; \ private: \ @@ -185,7 +150,10 @@ private: \ QT_ANNOTATE_CLASS(qt_qgadget, "") \ /*end*/ -/* qmake ignore Q_NAMESPACE_EXPORT */ +/* qmake ignore Q_GADGET */ +#define Q_GADGET Q_GADGET_EXPORT() + + /* qmake ignore Q_NAMESPACE_EXPORT */ #define Q_NAMESPACE_EXPORT(...) \ extern __VA_ARGS__ const QMetaObject staticMetaObject; \ QT_ANNOTATE_CLASS(qt_qnamespace, "") \ |