diff options
author | Liang Qi <liang.qi@nokia.com> | 2010-07-01 13:32:20 (GMT) |
---|---|---|
committer | Liang Qi <liang.qi@nokia.com> | 2010-07-01 13:34:38 (GMT) |
commit | 08df5e30508d89c4a8785d3fff7391fe10b2220b (patch) | |
tree | d2d15f093dccb75dc6b39da865677a225ca72bdb /src | |
parent | 24bc9555ba04bb357dc3d956a190d02c4152b9a4 (diff) | |
download | Qt-08df5e30508d89c4a8785d3fff7391fe10b2220b.zip Qt-08df5e30508d89c4a8785d3fff7391fe10b2220b.tar.gz Qt-08df5e30508d89c4a8785d3fff7391fe10b2220b.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.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp index ae8aad6..5edb364 100644 --- a/src/corelib/tools/qdatetime.cpp +++ b/src/corelib/tools/qdatetime.cpp @@ -1843,7 +1843,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)); } } |