summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/itemviews/qitemdelegate
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2022-08-30 16:07:50 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2022-12-10 06:39:44 +0100
commit2f440169c07e9501bad6f668c66961d49532eacc (patch)
tree49cadd223a19487e08391572c046638287235b0b /tests/auto/widgets/itemviews/qitemdelegate
parent8c8d6ff7b6e2e6b1b673051685f1499ae4d65e05 (diff)
Adapt to QTimeZone replacing Qt::TimeSpec usage
In the process actually handle all time-spec cases in various places that only handled UTC or LocalTime, or at least note that they don't where that's not practical. Also tidy up header ordering and ensure QDateTime's header is included wherever it's used, while adding the include for QTimeZone where needed. Task-number: QTBUG-108199 Change-Id: Ic1a5cdf0aaf737bf1396aa8ac58ce2004cef7e19 Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'tests/auto/widgets/itemviews/qitemdelegate')
-rw-r--r--tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp b/tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp
index 11f0f7440f..c900aa2a39 100644
--- a/tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp
+++ b/tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp
@@ -5,6 +5,7 @@
#include <QTest>
#include <QTimeZone>
+#include <QDateTime>
#include <QTimer>
#include <QTestEventLoop>
#include <QSignalSpy>
@@ -1592,12 +1593,12 @@ void tst_QItemDelegate::dateTextForRole_data()
QDate date(2013, 12, 11);
QTime time(10, 9, 8, 765);
// Ensure we exercise every time-spec variant:
- QTest::newRow("local") << QDateTime(date, time, Qt::LocalTime);
- QTest::newRow("UTC") << QDateTime(date, time, Qt::UTC);
-#if QT_CONFIG(timezone)
+ QTest::newRow("local") << QDateTime(date, time);
+ QTest::newRow("UTC") << QDateTime(date, time, QTimeZone::UTC);
+# if QT_CONFIG(timezone)
QTest::newRow("zone") << QDateTime(date, time, QTimeZone("Europe/Dublin"));
-#endif
- QTest::newRow("offset") << QDateTime(date, time, Qt::OffsetFromUTC, 36000);
+# endif
+ QTest::newRow("offset") << QDateTime(date, time, QTimeZone::fromSecondsAheadOfUtc(36000));
#endif
}