OSDN Git Service

rely on the fact that default QTime constructor is for null-time in QTime::fromString()
authorIvailo Monev <xakepa10@laimg.moc>
Sat, 28 Dec 2019 23:14:34 +0000 (23:14 +0000)
committerIvailo Monev <xakepa10@laimg.moc>
Sat, 28 Dec 2019 23:14:34 +0000 (23:14 +0000)
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
src/core/tools/qdatetime.cpp

index 835f0fa..b991e3f 100644 (file)
@@ -1662,9 +1662,7 @@ int QTime::msecsTo(const QTime &t) const
 QTime QTime::fromString(const QString& s, Qt::DateFormat f)
 {
     if (s.isEmpty()) {
-        QTime t;
-        t.mds = NullTime;
-        return t;
+        return QTime();
     }
 
     switch (f) {