6#if !defined(Q_OS_DARWIN) && !defined(Q_OS_WIN)
10#if defined(Q_OS_DARWIN)
11#include <QtCore/private/qcore_mac_p.h>
14#include <qversionnumber.h>
18#include <QtCore/private/qjnihelpers_p.h>
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
58
59
60
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
108
109
110
111
112
115
116
117
118
119
126#if !defined(Q_OS_DARWIN) && !defined(Q_OS_WIN)
132#ifndef QT_BOOTSTRAPPED
133 const QVersionNumber v = QVersionNumber::fromString(QJniObject::getStaticObjectField(
134 "android/os/Build$VERSION",
"RELEASE",
"Ljava/lang/String;").toString());
136 version.m_major = v.majorVersion();
137 version.m_minor = v.minorVersion();
138 version.m_micro = v.microVersion();
143 version.m_major = -1;
144 version.m_minor = -1;
146 static const struct {
186 const size_t versionIdx = QtAndroidPrivate::androidSdkVersion() - 1;
187 if (versionIdx <
sizeof(versions) /
sizeof(versions[0])) {
188 version.m_major = versions[versionIdx].major;
189 version.m_minor = versions[versionIdx].minor;
193 version.m_micro = versionIdx == 5 ? 1 : -1;
195 version.m_major = -1;
196 version.m_minor = -1;
197 version.m_micro = -1;
205 return lhs >= 0 && rhs >= 0 ? lhs - rhs : 0;
211 if (v1.m_major == v2.m_major) {
212 if (v1.m_minor == v2.m_minor) {
221
222
223
224
225
226
227
228
229
230
231
234
235
236
237
238
239
240
241
242
243
244
245
248
249
250
251
252
253
254
255
256
257
258
259
262
263
264
265
266
267
268
269
270
271
272
273
276
277
278
279
282
283
284
285
286
287
290
291
292
293
294
295
296
297
300
301
302
303
304
305
310 return QStringLiteral(
"Windows");
313 return QStringLiteral(
"Mac OS");
315 return QStringLiteral(
"Mac OS X");
317 return QStringLiteral(
"OS X");
318 return QStringLiteral(
"macOS");
322 return QStringLiteral(
"iPhone OS");
323 return QStringLiteral(
"iOS");
326 return QStringLiteral(
"tvOS");
328 return QStringLiteral(
"watchOS");
330 return QStringLiteral(
"visionOS");
332 return QStringLiteral(
"Android");
340
341
342
343
344
348 return std::find(types.begin(), types.end(), type()) != types.end();
353 return std::find(types.begin(), types.end(), type) != types.end();
356#ifndef QT_BOOTSTRAPPED
359
360
361
362
364 QOperatingSystemVersion(QOperatingSystemVersion::Windows, 6, 1);
367
368
369
370
372 QOperatingSystemVersion(QOperatingSystemVersion::Windows, 6, 2);
375
376
377
378
380 QOperatingSystemVersion(QOperatingSystemVersion::Windows, 6, 3);
383
384
385
386
388 QOperatingSystemVersion(QOperatingSystemVersion::Windows, 10);
391
392
393
394
395
399
400
401
402
403
407
408
409
410
411
415
416
417
418
419
423
424
425
426
427
431
432
433
434
435
439
440
441
442
443
447
448
449
450
451
455
456
457
458
459
463
464
465
466
470
471
472
473
477
478
479
480
483
484
485
486
489
490
491
492
494 QOperatingSystemVersion(QOperatingSystemVersion::MacOS, 10, 9);
497
498
499
500
502 QOperatingSystemVersion(QOperatingSystemVersion::MacOS, 10, 10);
505
506
507
508
510 QOperatingSystemVersion(QOperatingSystemVersion::MacOS, 10, 11);
513
514
515
516
518 QOperatingSystemVersion(QOperatingSystemVersion::MacOS, 10, 12);
521
522
523
524
526 QOperatingSystemVersion(QOperatingSystemVersion::MacOS, 10, 13);
529
530
531
532
534 QOperatingSystemVersion(QOperatingSystemVersion::MacOS, 10, 14);
537
538
539
540
542 QOperatingSystemVersion(QOperatingSystemVersion::MacOS, 10, 15);
545
546
547
548
550 QOperatingSystemVersion(QOperatingSystemVersion::MacOS, 11, 0);
553
554
555
556
558 QOperatingSystemVersion(QOperatingSystemVersion::MacOS, 12, 0);
561
562
563
564
568
569
570
571
574
575
576
577
580
581
582
583
585 QOperatingSystemVersion(QOperatingSystemVersion::Android, 4, 1);
588
589
590
591
592
594 QOperatingSystemVersion(QOperatingSystemVersion::Android, 4, 2);
597
598
599
600
601
603 QOperatingSystemVersion(QOperatingSystemVersion::Android, 4, 3);
606
607
608
609
611 QOperatingSystemVersion(QOperatingSystemVersion::Android, 4, 4);
614
615
616
617
619 QOperatingSystemVersion(QOperatingSystemVersion::Android, 5, 0);
622
623
624
625
626
628 QOperatingSystemVersion(QOperatingSystemVersion::Android, 5, 1);
631
632
633
634
636 QOperatingSystemVersion(QOperatingSystemVersion::Android, 6, 0);
639
640
641
642
644 QOperatingSystemVersion(QOperatingSystemVersion::Android, 7, 0);
647
648
649
650
651
653 QOperatingSystemVersion(QOperatingSystemVersion::Android, 7, 1);
656
657
658
659
661 QOperatingSystemVersion(QOperatingSystemVersion::Android, 8, 0);
664
665
666
667
669 QOperatingSystemVersion(QOperatingSystemVersion::Android, 8, 1);
672
673
674
675
677 QOperatingSystemVersion(QOperatingSystemVersion::Android, 9, 0);
680
681
682
683
685 QOperatingSystemVersion(QOperatingSystemVersion::Android, 10, 0);
688
689
690
691
693 QOperatingSystemVersion(QOperatingSystemVersion::Android, 11, 0);
696
697
698
699
703
704
705
706
710
711
712
713
717
718
719
720
724#ifndef QT_NO_DEBUG_STREAM
727 QDebugStateSaver saver(debug);
729 debug <<
"QOperatingSystemVersion(" << ov.name()
constexpr int majorVersion() const
constexpr int minorVersion() const
constexpr int microVersion() const
static constexpr OSType currentType()
constexpr OSType type() const
static constexpr QOperatingSystemVersionBase Windows11_21H2
\variable QOperatingSystemVersion::Windows11_21H2
static constexpr QOperatingSystemVersionBase AndroidNougat
\variable QOperatingSystemVersion::AndroidNougat
static constexpr QOperatingSystemVersionBase Android10
\variable QOperatingSystemVersion::Android10
static constexpr QOperatingSystemVersionBase MacOSSierra
\variable QOperatingSystemVersion::MacOSSierra
static constexpr QOperatingSystemVersionBase OSXYosemite
\variable QOperatingSystemVersion::OSXYosemite
static constexpr QOperatingSystemVersionBase Android12L
\variable QOperatingSystemVersion::Android12L
static constexpr QOperatingSystemVersionBase Windows10_1909
\variable QOperatingSystemVersion::Windows10_1909
static constexpr QOperatingSystemVersionBase AndroidKitKat
\variable QOperatingSystemVersion::AndroidKitKat
static constexpr QOperatingSystemVersionBase AndroidJellyBean
\variable QOperatingSystemVersion::MacOSSonoma
static constexpr QOperatingSystemVersionBase AndroidOreo_MR1
\variable QOperatingSystemVersion::AndroidOreo_MR1
static constexpr QOperatingSystemVersionBase Android13
\variable QOperatingSystemVersion::Android13
static constexpr QOperatingSystemVersionBase MacOSCatalina
\variable QOperatingSystemVersion::MacOSCatalina
static constexpr QOperatingSystemVersionBase AndroidLollipop_MR1
\variable QOperatingSystemVersion::AndroidLollipop_MR1
static constexpr QOperatingSystemVersionBase Windows10
\variable QOperatingSystemVersion::Windows10
static constexpr QOperatingSystemVersionBase Windows10_1903
\variable QOperatingSystemVersion::Windows10_1903
static constexpr QOperatingSystemVersionBase Android12
\variable QOperatingSystemVersion::Android12
static constexpr QOperatingSystemVersionBase OSXElCapitan
\variable QOperatingSystemVersion::OSXElCapitan
static constexpr QOperatingSystemVersionBase MacOSMojave
\variable QOperatingSystemVersion::MacOSMojave
static constexpr QOperatingSystemVersionBase Windows8
\variable QOperatingSystemVersion::Windows8
static constexpr QOperatingSystemVersionBase AndroidNougat_MR1
\variable QOperatingSystemVersion::AndroidNougat_MR1
static constexpr QOperatingSystemVersionBase Windows10_2004
\variable QOperatingSystemVersion::Windows10_2004
static constexpr QOperatingSystemVersionBase MacOSHighSierra
\variable QOperatingSystemVersion::MacOSHighSierra
static constexpr QOperatingSystemVersionBase Windows10_21H2
\variable QOperatingSystemVersion::Windows10_21H2
static constexpr QOperatingSystemVersionBase AndroidMarshmallow
\variable QOperatingSystemVersion::AndroidMarshmallow
static constexpr QOperatingSystemVersionBase AndroidJellyBean_MR2
\variable QOperatingSystemVersion::AndroidJellyBean_MR2
static constexpr QOperatingSystemVersionBase Windows10_20H2
\variable QOperatingSystemVersion::Windows10_20H2
static constexpr QOperatingSystemVersionBase AndroidPie
\variable QOperatingSystemVersion::AndroidPie
static constexpr QOperatingSystemVersionBase AndroidOreo
\variable QOperatingSystemVersion::AndroidOreo
static constexpr QOperatingSystemVersionBase OSXMavericks
\variable QOperatingSystemVersion::Windows11_23H2
static constexpr QOperatingSystemVersionBase MacOSMonterey
\variable QOperatingSystemVersion::MacOSMonterey
static constexpr QOperatingSystemVersionBase Windows7
\variable QOperatingSystemVersion::Windows7
static constexpr QOperatingSystemVersionBase MacOSVentura
\variable QOperatingSystemVersion::MacOSVentura
static constexpr QOperatingSystemVersionBase Windows10_1809
\variable QOperatingSystemVersion::Windows10_1809
static constexpr QOperatingSystemVersionBase AndroidJellyBean_MR1
\variable QOperatingSystemVersion::AndroidJellyBean_MR1
static constexpr QOperatingSystemVersionBase MacOSBigSur
\variable QOperatingSystemVersion::MacOSBigSur
static constexpr QOperatingSystemVersionBase AndroidLollipop
\variable QOperatingSystemVersion::AndroidLollipop
static constexpr QOperatingSystemVersionBase Windows8_1
\variable QOperatingSystemVersion::Windows8_1
static constexpr QOperatingSystemVersionBase Windows10_21H1
\variable QOperatingSystemVersion::Windows10_21H1
static constexpr QOperatingSystemVersionBase Windows11_22H2
\variable QOperatingSystemVersion::Windows11_22H2
static constexpr QOperatingSystemVersionBase Windows10_22H2
\variable QOperatingSystemVersion::Windows10_22H2
static constexpr QOperatingSystemVersionBase Android11
\variable QOperatingSystemVersion::Android11
static constexpr QOperatingSystemVersionBase Windows11
\variable QOperatingSystemVersion::Windows11
Combined button and popup list for selecting options.
static int compareVersionComponents(int lhs, int rhs) noexcept