12#include <qtcore_tracepoints_p.h>
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
57
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
273
274
275QEvent::QEvent(Type type)
276 : t(type), m_reserved(0),
277 m_inputEvent(
false), m_pointerEvent(
false), m_singlePointEvent(
false)
279 Q_TRACE(QEvent_ctor,
this, type);
283
284
285
286
289
290
291
292
293
294
297
298
299
300
301
302
303
306
307
308
309
310
311
312
315
316
317
318
319
320
321
324
325
326
330 if (m_posted && QCoreApplication::instance())
331 QCoreApplicationPrivate::removePostedEvent(
this);
335
336
337
338QEvent *QEvent::clone()
const
339{
return new QEvent(*
this); }
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
359
360
361
362
363
364
365
366
367
368
369
373
374
375
376
377
378
379
380
381
382
383
387
388
389
390
393
394
395
396
397
400
401
402
403
404
405
408
409
410
411
412
413
416
417
418
419
420
424struct QBasicAtomicBitField {
426 BitsPerInt = std::numeric_limits<uint>::digits,
427 NumInts = (N + BitsPerInt - 1) / BitsPerInt,
433 QBasicAtomicInteger<uint> next;
434 QBasicAtomicInteger<uint> data[NumInts];
436 constexpr QBasicAtomicBitField() =
default;
438 bool allocateSpecific(
int which)
noexcept
440 QBasicAtomicInteger<uint> &entry = data[which / BitsPerInt];
441 const uint old = entry.loadRelaxed();
442 const uint bit = 1U << (which % BitsPerInt);
445 return (entry.fetchAndOrRelaxed(bit) & bit) == 0;
455 int allocateNext()
noexcept
463 for (uint i = next.loadRelaxed(); i < NumBits; ++i) {
464 if (allocateSpecific(i)) {
466 const uint oldNext = next.loadRelaxed();
467 next.testAndSetRelaxed(oldNext, qMax(i + 1, oldNext));
479Q_CONSTINIT
static UserEventTypeRegistry userEventTypeRegistry {};
484 if (id < UserEventTypeRegistry::NumBits && id >= 0 && userEventTypeRegistry.allocateSpecific(id))
488 return userEventTypeRegistry.allocateNext();
492
493
494
495
496
497
498
499
500
501
502
503
504int QEvent::registerEventType(
int hint)
noexcept
506 const int result = registerEventTypeZeroBased(QEvent::MaxUser - hint);
507 return result < 0 ? -1 : QEvent::MaxUser - result ;
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
532
533
534
535QTimerEvent::QTimerEvent(
int timerId)
536 : QTimerEvent(Qt::TimerId{timerId})
540
541
542
543
544
545QTimerEvent::QTimerEvent(Qt::TimerId timerId)
546 : QEvent(Timer), m_id(timerId)
548 static_assert(
sizeof(Qt::TimerId) ==
sizeof(
int));
554
555
556
557
558
561
562
563
564
565
566
567
570
571
572
573
574
575
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
598
599
600
601
602
603
604
605
606QChildEvent::QChildEvent(Type type, QObject *child)
607 : QEvent(type), c(child)
613
614
615
616
619
620
621
622
623
626
627
628
629
630
633
634
635
636
637
641
642
643
644
645
646
647
648
649
650
651
654
655
656
657QDynamicPropertyChangeEvent::QDynamicPropertyChangeEvent(
const QByteArray &name)
658 : QEvent(QEvent::DynamicPropertyChange), n(name)
665
666
667
668
669
670
671
674
675
684#include "moc_qcoreevent.cpp"
QDeferredDeleteEvent(int loopLevel, int scopeLevel)
Constructs a deferred delete event with the given loop and scope level.
static int registerEventTypeZeroBased(int id) noexcept
QBasicAtomicBitField< QEvent::MaxUser - QEvent::User+1 > UserEventTypeRegistry
QT_BEGIN_NAMESPACE Q_TRACE_POINT(qtcore, QEvent_ctor, QEvent *event, QEvent::Type type)
#define Q_IMPL_EVENT_COMMON(Class)