summaryrefslogtreecommitdiffstats
path: root/tests/auto/tools/moc/no-keywords.h
blob: bf9beb4663b94df27ae7695e2d5d6c18ca91019f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only

#ifndef NO_KEYWORDS_H
#define NO_KEYWORDS_H

#define QT_NO_KEYWORDS
#undef signals
#undef slots
#undef emit
#define signals FooBar
#define slots Baz
#define emit Yoyodyne

#include <QtCore/QtCore>

#ifdef QT_CONCURRENT_LIB
#include <QtConcurrent/QtConcurrent>
#endif
#ifdef QT_NETWORK_LIB
#include <QtNetwork/QtNetwork>
#endif
#ifdef QT_SQL_LIB
#include <QtSql/QtSql>
#endif
#ifdef QT_DBUS_LIB
#include <QtDBus/QtDBus>
#endif

#undef signals
#undef slots
#undef emit

class MyBooooooostishClass : public QObject
{
    Q_OBJECT
public:
    inline MyBooooooostishClass() {}

Q_SIGNALS:
    void mySignal();

public Q_SLOTS:
    inline void mySlot() { mySignal(); }

private:
    Q_DECL_UNUSED_MEMBER int signals;
    Q_DECL_UNUSED_MEMBER double slots;
};

#define signals Q_SIGNALS
#define slots Q_SLOTS
#define emit Q_EMIT
#undef QT_NO_KEYWORDS

#endif // NO_KEYWORDS_H