summaryrefslogtreecommitdiffstats
path: root/src/plugins/styles/mac
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2019-10-04 13:26:27 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2019-10-11 11:59:41 +0200
commit60deb69034e3d3ac36213ad8c36042ad57c495f7 (patch)
treef7c40ebcad857201d09c36edfb97a9242715686a /src/plugins/styles/mac
parent4af00753fad57989a6ae366cc3dbfc56d88508f4 (diff)
Distinguish invalid datetimes from others
A default-constructed QDateTime is invalid, but compared equal to a valid one referencing the start of 1970. This lead to date properties in QML being initialized invalid but not getting an onChange if the first value they're set to is the start of 1970. Fixing that then lead to some tests failing. Indeed, the original equality check involved using toMSecsSinceEpoch(), whose value is undefined unless the datetime is valid, without a prior check on its validity: so ensure all uses of toMSecsSinceEpoch() are guarded with isValid() checks. Reworked tst_QDateTime::toSecsSinceEpoch() to use its bool column (previously unused, after separating from toTime_t(), which uses this column for "out of time_t's range") for validity of the datetime. [ChangeLog][QtCore][QDateTime] Invalid datetimes are now treated as equal and less than all valid ones. They could previously be found equal to valid datetimes. Fixes: QTBUG-79006 Change-Id: Ie72deb8af4350a5e808144d0f6e42dc8eb3ff5ef Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/plugins/styles/mac')
0 files changed, 0 insertions, 0 deletions