8# include "qtimezoneprivate_p.h"
11#include <QtCore/qdatastream.h>
12#include <QtCore/qdatetime.h>
20static_assert(!std::is_constructible_v<QTimeZone, Qt::TimeSpec>);
21using namespace Qt::StringLiterals;
23#if QT_CONFIG(timezone)
25static QTimeZonePrivate *newBackendTimeZone()
27#if QT_CONFIG(timezone_tzdb)
28 return new QChronoTimeZonePrivate();
29#elif defined(Q_OS_DARWIN)
30 return new QMacTimeZonePrivate();
31#elif defined(Q_OS_ANDROID)
32 return new QAndroidTimeZonePrivate();
33#elif defined(Q_OS_UNIX) && !defined(Q_OS_VXWORKS) && !defined(Q_OS_WASM)
34 return new QTzTimeZonePrivate();
36 return new QIcuTimeZonePrivate();
37#elif defined(Q_OS_WIN)
38 return new QWinTimeZonePrivate();
40 return new QUtcTimeZonePrivate();
45static QTimeZonePrivate *newBackendTimeZone(
const QByteArray &ianaId)
47 Q_ASSERT(!ianaId.isEmpty());
48#if QT_CONFIG(timezone_tzdb)
49 return new QChronoTimeZonePrivate(ianaId);
50#elif defined(Q_OS_DARWIN)
51 return new QMacTimeZonePrivate(ianaId);
52#elif defined(Q_OS_ANDROID)
53 return new QAndroidTimeZonePrivate(ianaId);
54#elif defined(Q_OS_UNIX) && !defined(Q_OS_VXWORKS) && !defined(Q_OS_WASM)
55 return new QTzTimeZonePrivate(ianaId);
57 return new QIcuTimeZonePrivate(ianaId);
58#elif defined(Q_OS_WIN)
59 return new QWinTimeZonePrivate(ianaId);
61 return new QUtcTimeZonePrivate(ianaId);
65class QTimeZoneSingleton
68 QTimeZoneSingleton() : backend(newBackendTimeZone()) {}
75 QExplicitlySharedDataPointer<QTimeZonePrivate> backend;
79Q_GLOBAL_STATIC(QTimeZoneSingleton, global_tz);
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
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
278
279
280
281
282
283
284
285
286
287
288
289
290
292#if QT_CONFIG(timezone)
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
378
379
380
381
382
383
386QTimeZone::Data::Data()
noexcept : d(
nullptr)
389 static_assert(
int(Qt::TimeZone) == 3);
392QTimeZone::Data::Data(
const Data &other)
noexcept
394#if QT_CONFIG(timezone)
395 if (!other.isShort() && other.d)
401QTimeZone::Data::Data(QTimeZonePrivate *dptr)
noexcept
404#if QT_CONFIG(timezone)
410QTimeZone::Data::~Data()
412#if QT_CONFIG(timezone)
413 if (!isShort() && d && !d->ref.deref())
419QTimeZone::Data &QTimeZone::Data::operator=(
const Data &other)
noexcept
421#if QT_CONFIG(timezone)
422 if (!other.isShort())
423 return *
this = other.d;
424 if (!isShort() && d && !d->ref.deref())
432
433
435QTimeZone::QTimeZone()
noexcept
438 static_assert(
sizeof(ShortData) <=
sizeof(Data::d));
440 static_assert(qintptr(1) << (
sizeof(
void *) * 8 - 2) >= MaxUtcOffsetSecs);
443#if QT_CONFIG(timezone)
444QTimeZone::Data &QTimeZone::Data::operator=(QTimeZonePrivate *dptr)
noexcept
449 if (d && !d->ref.deref())
455 Q_ASSERT(!isShort());
460
461
462
463
464
465
466
467
468
469
470
472QTimeZone::QTimeZone(
const QByteArray &ianaId)
476 d =
new QUtcTimeZonePrivate(ianaId);
479 if (ianaId.isEmpty()) {
480 d = newBackendTimeZone();
482 d = newBackendTimeZone(ianaId);
485 QByteArrayView name = QTimeZonePrivate::aliasToIana(ianaId);
487 if (name.isEmpty() || name == ianaId)
488 name = global_tz->backend->availableAlias(ianaId);
489 if (!name.isEmpty() && name != ianaId)
490 d = newBackendTimeZone(name.toByteArray());
497 qint64 offset = QUtcTimeZonePrivate::offsetFromUtcString(ianaId);
498 if (offset != QTimeZonePrivate::invalidSeconds()) {
500 qint32 seconds = qint32(offset);
501 Q_ASSERT(qint64(seconds) == offset);
503 d =
new QUtcTimeZonePrivate(seconds);
509
510
511
512
513
514
515
516
517
518
519
520
522QTimeZone::QTimeZone(
int offsetSeconds)
523 : d((offsetSeconds >= MinUtcOffsetSecs && offsetSeconds <= MaxUtcOffsetSecs)
524 ?
new QUtcTimeZonePrivate(offsetSeconds) :
nullptr)
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
552QTimeZone::QTimeZone(
const QByteArray &zoneId,
int offsetSeconds,
const QString &name,
553 const QString &abbreviation, QLocale::Territory territory,
const QString &comment)
554 : d(QUtcTimeZonePrivate().isTimeZoneIdAvailable(zoneId)
555 || global_tz->backend->isTimeZoneIdAvailable(zoneId)
557 :
new QUtcTimeZonePrivate(zoneId, offsetSeconds, name, abbreviation, territory, comment))
562
563
564
565
566
567
569QTimeZone::QTimeZone(QTimeZonePrivate &dd)
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
597QTimeZone QTimeZone::asBackendZone()
const
599 switch (timeSpec()) {
603 return systemTimeZone();
606 case Qt::OffsetFromUTC:
607 return QTimeZone(*
new QUtcTimeZonePrivate(
int(d.s.offset)));
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
634
635
636
637
638
639
640
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
665
666
667
668
669
670
671
672
673
674
675
676
679
680
681
682
683
684
685
686
689
690
691
692
693
696
697
698
699
700
701
702
703
704
705
708
709
711QTimeZone::QTimeZone(
const QTimeZone &other)
noexcept
717
718
719
720
723
724
726QTimeZone::~QTimeZone()
731
732
733
736
737
739QTimeZone &QTimeZone::operator=(
const QTimeZone &other)
746
747
748
749
750
753
754
755
756
757
758
759
760
761
764
765
766
767
768
769
770
771
772
777 return rhs.d.isShort() && lhs.d.s == rhs.d.s;
779 if (!rhs.d.isShort()) {
780 if (lhs.d.d == rhs.d.d)
782#if QT_CONFIG(timezone)
783 return lhs.d.d && rhs.d.d && *lhs.d.d == *rhs.d.d;
791
792
794bool QTimeZone::isValid()
const
796#if QT_CONFIG(timezone)
798 return d.d && d->isValid();
803#if QT_CONFIG(timezone)
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
835QByteArray QTimeZone::id()
const
838 switch (d.s.spec()) {
840 return QTimeZonePrivate::utcQByteArray();
842 return systemTimeZoneId();
843 case Qt::OffsetFromUTC:
844 return QUtcTimeZonePrivate(d.s.offset).id();
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871bool QTimeZone::hasAlternativeName(QByteArrayView alias)
const
873 const QByteArray me = id();
876 QByteArrayView mine = QTimeZonePrivate::aliasToIana(me);
880 else if (alias == mine)
882 QByteArrayView its = QTimeZonePrivate::aliasToIana(alias);
885 return !its.isEmpty() && its == mine;
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903QLocale::Territory QTimeZone::territory()
const
906 if (d.s.spec() == Qt::LocalTime)
907 return systemTimeZone().territory();
908 }
else if (isValid()) {
909 return d->territory();
911 return QLocale::AnyTerritory;
914#if QT_DEPRECATED_SINCE(6
, 6
)
916
917
918
919
920
921
923QLocale::Country QTimeZone::country()
const
930
931
932
933
934
935
936
937
939QString QTimeZone::comment()
const
943 }
else if (isValid()) {
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
972QString QTimeZone::displayName(
const QDateTime &atDateTime, NameType nameType,
973 const QLocale &locale)
const
976 switch (d.s.spec()) {
978 return systemTimeZone().displayName(atDateTime, nameType, locale);
980 case Qt::OffsetFromUTC:
981 return QUtcTimeZonePrivate(d.s.offset).displayName(
982 atDateTime.toMSecsSinceEpoch(), nameType, locale);
987 }
else if (isValid()) {
988 return d->displayName(atDateTime.toMSecsSinceEpoch(), nameType, locale);
995
996
997
998
999
1000
1001
1002
1003
1004
1006QString QTimeZone::displayName(TimeType timeType, NameType nameType,
1007 const QLocale &locale)
const
1010 switch (d.s.spec()) {
1012 return systemTimeZone().displayName(timeType, nameType, locale);
1014 case Qt::OffsetFromUTC:
1015 return QUtcTimeZonePrivate(d.s.offset).displayName(timeType, nameType, locale);
1020 }
else if (isValid()) {
1021 return d->displayName(timeType, nameType, locale);
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1042QString QTimeZone::abbreviation(
const QDateTime &atDateTime)
const
1045 switch (d.s.spec()) {
1047 return systemTimeZone().abbreviation(atDateTime);
1049 case Qt::OffsetFromUTC:
1050 return QUtcTimeZonePrivate(d.s.offset).abbreviation(atDateTime.toMSecsSinceEpoch());
1055 }
else if (isValid()) {
1056 return d->abbreviation(atDateTime.toMSecsSinceEpoch());
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1078int QTimeZone::offsetFromUtc(
const QDateTime &atDateTime)
const
1081 switch (d.s.spec()) {
1083 return systemTimeZone().offsetFromUtc(atDateTime);
1085 case Qt::OffsetFromUTC:
1091 }
else if (isValid()) {
1092 const int offset = d->offsetFromUtc(atDateTime.toMSecsSinceEpoch());
1093 if (offset != QTimeZonePrivate::invalidSeconds())
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1113int QTimeZone::standardTimeOffset(
const QDateTime &atDateTime)
const
1116 switch (d.s.spec()) {
1118 return systemTimeZone().standardTimeOffset(atDateTime);
1120 case Qt::OffsetFromUTC:
1126 }
else if (isValid()) {
1127 const int offset = d->standardTimeOffset(atDateTime.toMSecsSinceEpoch());
1128 if (offset != QTimeZonePrivate::invalidSeconds())
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1148int QTimeZone::daylightTimeOffset(
const QDateTime &atDateTime)
const
1151 switch (d.s.spec()) {
1153 return systemTimeZone().daylightTimeOffset(atDateTime);
1155 case Qt::OffsetFromUTC:
1161 }
else if (hasDaylightTime()) {
1162 const int offset = d->daylightTimeOffset(atDateTime.toMSecsSinceEpoch());
1163 if (offset != QTimeZonePrivate::invalidSeconds())
1170
1171
1172
1173
1174
1175
1177bool QTimeZone::hasDaylightTime()
const
1180 switch (d.s.spec()) {
1182 return systemTimeZone().hasDaylightTime();
1184 case Qt::OffsetFromUTC:
1190 }
else if (isValid()) {
1191 return d->hasDaylightTime();
1197
1198
1199
1200
1201
1202
1204bool QTimeZone::isDaylightTime(
const QDateTime &atDateTime)
const
1207 switch (d.s.spec()) {
1209 return systemTimeZone().isDaylightTime(atDateTime);
1211 case Qt::OffsetFromUTC:
1217 }
else if (hasDaylightTime()) {
1218 return d->isDaylightTime(atDateTime.toMSecsSinceEpoch());
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1237QTimeZone::OffsetData QTimeZone::offsetData(
const QDateTime &forDateTime)
const
1240 switch (d.s.spec()) {
1242 return systemTimeZone().offsetData(forDateTime);
1244 case Qt::OffsetFromUTC:
1245 return { abbreviation(forDateTime), forDateTime,
int(d.s.offset),
int(d.s.offset), 0 };
1252 return QTimeZonePrivate::toOffsetData(d->data(forDateTime.toMSecsSinceEpoch()));
1254 return QTimeZonePrivate::invalidOffsetData();
1258
1259
1260
1261
1262
1263
1264
1265
1266
1268bool QTimeZone::hasTransitions()
const
1271 switch (d.s.spec()) {
1273 return systemTimeZone().hasTransitions();
1275 case Qt::OffsetFromUTC:
1281 }
else if (isValid()) {
1282 return d->hasTransitions();
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1302QTimeZone::OffsetData QTimeZone::nextTransition(
const QDateTime &afterDateTime)
const
1305 switch (d.s.spec()) {
1307 return systemTimeZone().nextTransition(afterDateTime);
1309 case Qt::OffsetFromUTC:
1315 }
else if (hasTransitions()) {
1316 return QTimeZonePrivate::toOffsetData(d->nextTransition(afterDateTime.toMSecsSinceEpoch()));
1319 return QTimeZonePrivate::invalidOffsetData();
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1337QTimeZone::OffsetData QTimeZone::previousTransition(
const QDateTime &beforeDateTime)
const
1340 switch (d.s.spec()) {
1342 return systemTimeZone().previousTransition(beforeDateTime);
1344 case Qt::OffsetFromUTC:
1350 }
else if (hasTransitions()) {
1351 return QTimeZonePrivate::toOffsetData(
1352 d->previousTransition(beforeDateTime.toMSecsSinceEpoch()));
1355 return QTimeZonePrivate::invalidOffsetData();
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1370QTimeZone::OffsetDataList QTimeZone::transitions(
const QDateTime &fromDateTime,
1371 const QDateTime &toDateTime)
const
1373 OffsetDataList list;
1375 switch (d.s.spec()) {
1377 return systemTimeZone().transitions(fromDateTime, toDateTime);
1379 case Qt::OffsetFromUTC:
1385 }
else if (hasTransitions()) {
1386 const QTimeZonePrivate::DataList plist = d->transitions(fromDateTime.toMSecsSinceEpoch(),
1387 toDateTime.toMSecsSinceEpoch());
1388 list.reserve(plist.size());
1389 for (
const QTimeZonePrivate::Data &pdata : plist)
1390 list.append(QTimeZonePrivate::toOffsetData(pdata));
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1422QByteArray QTimeZone::systemTimeZoneId()
1424 QByteArray sys = global_tz->backend->systemTimeZoneId();
1428 return global_tz->backend->id();
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449QTimeZone QTimeZone::systemTimeZone()
1452 const QByteArray sysId = global_tz->backend->systemTimeZoneId();
1453 const auto sys = sysId.isEmpty() ? QTimeZone(global_tz->backend) : QTimeZone(sysId);
1454 if (!sys.isValid()) {
1455 static bool neverWarned =
true;
1458 neverWarned =
false;
1459 qWarning(
"Unable to determine system time zone: "
1460 "please check your system configuration.");
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478QTimeZone QTimeZonePrivate::utcQTimeZone()
1480 return QTimeZone(*
new QUtcTimeZonePrivate());
1483Q_GLOBAL_STATIC(QTimeZone, utcTimeZone, QTimeZonePrivate::utcQTimeZone());
1485QTimeZone QTimeZone::utc()
1487 if (Q_UNLIKELY(utcTimeZone.isDestroyed()))
1488 return QTimeZonePrivate::utcQTimeZone();
1489 return *utcTimeZone;
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1504bool QTimeZone::isTimeZoneIdAvailable(QByteArrayView ianaId)
1506#if defined(Q_OS_UNIX) && !(QT_CONFIG(timezone_tzdb) || defined(Q_OS_DARWIN)
1507 || defined(Q_OS_ANDROID) || defined(Q_OS_VXWORKS))
1514 if (!QTimeZonePrivate::isValidId(ianaId))
1517 if (QUtcTimeZonePrivate().isTimeZoneIdAvailable(ianaId)
1518 || QUtcTimeZonePrivate::offsetFromUtcString(ianaId) != QTimeZonePrivate::invalidSeconds()
1519 || global_tz->backend->isTimeZoneIdAvailable(ianaId)) {
1522 if (
const auto name = QTimeZonePrivate::aliasToIana(ianaId); !name.isEmpty()) {
1523 return QUtcTimeZonePrivate().isTimeZoneIdAvailable(name)
1524 || global_tz->backend->isTimeZoneIdAvailable(name);
1527 QByteArrayView known = global_tz->backend->availableAlias(ianaId);
1528 return !known.isEmpty();
1531[[maybe_unused]]
static bool isUniqueSorted(
const QList<QByteArray> &seq)
1536 return std::is_sorted(seq.begin(), seq.end(), std::less_equal<QByteArray>());
1539static QList<QByteArray> set_union(
const QList<QByteArray> &l1,
const QList<QByteArray> &l2)
1541 Q_ASSERT(isUniqueSorted(l1));
1542 Q_ASSERT(isUniqueSorted(l2));
1543 QList<QByteArray> result;
1544 result.reserve(l1.size() + l2.size());
1545 std::set_union(l1.begin(), l1.end(),
1546 l2.begin(), l2.end(),
1547 std::back_inserter(result));
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1576QList<QByteArray> QTimeZone::availableTimeZoneIds()
1580 return set_union(QUtcTimeZonePrivate().availableTimeZoneIds(),
1581 global_tz->backend->availableTimeZoneIds());
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1598QList<QByteArray> QTimeZone::availableTimeZoneIds(QLocale::Territory territory)
1600 return set_union(QUtcTimeZonePrivate().availableTimeZoneIds(territory),
1601 global_tz->backend->availableTimeZoneIds(territory));
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1617QList<QByteArray> QTimeZone::availableTimeZoneIds(
int offsetSeconds)
1619 return set_union(QUtcTimeZonePrivate().availableTimeZoneIds(offsetSeconds),
1620 global_tz->backend->availableTimeZoneIds(offsetSeconds));
1624
1625
1626
1627
1628
1629
1631QByteArray QTimeZone::ianaIdToWindowsId(
const QByteArray &ianaId)
1633 return QTimeZonePrivate::ianaIdToWindowsId(ianaId).toByteArray();
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1649QByteArray QTimeZone::windowsIdToDefaultIanaId(
const QByteArray &windowsId)
1651 return QTimeZonePrivate::windowsIdToDefaultIanaId(windowsId).toByteArray();
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1674QByteArray QTimeZone::windowsIdToDefaultIanaId(
const QByteArray &windowsId,
1675 QLocale::Territory territory)
1677 return QTimeZonePrivate::windowsIdToDefaultIanaId(windowsId, territory).toByteArray();
1681
1682
1683
1684
1685
1686
1687
1688
1690QList<QByteArray> QTimeZone::windowsIdToIanaIds(
const QByteArray &windowsId)
1692 return QTimeZonePrivate::windowsIdToIanaIds(windowsId);
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1711QList<QByteArray> QTimeZone::windowsIdToIanaIds(
const QByteArray &windowsId,
1712 QLocale::Territory territory)
1714 return QTimeZonePrivate::windowsIdToIanaIds(windowsId, territory);
1718
1719
1720
1721
1722
1723
1724
1725
1726
1729template <
typename Stream,
typename Wrap>
1730void QTimeZone::Data::serialize(Stream &out,
const Wrap &wrap)
const
1735 out << wrap(
"QTimeZone::UTC");
1738 out << wrap(
"QTimeZone::LocalTime");
1740 case Qt::OffsetFromUTC:
1741 out << wrap(
"AheadOfUtcBy") <<
int(s.offset);
1749#if QT_CONFIG(timezone)
1750 if constexpr (std::is_same<Stream, QDataStream>::value) {
1755 out << QString::fromUtf8(d ? QByteArrayView(d->id()) : QByteArrayView());
1760#ifndef QT_NO_DATASTREAM
1766 const auto toQString = [](
const char *text) {
1767 return QString(QLatin1StringView(text));
1770 tz.d.serialize(ds, toQString);
1781 if (ianaId == invalidId()) {
1783 }
else if (ianaId ==
"OffsetFromUtc"_L1) {
1786 QString abbreviation;
1789 ds >> ianaId >> utcOffset >> name >> abbreviation >> territory >> comment;
1790#if QT_CONFIG(timezone)
1794 tz = QTimeZone(ianaId.toUtf8());
1795 if (!tz.isValid() || tz.hasDaylightTime()
1796 || tz.offsetFromUtc(QDateTime::fromMSecsSinceEpoch(0, QTimeZone::UTC)) != utcOffset) {
1798 tz = QTimeZone(ianaId.toUtf8(), utcOffset, name, abbreviation,
1799 QLocale::Territory(territory), comment);
1802 tz = QTimeZone::fromSecondsAheadOfUtc(utcOffset);
1804 }
else if (ianaId ==
"AheadOfUtcBy"_L1) {
1807 tz = QTimeZone::fromSecondsAheadOfUtc(utcOffset);
1808 }
else if (ianaId ==
"QTimeZone::UTC"_L1) {
1809 tz = QTimeZone(QTimeZone::UTC);
1810 }
else if (ianaId ==
"QTimeZone::LocalTime"_L1) {
1811 tz = QTimeZone(QTimeZone::LocalTime);
1812#if QT_CONFIG(timezone)
1814 tz = QTimeZone(ianaId.toUtf8());
1821#ifndef QT_NO_DEBUG_STREAM
1824 QDebugStateSaver saver(dbg);
1825 const auto asIs = [](
const char *text) {
return text; };
1827 dbg.nospace() <<
"QTimeZone(";
1828 tz.d.serialize(dbg, asIs);
1829 dbg.nospace() <<
')';
QDebug operator<<(QDebug dbg, const QFileInfo &fi)
bool comparesEqual(const QFileInfo &lhs, const QFileInfo &rhs)
static QString invalidId()
QDataStream & operator<<(QDataStream &stream, const QImage &image)
[0]
QDataStream & operator>>(QDataStream &stream, QImage &image)