QtBase  v6.3.1
cxx11-explicit-override-control.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2012 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Marc Mutz <marc.mutz@kdab.com>
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 #ifndef TESTS_AUTO_CORELIB_TOOLS_MOC_CXX11_EXPLICIT_OVERRIDE_CONTROL_H
29 #define TESTS_AUTO_CORELIB_TOOLS_MOC_CXX11_EXPLICIT_OVERRIDE_CONTROL_H
30 
31 #include <QtCore/QObject>
32 
33 #ifndef Q_MOC_RUN // hide from moc
34 # define override
35 # define final
36 # define sealed
37 #endif
38 
40 QT_WARNING_DISABLE_GCC("-Wsuggest-override")
41 
43 {
44  Q_OBJECT
45 public:
47  : QObject(parent) {}
48 
49 private Q_SLOTS:
50  virtual void pureSlot0() = 0;
51  virtual void pureSlot1() = 0;
52  virtual void pureSlot2() const = 0;
53  virtual void pureSlot3() const = 0;
54 #if 0 // moc doesn't support volatile slots
55  virtual void pureSlot4() volatile = 0;
56  virtual void pureSlot5() volatile = 0;
57  virtual void pureSlot6() const volatile = 0;
58  virtual void pureSlot7() volatile const = 0;
59  virtual void pureSlot8() const volatile = 0;
60  virtual void pureSlot9() volatile const = 0;
61 #endif
62 };
63 
65 {
66  Q_OBJECT
67 public:
70 
71 private Q_SLOTS:
72  void pureSlot0() Q_DECL_FINAL {}
73  void pureSlot1() Q_DECL_FINAL {}
74  void pureSlot2() const Q_DECL_FINAL {}
75  void pureSlot3() Q_DECL_FINAL const {}
76 #if 0 // moc doesn't support volatile slots
77  void pureSlot4() volatile Q_DECL_FINAL {}
78  void pureSlot5() Q_DECL_FINAL volatile {}
79  void pureSlot6() const volatile Q_DECL_FINAL {}
80  void pureSlot7() volatile Q_DECL_FINAL const {}
81  void pureSlot8() const Q_DECL_FINAL volatile {}
82  void pureSlot9() Q_DECL_FINAL volatile const {}
83 #endif
84 };
85 
87 {
88  Q_OBJECT
89 public:
92 
93 private Q_SLOTS:
94  void pureSlot0() final {}
95  void pureSlot1() final {}
96  void pureSlot2() const final {}
97  void pureSlot3() final const {}
98 #if 0 // moc doesn't support volatile slots
99  void pureSlot4() volatile final {}
100  void pureSlot5() final volatile {}
101  void pureSlot6() const volatile final {}
102  void pureSlot7() volatile final const {}
103  void pureSlot8() const final volatile {}
104  void pureSlot9() final volatile const {}
105 #endif
106 };
107 
109 {
110  Q_OBJECT
111 public:
114 
115 private Q_SLOTS:
116  void pureSlot0() sealed {}
117  void pureSlot1() sealed {}
118  void pureSlot2() const sealed {}
119  void pureSlot3() sealed const {}
120 #if 0 // moc doesn't support volatile slots
121  void pureSlot4() volatile sealed {}
122  void pureSlot5() sealed volatile {}
123  void pureSlot6() const volatile sealed {}
124  void pureSlot7() volatile sealed const {}
125  void pureSlot8() const sealed volatile {}
126  void pureSlot9() sealed volatile const {}
127 #endif
128 };
129 
131 {
132  Q_OBJECT
133 public:
136 
137 private Q_SLOTS:
138  void pureSlot0() override {}
139  void pureSlot1() override {}
140  void pureSlot2() const override {}
141  void pureSlot3() override const {}
142 #if 0 // moc doesn't support volatile slots
143  void pureSlot4() volatile override {}
144  void pureSlot5() override volatile {}
145  void pureSlot6() const volatile override {}
146  void pureSlot7() volatile override const {}
147  void pureSlot8() const override volatile {}
148  void pureSlot9() override volatile const {}
149 #endif
150 };
151 
153 {
154  Q_OBJECT
155 public:
158 
159 private Q_SLOTS:
160  void pureSlot0() override {}
161  void pureSlot1() override {}
162  void pureSlot2() const override {}
163  void pureSlot3() override const {}
164 #if 0 // moc doesn't support volatile slots
165  void pureSlot4() volatile override {}
166  void pureSlot5() override volatile {}
167  void pureSlot6() const volatile override {}
168  void pureSlot7() volatile override const {}
169  void pureSlot8() const override volatile {}
170  void pureSlot9() override volatile const {}
171 #endif
172 };
173 
175 {
176  Q_OBJECT
177 public:
180 
181 private Q_SLOTS:
182  void pureSlot0() Q_DECL_FINAL override {}
183  void pureSlot1() override Q_DECL_FINAL {}
184  void pureSlot2() override const Q_DECL_FINAL {}
185  void pureSlot3() Q_DECL_FINAL const override {}
186 #if 0 // moc doesn't support volatile slots
187  void pureSlot4() volatile Q_DECL_FINAL override {}
188  void pureSlot5() override Q_DECL_FINAL volatile {}
189  void pureSlot6() override const volatile Q_DECL_FINAL {}
190  void pureSlot7() volatile override Q_DECL_FINAL const {}
191  void pureSlot8() const Q_DECL_FINAL override volatile {}
192  void pureSlot9() Q_DECL_FINAL volatile const override {}
193 #endif
194 };
195 
197 {
198  Q_OBJECT
199 public:
202 
203 private Q_SLOTS:
204  void pureSlot0() final override {}
205  void pureSlot1() override final {}
206  void pureSlot2() override const final {}
207  void pureSlot3() final const override {}
208 #if 0 // moc doesn't support volatile slots
209  void pureSlot4() volatile final override {}
210  void pureSlot5() override final volatile {}
211  void pureSlot6() const volatile final override {}
212  void pureSlot7() volatile final override const {}
213  void pureSlot8() const override final volatile {}
214  void pureSlot9() override final volatile const {}
215 #endif
216 };
217 
219 {
220  Q_OBJECT
221 public:
224 
225 private Q_SLOTS:
226  void pureSlot0() sealed override {}
227  void pureSlot1() override sealed {}
228  void pureSlot2() override const sealed {}
229  void pureSlot3() sealed const override {}
230 #if 0 // moc doesn't support volatile slots
231  void pureSlot4() volatile sealed override {}
232  void pureSlot5() sealed override volatile {}
233  void pureSlot6() const override volatile sealed {}
234  void pureSlot7() volatile sealed override const {}
235  void pureSlot8() const sealed volatile override {}
236  void pureSlot9() override sealed volatile const {}
237 #endif
238 };
239 
241 
242 #ifndef Q_MOC_RUN
243 # undef final
244 # undef sealed
245 # undef override
246 #endif
247 
248 #endif // TESTS_AUTO_CORELIB_TOOLS_MOC_CXX11_EXPLICIT_OVERRIDE_CONTROL_H
ExplicitOverrideControlBase(QObject *parent=nullptr)
ExplicitOverrideControlFinalCxx11(QObject *parent=nullptr)
ExplicitOverrideControlFinalQt(QObject *parent=nullptr)
ExplicitOverrideControlOverrideQt(QObject *parent=nullptr)
ExplicitOverrideControlSealed(QObject *parent=nullptr)
The QObject class is the base class of all Qt objects.
Definition: qobject.h:125
QObject * parent() const
Definition: qobject.h:409
auto it unsigned count const
Definition: hb-iter.hh:848
#define QT_WARNING_POP
#define QT_WARNING_DISABLE_GCC(text)
#define QT_WARNING_PUSH
#define Q_OBJECT
Definition: qtmetamacros.h:158
#define Q_SLOTS
Definition: qtmetamacros.h:80
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent