summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@nokia.com>2010-07-01 13:32:20 (GMT)
committerLiang Qi <liang.qi@nokia.com>2010-07-01 13:32:20 (GMT)
commit3475453895ff5fb393d375202581e3236c0340e8 (patch)
treeb49155202dd5eaaf09ca8d8bb75b1a7216230818 /src
parentcb3309b28b9d81af33b0ef92f2ae727d0d91b939 (diff)
downloadQt-3475453895ff5fb393d375202581e3236c0340e8.zip
Qt-3475453895ff5fb393d375202581e3236c0340e8.tar.gz
Qt-3475453895ff5fb393d375202581e3236c0340e8.tar.bz2
Using the remaining valid data to construct the QTime object when msec parsing failed.
It's relevant with QTBUG-11623, but not a fix for it. Reviewed-by: Aleksandar Sasha Babic
Diffstat (limited to 'src')
-rw-r--r--src/corelib/tools/qdatetime.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp
index c1027ed..347de0c 100644
--- a/src/corelib/tools/qdatetime.cpp
+++ b/src/corelib/tools/qdatetime.cpp
@@ -1914,7 +1914,7 @@ QTime QTime::fromString(const QString& s, Qt::DateFormat f)
const QString msec_s(QLatin1String("0.") + s.mid(9, 4));
const float msec(msec_s.toFloat(&ok));
if (!ok)
- return QTime();
+ return QTime(hour, minute, second, 0);
return QTime(hour, minute, second, qMin(qRound(msec * 1000.0), 999));
}
}