1 | /**************************************************************************** |
2 | * Copyright (C) 2018 Woboq GmbH |
3 | * Olivier Goffart <contact at woboq.com> |
4 | * https://woboq.com/ |
5 | * |
6 | * This program is free software: you can redistribute it and/or modify |
7 | * it under the terms of the GNU Lesser General Public License as |
8 | * published by the Free Software Foundation, either version 3 of the |
9 | * License, or (at your option) any later version. |
10 | * |
11 | * This program is distributed in the hope that it will be useful, |
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | * GNU General Public License for more details. |
15 | * |
16 | * You should have received a copy of the GNU Lesser General Public |
17 | * License along with this program. |
18 | * If not, see <http://www.gnu.org/licenses/>. |
19 | */ |
20 | |
21 | #pragma once |
22 | |
23 | #include <QObject> |
24 | #include <wobjectimpl.h> |
25 | |
26 | namespace AnotherTU { |
27 | struct Gaga { |
28 | W_GADGET(Gaga) |
29 | public: |
30 | int m_foo; |
31 | W_PROPERTY(int, foo MEMBER m_foo); |
32 | }; |
33 | |
34 | |
35 | struct InlineGadget { |
36 | W_GADGET(InlineGadget) |
37 | public: |
38 | int m_foo; |
39 | W_PROPERTY(int, foo MEMBER m_foo) |
40 | }; |
41 | |
42 | struct InlineObject : QObject { |
43 | W_OBJECT(InlineObject) |
44 | public: |
45 | int m_foo; |
46 | W_PROPERTY(int, foo MEMBER m_foo) |
47 | }; |
48 | |
49 | #ifdef Q_NAMESPACE // Since Qt 5.8 |
50 | W_NAMESPACE(AnotherTU) |
51 | enum ATTestEnum { |
52 | Key1 = 31, |
53 | Key2, |
54 | Key3 |
55 | }; |
56 | W_ENUM_NS(ATTestEnum, Key1, Key2, Key3) |
57 | #endif |
58 | } |
59 | |
60 | #if defined (__cpp_inline_variables) && Q_CC_MSVC > 192000000 |
61 | W_GADGET_IMPL_INLINE(AnotherTU::InlineGadget) |
62 | W_OBJECT_IMPL_INLINE(AnotherTU::InlineObject) |
63 | |
64 | #ifdef Q_NAMESPACE // Since Qt 5.8 |
65 | namespace Inline_NS { |
66 | W_NAMESPACE(Inline_NS) |
67 | enum InlineEnum { |
68 | I1 = 45, |
69 | I2 |
70 | }; |
71 | W_ENUM_NS(InlineEnum, I1, I2) |
72 | } |
73 | W_NAMESPACE_IMPL_INLINE(Inline_NS) |
74 | #endif |
75 | #endif |
76 | |