qt5base-lts/tests/auto
Tor Arne Vestbø 3eac6079d9 macOS: Don't mangle QByteArray settings with @ prefix by decoding as UTF-8
QSettings encodes QVariants as @Type(data) strings. If that data contains
a null-byte, we write the string as UTF-8 encoded CFData. When reading it
back we look for a @ prefix, and then pass it as UTF-8 through stringToVariant.

The problem arises then the user writes raw QByteArrays with a @ prefix.
We can detect this situation by checking the result of stringToVariant,
and if it's just a simple conversion of the string into a QVariant, we
know that stringToVariant hit its fallback path due to not finding any
embedded variants.

If that's the case, we return the raw bytes as a QByteArray.

Pick-to: 6.2 6.1 5.15 5.12
Change-Id: I4ac5c35d0a6890ebea983b9aca0a3a36b0143de2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-07-13 00:59:49 +02:00
..
bic/data Add binary compatibility files for Qt 6.0.0 2021-04-08 06:34:13 +00:00
cmake Use target_link_options to propagate object libraries 2021-07-02 15:17:06 +02:00
concurrent tst_QtConcurrentThreadEngine: fix the threadCount() test 2021-07-12 15:54:41 +02:00
corelib macOS: Don't mangle QByteArray settings with @ prefix by decoding as UTF-8 2021-07-13 00:59:49 +02:00
dbus Port QDBusServiceWatcher::watchedServices to bindable properties 2021-04-28 16:59:53 +02:00
gui QColorTrcLut: hold in shared_ptr 2021-07-12 22:16:41 +02:00
guiapplauncher Move QStateMachine from QtCore to QtScxml 2020-08-24 20:10:25 +02:00
network CMake: Remove the usage of QT_SOURCE_TREE from tests 2021-07-12 18:56:14 +02:00
opengl Remove the qmake project files 2021-01-07 15:32:28 +01:00
other Fix crash in concurrent disconnect 2021-06-17 08:56:22 +02:00
printsupport Remove the qmake project files 2021-01-07 15:32:28 +01:00
shared Remove false Q_UNREACHABLE from shaping code 2021-02-03 09:44:44 +01:00
sql QSqlTableModel::orderByClause(): Quote the table name 2021-05-03 14:10:36 +00:00
testlib QTest: fix -Wformat-overflow GCC warning 2021-07-01 06:44:30 +02:00
tools Test Q_CLASSINFO("foobar", #__VA_ARGS__) in tst_moc 2021-07-08 08:17:34 +02:00
widgets QTableView: fix selection with rows and cells in ExtendedSelection mode 2021-07-12 08:19:16 +00:00
xml tst_qdom: clean-up the code enabled only before Qt 6 2021-01-15 15:22:08 +01:00
CMakeLists.txt CMake: Build minimal subset of tests in desktop static builds 2021-04-06 09:15:37 +01:00
network-settings.h Replace QtTest headers with QTest 2020-12-22 15:20:30 +01:00