diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2022-05-05 13:25:36 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2022-05-20 13:07:30 +0200 |
commit | fc1a84411130d183ae7be458f186659adf875d97 (patch) | |
tree | b7f298e7742f435d781256cf007378ea58eac8db | |
parent | 0757c74b4823b5fe3acbea7eedaf94959d464eb4 (diff) |
Fix wrong QDateTime::isValid() to use the right QFlags method
It's documented to return true "if both the date and the time are
valid and they are valid in the current Qt::TimeSpec" but it was using
testAnyFlag() so would have returned true if any one of the three
conditions was met, rather than only if all three are met.
Change-Id: I91746224009d820abaffb541d8f6d6b13142849b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r-- | src/corelib/time/qdatetime.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/time/qdatetime.cpp b/src/corelib/time/qdatetime.cpp index 9b3a5a1a42..1588801e42 100644 --- a/src/corelib/time/qdatetime.cpp +++ b/src/corelib/time/qdatetime.cpp @@ -3775,7 +3775,7 @@ bool QDateTime::isNull() const bool QDateTime::isValid() const { auto status = getStatus(d); - return status.testAnyFlag(QDateTimePrivate::ValidDateTime); + return status.testFlag(QDateTimePrivate::ValidDateTime); } /*! |