1/****************************************************************************
2**
3** Copyright (C) 2016 The Qt Company Ltd.
4** Contact: https://www.qt.io/licensing/
5**
6** This file is part of the test suite of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:GPL-EXCEPT$
9** Commercial License Usage
10** Licensees holding valid commercial Qt licenses may use this file in
11** accordance with the commercial license agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and The Qt Company. For licensing terms
14** and conditions see https://www.qt.io/terms-conditions. For further
15** information use the contact form at https://www.qt.io/contact-us.
16**
17** GNU General Public License Usage
18** Alternatively, this file may be used under the terms of the GNU
19** General Public License version 3 as published by the Free Software
20** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
21** included in the packaging of this file. Please review the following
22** information to ensure the GNU General Public License requirements will
23** be met: https://www.gnu.org/licenses/gpl-3.0.html.
24**
25** $QT_END_LICENSE$
26**
27****************************************************************************/
28
29#ifndef NO_KEYWORDS_H
30#define NO_KEYWORDS_H
31
32#define QT_NO_KEYWORDS
33#undef signals
34#undef slots
35#undef emit
36#define signals FooBar
37#define slots Baz
38#define emit Yoyodyne
39
40#include <QtCore/QtCore>
41
42#ifdef QT_CONCURRENT_LIB
43#include <QtConcurrent/QtConcurrent>
44#endif
45#ifdef QT_NETWORK_LIB
46#include <QtNetwork/QtNetwork>
47#endif
48#ifdef QT_SQL_LIB
49#include <QtSql/QtSql>
50#endif
51#ifdef QT_DBUS_LIB
52#include <QtDBus/QtDBus>
53#endif
54
55#undef signals
56#undef slots
57#undef emit
58
59class MyBooooooostishClass : public QObject
60{
61 Q_OBJECT
62public:
63 inline MyBooooooostishClass() {}
64
65Q_SIGNALS:
66 void mySignal();
67
68public Q_SLOTS:
69 inline void mySlot() { mySignal(); }
70
71private:
72 int signals;
73 double slots;
74};
75
76#define signals Q_SIGNALS
77#define slots Q_SLOTS
78#define emit Q_EMIT
79#undef QT_NO_KEYWORDS
80
81#endif // NO_KEYWORDS_H
82

source code of qtbase/tests/auto/tools/moc/no-keywords.h