qt5base-lts/src
Thiago Macieira dda9c9e2bc moc: fix use of escape sequence of more than one character
We had the code to calculate the length, but were improperly using it
only for the offset, not the length of the string or its containing
array. That resulted in the generated moc output containing:

 QT_MOC_LITERAL(111, 5), // "\xffz"
 QT_MOC_LITERAL(114, 5), // "\0012"
 QT_MOC_LITERAL(117, 23), // "slotWithAReallyLongName"

The two strings are described as occupying 5 bytes (length 4 + null
terminator), which is incorrect. The offset was correct: 114 - 111 = 3
and 117 - 114 = 3. The new output is:

        QT_MOC_LITERAL(111, 2),  // "\xffz"
        QT_MOC_LITERAL(114, 2),  // "\0012"
        QT_MOC_LITERAL(117, 23),  // "slotWithAReallyLongName"

The effect of the array size calculation would only be felt if moc
decided it needed a second string array (for strings over 65535 bytes),
which would cause the offsets in the second array to be all wrong. There
was no such test until now.

Drive-by fixing of the newline, indentation, and the stale comment
referring to QByteArrayData (Qt 5).

Pick-to: 6.2 6.3 6.4
Change-Id: Id0fb9ab0089845ee8843fffd16f9cd01b3e0709a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-06-22 13:03:17 -07:00
..
3rdparty Network: make Public Suffix List constexpr 2022-06-19 16:27:16 +08:00
android Fix typos in docs and comments 2022-06-15 21:31:02 +02:00
concurrent Add the qt_class pragma to file listed in sync.profile classnames map 2022-06-22 03:03:31 +02:00
corelib moc: Allow reading property values through bindables 2022-06-22 16:05:07 +02:00
dbus Fix typos in docs and comments 2022-06-15 21:31:02 +02:00
entrypoint Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
gui Doc: Add qthelp dependency to gui and widgets 2022-06-22 04:49:38 +02:00
network Isolate http2protocol_p.h include 2022-06-22 03:03:31 +02:00
opengl Fix typos in docs and comments 2022-06-15 21:31:02 +02:00
openglwidgets Fix typos in docs and comments 2022-06-15 21:31:02 +02:00
platformsupport Fix typos in docs and comments 2022-06-15 21:31:02 +02:00
plugins wasm: do not allow blocked windows to be resized 2022-06-22 20:04:35 +10:00
printsupport macOS: set print dialog up with page attributes when no printer is installed 2022-06-17 19:06:10 +02:00
sql Add the qt_class pragma to file listed in sync.profile classnames map 2022-06-22 03:03:31 +02:00
testlib Add the qt_class pragma to file listed in sync.profile classnames map 2022-06-22 03:03:31 +02:00
tools moc: fix use of escape sequence of more than one character 2022-06-22 13:03:17 -07:00
widgets Doc: Add qthelp dependency to gui and widgets 2022-06-22 04:49:38 +02:00
xml Add QDom internalSubset implementation 2022-06-23 02:18:39 +08:00
CMakeLists.txt Make it possible to disable the PrintSupport module 2021-02-09 09:17:21 +01:00