6c5dac1685
Since 5.6.0, Qt's serialization of QDateTime in QSettings files has
had special-case handling to use a newer QDataStream version than the
one QSettings uses for most other types. This was handled in the
serialization and parsing, but not taken into account in the code that
turned binary data into content suitable for saving to an ini file.
In Qt 5 this caused no problem when no iniCodec was set on the
QSettings object but Qt 6 now uses UTF-8 as (in effect) codec on every
QSettings object. This lead to the binary data encoding QDateTime
being encoded as if it were Unicode, instead of using \x tokens where
suitable. This lead to an unintended incompatible change in how
QSettings stores QDateTime values: Qt 6 was still able to read Qt 5's
values, but Qt 5 was unable to read Qt 6's settings files (unless it
sets its iniCodec to UTF-8, which works round the problem).
The code to convert raw binary data to ini-file-friendly value texts
had a special case for ByteArray and Variant values, to ignore the
codec and use \x tokens: when support for QDateTime was split from
Variant, it gained a DateTime prefix in the parsing code that wasn't
included in this special handling. So add that now.
The resulting DateTime values now match Qt 5 so are readable by it and
by Qt 6 (including versions prior to this change); and the code to
read a DateTime can still read what earlier Qt 6 versions have been
writing. It is likely a Qt 5 QSettings with an iniCodec other than
UTF-8 may have problems with the result, but that was already true.
This amends commit
|
||
---|---|---|
.github/workflows | ||
bin | ||
cmake | ||
coin | ||
config.tests | ||
dist | ||
doc | ||
examples | ||
lib | ||
libexec | ||
mkspecs | ||
qmake | ||
src | ||
tests | ||
util | ||
.cmake.conf | ||
.gitattributes | ||
.gitignore | ||
.lgtm.yml | ||
.tag | ||
CMakeLists.txt | ||
conanfile.py | ||
config_help.txt | ||
configure | ||
configure.bat | ||
configure.cmake | ||
dependencies.yaml | ||
LICENSE.FDL | ||
LICENSE.GPL2 | ||
LICENSE.GPL3 | ||
LICENSE.GPL3-EXCEPT | ||
LICENSE.LGPL3 | ||
LICENSE.QT-LICENSE-AGREEMENT | ||
qt_cmdline.cmake | ||
sync.profile |