8# include "qtimezoneprivate_p.h"
11#include <QtCore/qdatastream.h>
12#include <QtCore/qdatetime.h>
21static_assert(!std::is_constructible_v<QTimeZone, Qt::TimeSpec>);
22using namespace Qt::StringLiterals;
24#if QT_CONFIG(timezone)
26static QTimeZonePrivate *newBackendTimeZone()
28#if QT_CONFIG(timezone_tzdb)
29 return new QChronoTimeZonePrivate();
30#elif defined(Q_OS_DARWIN)
31 return new QMacTimeZonePrivate();
32#elif defined(Q_OS_ANDROID)
33 return new QAndroidTimeZonePrivate();
34#elif defined(Q_OS_UNIX) && !defined(Q_OS_VXWORKS) && !defined(Q_OS_WASM) && !defined(Q_OS_HARMONY)
35 return new QTzTimeZonePrivate();
37 return new QIcuTimeZonePrivate();
38#elif defined(Q_OS_WIN)
39 return new QWinTimeZonePrivate();
41 return new QUtcTimeZonePrivate();
46static QTimeZonePrivate *newBackendTimeZone(
const QByteArray &ianaId)
48 Q_ASSERT(!ianaId.isEmpty());
49#if QT_CONFIG(timezone_tzdb)
50 return new QChronoTimeZonePrivate(ianaId);
51#elif defined(Q_OS_DARWIN)
52 return new QMacTimeZonePrivate(ianaId);
53#elif defined(Q_OS_ANDROID)
54 return new QAndroidTimeZonePrivate(ianaId);
55#elif defined(Q_OS_UNIX) && !defined(Q_OS_VXWORKS) && !defined(Q_OS_WASM) && !defined(Q_OS_HARMONY)
56 return new QTzTimeZonePrivate(ianaId);
58 return new QIcuTimeZonePrivate(ianaId);
59#elif defined(Q_OS_WIN)
60 return new QWinTimeZonePrivate(ianaId);
62 return new QUtcTimeZonePrivate(ianaId);
66class QTimeZoneSingleton
69 QTimeZoneSingleton() : backend(newBackendTimeZone()) {}
76 QExplicitlySharedDataPointer<QTimeZonePrivate> backend;
80Q_GLOBAL_STATIC(QTimeZoneSingleton, global_tz);
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
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
279
280
281
282
283
284
285
286
287
288
289
290
291
293#if QT_CONFIG(timezone)
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
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
376
379
380
381
382
383
384
387QTimeZone::Data::Data()
noexcept : d(
nullptr)
390 static_assert(
int(Qt::TimeZone) == 3);
393QTimeZone::Data::Data(
const Data &other)
noexcept
395#if QT_CONFIG(timezone)
396 if (!other.isShort() && other.d)
402QTimeZone::Data::Data(QTimeZonePrivate *dptr)
noexcept
405#if QT_CONFIG(timezone)
411QTimeZone::Data::~Data()
413#if QT_CONFIG(timezone)
414 if (!isShort() && d && !d->ref.deref())
420QTimeZone::Data &QTimeZone::Data::operator=(
const Data &other)
noexcept
422#if QT_CONFIG(timezone)
423 if (!other.isShort())
424 return *
this = other.d;
425 if (!isShort() && d && !d->ref.deref())
433
434
436QTimeZone::QTimeZone()
noexcept
439 static_assert(
sizeof(ShortData) <=
sizeof(Data::d));
441 static_assert(qintptr(1) << (
sizeof(
void *) * 8 - 2) >= MaxUtcOffsetSecs);
444#if QT_CONFIG(timezone)
445QTimeZone::Data &QTimeZone::Data::operator=(QTimeZonePrivate *dptr)
noexcept
450 if (d && !d->ref.deref())
456 Q_ASSERT(!isShort());
461
462
463
464
465
466
467
468
469
470
471
473QTimeZone::QTimeZone(
const QByteArray &ianaId)
477 d =
new QUtcTimeZonePrivate(ianaId);
480 if (ianaId.isEmpty()) {
481 d = newBackendTimeZone();
483 d = newBackendTimeZone(ianaId);
486 QByteArrayView name = QTimeZonePrivate::aliasToIana(ianaId);
488 if (name.isEmpty() || name == ianaId)
489 name = global_tz->backend->availableAlias(ianaId);
490 if (!name.isEmpty() && name != ianaId)
491 d = newBackendTimeZone(name.toByteArray());
498 qint64 offset = QUtcTimeZonePrivate::offsetFromUtcString(ianaId);
499 if (offset != QTimeZonePrivate::invalidSeconds()) {
501 qint32 seconds = qint32(offset);
502 Q_ASSERT(qint64(seconds) == offset);
504 d =
new QUtcTimeZonePrivate(seconds);
510
511
512
513
514
515
516
517
518
519
520
521
523QTimeZone::QTimeZone(
int offsetSeconds)
524 : d((offsetSeconds >= MinUtcOffsetSecs && offsetSeconds <= MaxUtcOffsetSecs)
525 ?
new QUtcTimeZonePrivate(offsetSeconds) :
nullptr)
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
553QTimeZone::QTimeZone(
const QByteArray &zoneId,
int offsetSeconds,
const QString &name,
554 const QString &abbreviation, QLocale::Territory territory,
const QString &comment)
555 : d(QUtcTimeZonePrivate().isTimeZoneIdAvailable(zoneId)
556 || global_tz->backend->isTimeZoneIdAvailable(zoneId)
558 :
new QUtcTimeZonePrivate(zoneId, offsetSeconds, name, abbreviation, territory, comment))
563
564
565
566
567
568
570QTimeZone::QTimeZone(QTimeZonePrivate &dd)
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
598QTimeZone QTimeZone::asBackendZone()
const
600 switch (timeSpec()) {
604 return systemTimeZone();
607 case Qt::OffsetFromUTC:
608 return QTimeZone(*
new QUtcTimeZonePrivate(
int(d.s.offset)));
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
635
636
637
638
639
640
641
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
666
667
668
669
670
671
672
673
674
675
676
677
680
681
682
683
684
685
686
687
690
691
692
693
694
697
698
699
700
701
702
703
704
705
706
709
710
712QTimeZone::QTimeZone(
const QTimeZone &other)
noexcept
718
719
720
721
724
725
727QTimeZone::~QTimeZone()
732
733
734
737
738
740QTimeZone &QTimeZone::operator=(
const QTimeZone &other)
747
748
749
750
751
754
755
756
757
758
759
760
761
762
765
766
767
768
769
770
771
772
773
778 return rhs.d.isShort() && lhs.d.s == rhs.d.s;
780 if (!rhs.d.isShort()) {
781 if (lhs.d.d == rhs.d.d)
783#if QT_CONFIG(timezone)
784 return lhs.d.d && rhs.d.d && *lhs.d.d == *rhs.d.d;
792
793
795bool QTimeZone::isValid()
const
797#if QT_CONFIG(timezone)
799 return d.d && d->isValid();
804#if QT_CONFIG(timezone)
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
834
836QByteArray QTimeZone::id()
const
839 switch (d.s.spec()) {
841 return QTimeZonePrivate::utcQByteArray();
843 return systemTimeZoneId();
844 case Qt::OffsetFromUTC:
845 return QUtcTimeZonePrivate(d.s.offset).id();
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872bool QTimeZone::hasAlternativeName(QByteArrayView alias)
const
874 const QByteArray me = id();
877 QByteArrayView mine = QTimeZonePrivate::aliasToIana(me);
881 else if (alias == mine)
883 QByteArrayView its = QTimeZonePrivate::aliasToIana(alias);
886 return !its.isEmpty() && its == mine;
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904QLocale::Territory QTimeZone::territory()
const
907 if (d.s.spec() == Qt::LocalTime)
908 return systemTimeZone().territory();
909 }
else if (isValid()) {
910 return d->territory();
912 return QLocale::AnyTerritory;
915#if QT_DEPRECATED_SINCE(6
, 6
)
917
918
919
920
921
922
924QLocale::Country QTimeZone::country()
const
931
932
933
934
935
936
937
938
940QString QTimeZone::comment()
const
944 }
else if (isValid()) {
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
973QString QTimeZone::displayName(
const QDateTime &atDateTime, NameType nameType,
974 const QLocale &locale)
const
977 switch (d.s.spec()) {
979 return systemTimeZone().displayName(atDateTime, nameType, locale);
981 case Qt::OffsetFromUTC:
982 return QUtcTimeZonePrivate(d.s.offset).displayName(
983 atDateTime.toMSecsSinceEpoch(), nameType, locale);
988 }
else if (isValid()) {
989 return d->displayName(atDateTime.toMSecsSinceEpoch(), nameType, locale);
996
997
998
999
1000
1001
1002
1003
1004
1005
1007QString QTimeZone::displayName(TimeType timeType, NameType nameType,
1008 const QLocale &locale)
const
1011 switch (d.s.spec()) {
1013 return systemTimeZone().displayName(timeType, nameType, locale);
1015 case Qt::OffsetFromUTC:
1016 return QUtcTimeZonePrivate(d.s.offset).displayName(timeType, nameType, locale);
1021 }
else if (isValid()) {
1022 return d->displayName(timeType, nameType, locale);
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1043QString QTimeZone::abbreviation(
const QDateTime &atDateTime)
const
1046 switch (d.s.spec()) {
1048 return systemTimeZone().abbreviation(atDateTime);
1050 case Qt::OffsetFromUTC:
1051 return QUtcTimeZonePrivate(d.s.offset).abbreviation(atDateTime.toMSecsSinceEpoch());
1056 }
else if (isValid()) {
1057 return d->abbreviation(atDateTime.toMSecsSinceEpoch());
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1079int QTimeZone::offsetFromUtc(
const QDateTime &atDateTime)
const
1082 switch (d.s.spec()) {
1084 return systemTimeZone().offsetFromUtc(atDateTime);
1086 case Qt::OffsetFromUTC:
1092 }
else if (isValid()) {
1093 const int offset = d->offsetFromUtc(atDateTime.toMSecsSinceEpoch());
1094 if (offset != QTimeZonePrivate::invalidSeconds())
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1114int QTimeZone::standardTimeOffset(
const QDateTime &atDateTime)
const
1117 switch (d.s.spec()) {
1119 return systemTimeZone().standardTimeOffset(atDateTime);
1121 case Qt::OffsetFromUTC:
1127 }
else if (isValid()) {
1128 const int offset = d->standardTimeOffset(atDateTime.toMSecsSinceEpoch());
1129 if (offset != QTimeZonePrivate::invalidSeconds())
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1149int QTimeZone::daylightTimeOffset(
const QDateTime &atDateTime)
const
1152 switch (d.s.spec()) {
1154 return systemTimeZone().daylightTimeOffset(atDateTime);
1156 case Qt::OffsetFromUTC:
1162 }
else if (hasDaylightTime()) {
1163 const int offset = d->daylightTimeOffset(atDateTime.toMSecsSinceEpoch());
1164 if (offset != QTimeZonePrivate::invalidSeconds())
1171
1172
1173
1174
1175
1176
1178bool QTimeZone::hasDaylightTime()
const
1181 switch (d.s.spec()) {
1183 return systemTimeZone().hasDaylightTime();
1185 case Qt::OffsetFromUTC:
1191 }
else if (isValid()) {
1192 return d->hasDaylightTime();
1198
1199
1200
1201
1202
1203
1205bool QTimeZone::isDaylightTime(
const QDateTime &atDateTime)
const
1208 switch (d.s.spec()) {
1210 return systemTimeZone().isDaylightTime(atDateTime);
1212 case Qt::OffsetFromUTC:
1218 }
else if (hasDaylightTime()) {
1219 return d->isDaylightTime(atDateTime.toMSecsSinceEpoch());
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1238QTimeZone::OffsetData QTimeZone::offsetData(
const QDateTime &forDateTime)
const
1241 switch (d.s.spec()) {
1243 return systemTimeZone().offsetData(forDateTime);
1245 case Qt::OffsetFromUTC:
1246 return { abbreviation(forDateTime), forDateTime,
int(d.s.offset),
int(d.s.offset), 0 };
1253 return QTimeZonePrivate::toOffsetData(d->data(forDateTime.toMSecsSinceEpoch()));
1255 return QTimeZonePrivate::invalidOffsetData();
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1274bool QTimeZone::hasTransitions()
const
1277 switch (d.s.spec()) {
1279 return systemTimeZone().hasTransitions();
1281 case Qt::OffsetFromUTC:
1287 }
else if (isValid()) {
1288 return d->hasTransitions();
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1308QTimeZone::OffsetData QTimeZone::nextTransition(
const QDateTime &afterDateTime)
const
1311 switch (d.s.spec()) {
1313 return systemTimeZone().nextTransition(afterDateTime);
1315 case Qt::OffsetFromUTC:
1321 }
else if (isValid() && hasTransitions()) {
1322 return QTimeZonePrivate::toOffsetData(d->nextTransition(afterDateTime.toMSecsSinceEpoch()));
1325 return QTimeZonePrivate::invalidOffsetData();
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1343QTimeZone::OffsetData QTimeZone::previousTransition(
const QDateTime &beforeDateTime)
const
1346 switch (d.s.spec()) {
1348 return systemTimeZone().previousTransition(beforeDateTime);
1350 case Qt::OffsetFromUTC:
1356 }
else if (isValid() && hasTransitions()) {
1357 return QTimeZonePrivate::toOffsetData(
1358 d->previousTransition(beforeDateTime.toMSecsSinceEpoch()));
1361 return QTimeZonePrivate::invalidOffsetData();
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1376QTimeZone::OffsetDataList QTimeZone::transitions(
const QDateTime &fromDateTime,
1377 const QDateTime &toDateTime)
const
1379 OffsetDataList list;
1381 switch (d.s.spec()) {
1383 return systemTimeZone().transitions(fromDateTime, toDateTime);
1385 case Qt::OffsetFromUTC:
1391 }
else if (isValid() && hasTransitions()) {
1392 const QTimeZonePrivate::DataList plist = d->transitions(fromDateTime.toMSecsSinceEpoch(),
1393 toDateTime.toMSecsSinceEpoch());
1394 list.reserve(plist.size());
1395 for (
const QTimeZonePrivate::Data &pdata : plist)
1396 list.append(QTimeZonePrivate::toOffsetData(pdata));
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1428QByteArray QTimeZone::systemTimeZoneId()
1430 QByteArray sys = global_tz->backend->systemTimeZoneId();
1434 return global_tz->backend->id();
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455QTimeZone QTimeZone::systemTimeZone()
1458 const QByteArray sysId = global_tz->backend->systemTimeZoneId();
1459 const auto sys = sysId.isEmpty() ? QTimeZone(global_tz->backend) : QTimeZone(sysId);
1460 if (!sys.isValid()) {
1461 static bool neverWarned =
true;
1464 neverWarned =
false;
1465 qWarning(
"Unable to determine system time zone: "
1466 "please check your system configuration.");
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484QTimeZone QTimeZonePrivate::utcQTimeZone()
1486 return QTimeZone(*
new QUtcTimeZonePrivate());
1489Q_GLOBAL_STATIC(QTimeZone, utcTimeZone, QTimeZonePrivate::utcQTimeZone());
1491QTimeZone QTimeZone::utc()
1493 if (Q_UNLIKELY(utcTimeZone.isDestroyed()))
1494 return QTimeZonePrivate::utcQTimeZone();
1495 return *utcTimeZone;
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1510bool QTimeZone::isTimeZoneIdAvailable(QByteArrayView ianaId)
1512#if defined(Q_OS_UNIX) && !(QT_CONFIG(timezone_tzdb) || defined(Q_OS_DARWIN)
1513 || defined(Q_OS_ANDROID) || defined(Q_OS_VXWORKS))
1520 if (!QTimeZonePrivate::isValidId(ianaId))
1523 if (QUtcTimeZonePrivate().isTimeZoneIdAvailable(ianaId)
1524 || QUtcTimeZonePrivate::offsetFromUtcString(ianaId) != QTimeZonePrivate::invalidSeconds()
1525 || global_tz->backend->isTimeZoneIdAvailable(ianaId)) {
1528 if (
const auto name = QTimeZonePrivate::aliasToIana(ianaId); !name.isEmpty()) {
1529 return QUtcTimeZonePrivate().isTimeZoneIdAvailable(name)
1530 || global_tz->backend->isTimeZoneIdAvailable(name);
1533 QByteArrayView known = global_tz->backend->availableAlias(ianaId);
1534 return !known.isEmpty();
1537[[maybe_unused]]
static bool isUniqueSorted(
const QList<QByteArray> &seq)
1540 return std::adjacent_find(seq.cbegin(), seq.cend(),
1541 std::greater_equal<QByteArray>()) == seq.cend();
1544static QList<QByteArray> set_union(
const QList<QByteArray> &l1,
const QList<QByteArray> &l2)
1546 Q_ASSERT(isUniqueSorted(l1));
1547 Q_ASSERT(isUniqueSorted(l2));
1548 QList<QByteArray> result;
1549 result.reserve(l1.size() + l2.size());
1550 std::set_union(l1.begin(), l1.end(),
1551 l2.begin(), l2.end(),
1552 std::back_inserter(result));
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1581QList<QByteArray> QTimeZone::availableTimeZoneIds()
1585 return set_union(QUtcTimeZonePrivate().availableTimeZoneIds(),
1586 global_tz->backend->availableTimeZoneIds());
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1603QList<QByteArray> QTimeZone::availableTimeZoneIds(QLocale::Territory territory)
1605 return set_union(QUtcTimeZonePrivate().availableTimeZoneIds(territory),
1606 global_tz->backend->availableTimeZoneIds(territory));
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1622QList<QByteArray> QTimeZone::availableTimeZoneIds(
int offsetSeconds)
1624 return set_union(QUtcTimeZonePrivate().availableTimeZoneIds(offsetSeconds),
1625 global_tz->backend->availableTimeZoneIds(offsetSeconds));
1629
1630
1631
1632
1633
1634
1636QByteArray QTimeZone::ianaIdToWindowsId(
const QByteArray &ianaId)
1638 return QTimeZonePrivate::ianaIdToWindowsId(ianaId).toByteArray();
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1654QByteArray QTimeZone::windowsIdToDefaultIanaId(
const QByteArray &windowsId)
1656 return QTimeZonePrivate::windowsIdToDefaultIanaId(windowsId).toByteArray();
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1679QByteArray QTimeZone::windowsIdToDefaultIanaId(
const QByteArray &windowsId,
1680 QLocale::Territory territory)
1682 return QTimeZonePrivate::windowsIdToDefaultIanaId(windowsId, territory).toByteArray();
1686
1687
1688
1689
1690
1691
1692
1693
1695QList<QByteArray> QTimeZone::windowsIdToIanaIds(
const QByteArray &windowsId)
1697 return QTimeZonePrivate::windowsIdToIanaIds(windowsId);
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1716QList<QByteArray> QTimeZone::windowsIdToIanaIds(
const QByteArray &windowsId,
1717 QLocale::Territory territory)
1719 return QTimeZonePrivate::windowsIdToIanaIds(windowsId, territory);
1723
1724
1725
1726
1727
1728
1729
1730
1731
1734template <
typename Stream,
typename Wrap>
1735void QTimeZone::Data::serialize(Stream &out,
const Wrap &wrap)
const
1740 out << wrap(
"QTimeZone::UTC");
1743 out << wrap(
"QTimeZone::LocalTime");
1745 case Qt::OffsetFromUTC:
1746 out << wrap(
"AheadOfUtcBy") <<
int(s.offset);
1754#if QT_CONFIG(timezone)
1755 if constexpr (std::is_same<Stream, QDataStream>::value) {
1760 out << QString::fromUtf8(d ? QByteArrayView(d->id()) : QByteArrayView());
1765#ifndef QT_NO_DATASTREAM
1771 const auto toQString = [](
const char *text) {
1772 return QString(QLatin1StringView(text));
1775 tz.d.serialize(ds, toQString);
1786 if (ianaId == invalidId()) {
1788 }
else if (ianaId ==
"OffsetFromUtc"_L1) {
1791 QString abbreviation;
1794 ds >> ianaId >> utcOffset >> name >> abbreviation >> territory >> comment;
1795#if QT_CONFIG(timezone)
1799 tz = QTimeZone(ianaId.toUtf8());
1800 if (!tz.isValid() || tz.hasDaylightTime()
1801 || tz.offsetFromUtc(QDateTime::fromMSecsSinceEpoch(0, QTimeZone::UTC)) != utcOffset) {
1803 tz = QTimeZone(ianaId.toUtf8(), utcOffset, name, abbreviation,
1804 QLocale::Territory(territory), comment);
1807 tz = QTimeZone::fromSecondsAheadOfUtc(utcOffset);
1809 }
else if (ianaId ==
"AheadOfUtcBy"_L1) {
1812 tz = QTimeZone::fromSecondsAheadOfUtc(utcOffset);
1813 }
else if (ianaId ==
"QTimeZone::UTC"_L1) {
1814 tz = QTimeZone(QTimeZone::UTC);
1815 }
else if (ianaId ==
"QTimeZone::LocalTime"_L1) {
1816 tz = QTimeZone(QTimeZone::LocalTime);
1817#if QT_CONFIG(timezone)
1819 tz = QTimeZone(ianaId.toUtf8());
1826#ifndef QT_NO_DEBUG_STREAM
1829 QDebugStateSaver saver(dbg);
1830 const auto asIs = [](
const char *text) {
return text; };
1832 dbg.nospace() <<
"QTimeZone(";
1833 tz.d.serialize(dbg, asIs);
1834 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)