From f3002b6e205463305502600df95b1ae509e47a9b Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Tue, 26 Mar 2019 19:20:24 +0100 Subject: Use the QTime API less clumsily Various patterns seem to have been copied, notably counting time from QTime(0, 0) rather than using QTime::msecsSinceStartOfDay() and its setter. Unsuitable value types also put in an appearance, and QTime()'s parameters after the first two default to 0 anyway. Corrected a lie in QTime()'s default constructor doc; it does not work the same as QTime(0, 0) at all. Change-Id: Icf1a10052a049e68fd0f665958f36dbe75ac46d5 Reviewed-by: Thiago Macieira --- tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/auto/network/access') diff --git a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp index 8627a37e12..eb956bec30 100644 --- a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp @@ -123,7 +123,7 @@ class tst_QNetworkReply: public QObject if (!seedCreated) { seedCreated = true; // not thread-safe, but who cares } - return QString::number(QTime(0, 0, 0).msecsTo(QTime::currentTime())) + return QString::number(QTime::currentTime().msecsSinceStartOfDay()) + QLatin1Char('-') + QString::number(QCoreApplication::applicationPid()) + QLatin1Char('-') + QString::number(QRandomGenerator::global()->generate()); } -- cgit v1.2.3