Large graphical Qt applications heavily rely on heap allocations.
Jemalloc is a general-purpose malloc(3) implementation designed to
reduce heap fragmentation and improve scalability. It also provides
extensive tuning options.
Add a -jemalloc configure option, disabled by default. When enabled, Qt
and user code link to jemalloc, overriding the system's default
malloc().
Add cooperation with jemalloc for some Qt key classes: QArrayData (used
by QByteArray, QString and QList<T>), QBindingStoragePrivate,
QDataBuffer (used by the Qt Quick renderer), QDistanceFieldData,
QImageData, QObjectPrivate::TaggedSignalVector, QVarLengthArray.
This cooperation relies on two jemalloc-specific optimizations:
1. Efficient allocation via fittedMalloc():
Determine the actual allocation size using nallocx(), then adjust the
container’s capacity to match. This minimizes future reallocations.
Note: we round allocSize to a multiple of sizeof(T) to ensure that
we can later recompute the exact allocation size during deallocation.
2. Optimized deallocation via sizedFree():
Use sdallocx(), which is faster than free when the allocation size
is known, as it avoids internal size lookups.
Adapt the QVarLengthArray auto tests on capacity.
Non-standard functions docs are at https://jemalloc.net/jemalloc.3.html
[ChangeLog][QtCore] Added optional support for the jemalloc allocator,
and optimized memory allocations and deallocations in core Qt classes to
cooperate with it.
Change-Id: I6166e64e66876dee22662d3f3ea3e42a6647cfeb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The bootstrap lib doesn't build qfilesystemengine_mac.mm, and that's
where QFileSystemEngine::supportsMoveFileToTrash and
QFileSystemEngine::moveFileToTrash are implemented.
Make sure that the preprocessor picks up the QT_BOOTSTRAPPED condition
first to define implementations for the two methods.
Pick-to: 6.9
Fixes: QTBUG-135650
Change-Id: Icf7995abfae368b9f5bd5c4ccfcf4c3c6664d519
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The ccache man page says we have to compile with -fno-pch-timestamp when
using clang and precompiled headers.
"Professional CMake" also recommends this approach, and the ccache
statistics report a marginally better hit rate with this patch.
Task-number: QTBUG-131650
Change-Id: Ic1c17a3977771673ac256674143dbdf8d5ffa28c
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
QDoc generates warnings for images that do not have alt-text associated
with them. Alt-text is used to add context to images for users who use
screen-readers.
This patch applies alt-text to images in the Qt SQL module that do not
have any alt-text associated with them.
Fixes: QTBUG-135114
Pick-to: 6.9 6.8
Change-Id: Iead375852d30219db7dfed12bb1f383eb55713e6
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
This updates the documentation for QXmlStreamReader and QXmlStreamWriter
to explicitly state that only XML 1.0 is supported. While the writer
allows specifying arbitrary version strings, it does not implement
XML 1.1 features. The reader strictly enforces XML 1.0 and rejects
unsupported versions.
Fixes: QTBUG-43029
Pick-to: 6.9 6.8 6.5
Change-Id: I771de29e7915d7a4daafe2fe14d600adfbbac4ac
Reviewed-by: Mate Barany <mate.barany@qt.io>
QPointer is used to track whether a QObject is still alive, and so
it's unsurprising that checking whether the pointer is null is
sometimes done in situations where the QObject is already in the
process of being destroyed and therefore already demoted from T, the
QPointer template argument, to some base class.
Because of the way we made QPointer SCARY¹, calling data() will cast
from QObject* to T*, which is UB if the T was already demoted.
It's hard to fix this in the general case, but the various ways to
spell isNull() should all be equivalent to isNull() (which does not
cause UB, because it doesn't cast).
This patch fixes the relational operators against nullptr and adds an
explicit operator bool() so that if (p) and if(!p) no longer have to
go through (implicit) operator T*(). This does not appear to cause
disambiguities, so it's SC.
Don't document the operator, it's an implementation detail (and not
documenting it lets us pick it back). A follow-up will add the
documentation for 6.10+.
Add tests, even for stuff that's currently still UB (but marked by an
early return). A follow-up patch will try to make as many of these
other operations non-UB as possible, too.
¹ Originally 3f7741fbe7ab4140f8f971c0cf88bb04e7feea6b, then changed in
cc7239da8d1ab95e68e12a64df3ca3051419cb34 and
351c738fc4586bf354c9363fb78e190bdfca4617.
Amends the commits mentioned in the footnote.
[ChangeLog][QtCore][QPointer] For `QPointer<Derived> p`, `!p` and
comparing `p` to nullptr no longer perform invalid downcasts when the
object held in `p` is in the process of being destroyed and has
already been demoted from Derived to one of its base classes. Before,
these expressions invoked data(), which casts from QObject* to
Derived*, a cast which is invalid.
Pick-to: 6.9 6.8 6.5 5.15
Task-number: QTBUG-135626
Change-Id: I1b59062345e1b6933958c7e030d9253d69e7591c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
When we insert a new row where the row type is an associative container,
the resulting row holds no data, and the QVariant we get from data is
invalid. So far we have QEXPECT_FAIL'ed the test that checks if the data
from a new row is valid. This is misleading; there is a valid map in the
row, which is what we want to test.
Instead, connect to the rowsInserted signal to populate the new row(s)
with (empty, but valid) data.
Change-Id: If89e30c2944581bd0059f908e2dfb956c655f34f
Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
The tree tests are passing now, presumably because we instantiate
the model explicitly in 8edabea2a76192788d30afc22e2ebcb560195401.
Change-Id: I08749311034b34ec958b163c1b19105d847309e9
Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
Amends commit 31207b539a19182b48c4b3b8413190d505633eea.
Unlike the other setXxx() functions, setUserInfo() has a trimmed() call,
which was retained from Qt 4's QUrl. This is probably wrong, but no one
has complained in the 17 years of public Git history. As a result, the
template function QUrlPrivate::setUserInfo() was getting a copy of the
string, which is inefficient. We can fix that by simply moving the
string and matching a move inside that function too.
Coverity-Id: 480249
Coverity-Id: 480253
Change-Id: I5d9edea3174080822e82fffdd5f1548e8715e510
Reviewed-by: David Faure <david.faure@kdab.com>
Initialize the variable with the default value, to avoid the type
mismatch warnings.
Fixes: QTBUG-135648
Pick-to: 6.8 6.9
Change-Id: I3ae2c59fb42676b373bcbbe06d3e6636203e283b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Events of type QEvent::NonClientAreaMouseButtonDblClick have to be
QMouseEvent, not just QEvent, as this test function did.
Says UBSan:
qdockwidget.cpp:1715:36: runtime error: downcast of address 0x7ffea5257d10 which does not point to an object of type 'QMouseEvent'
0x7ffea5257d10: note: object is of type 'QEvent'
3d 7f 00 00 c0 2b dc f4 3d 7f 00 00 b0 00 00 00 01 00 00 00 49 c1 02 3b a1 90 45 7c 20 17 03 00
^~~~~~~~~~~~~~~~~~~~~~~
vptr for 'QEvent'
#0 0x7f3e1bcb0633 in QDockWidget::event(QEvent*) qdockwidget.cpp:1715
#1 0x7f3e1a262351 in QApplicationPrivate::notify_helper(QObject*, QEvent*) qapplication.cpp:3309
#2 0x7f3e1a2e374a in QApplication::notify(QObject*, QEvent*) qapplication.cpp:3259
#3 0x7f3df1e0ca4a in QCoreApplication::notifyInternal2(QObject*, QEvent*) qcoreapplication.cpp:1111
#4 0x7f3df1e0f453 in QCoreApplication::sendEvent(QObject*, QEvent*) qcoreapplication.cpp:1551
#5 0x5599b850aeee in tst_QDockWidget::titleBarDoubleClick() tst_qdockwidget.cpp:869
Fix by creating a minimal QMouseEvent instead. This is a hot-fix to
get rid of the UB. I can get away with passing senseless parameters to
the QMouseEvent, because the test worked (except for the UB) for even
a QEvent. A proper fix should use a proper QMouseEvent. Created
QTBUG-135410 to track the issue.
Amends the start of the public history, but not picking back. The
eventual fix for QTBUG-135410 should first revert this hot-fix, and
then pick the proper fix to all then-active branches.
Task-number: QTBUG-135410
Change-Id: I188fb5b7d7bdab0432a4877c1948dc0c384a658a
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Only with these changes the affected code compiles with mingw-w64 and
GCC 14.2.0.
Change-Id: Ib4c392cd306b4e8b433048af077ae7aeb0459e1f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Opens up the option to provide optimized reimplementations of e.g. mime
type handling or sorting, without having to worry about compatibility
implications when adding new overrides.
Also override QObject::event/eventFilter, for the same reason.
Change-Id: I843cfc449770e780fa3dbc2bd9629939f847a26e
Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
In Android's manual URI content test, there is a test case for moving a
file to another directory. While the function works and the file is
moved correctly, the URI is no longer usable after this operation. The
file must be reopened with a new URI.
This commit updates fileOperations test case to use the new URL after
moving file to another directory
Pick-to: 6.9 6.8
Fixes: QTBUG-134881
Change-Id: I114d76d6851815e7ee3d94ddc28d677d7c1ccea9
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
We only support layer-backed views nowadays.
Change-Id: I900605a50ce513c4de08081200f2946ee08f15c8
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
The drawRect callback was used when we were supporting both surface-
backed and layer-backed drawing, but nowadays we only support layer-
backed drawing.
However we couldn't just remove the implementation, as the default
backing layer of an NSView is an NSViewBackingLayer, which in its
override of [CALayer display] checks whether the view implements
drawRect, and if not bails out, which meant we never reached our
displayLayer callback from [CALayer display].
But, we don't need NSViewBackingLayer, as we handle layer updates
and draw callbacks in a more generic way, to support CAMetalLayer,
so instead we now use a plain CALayer as our backing layer for
raster windows.
Change-Id: I5b878ff51ca92dafcb80bf5a686ced13088cfa28
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
We want tst_qfloat16 to be built in C++20 mode, even if Qt itself is
not built in C++20 mode, which means we can't use QT_FEATURE_cxx20 as
check in tst_qfloat16's CMakeLists.txt.
In addition, even if the compiler supports C++20, the standard library
may not support all features we need. Specifically, due to the
deployment target of macOS being 12 we can't rely on std::to_chars
being available, as is only available since macOS 13.4.
This patch introduces a separate QT_FEATURE_cxx20_format, and
adjusts the tst_qfloat16's CMakeLists.txt to use this feature.
Note that we intentionally do not add QT_FEATURE_cxx20 as a
hard condition to the new check, because it might be disabled
during the Qt configuration, but we still want the test to be
built in C++20 mode.
Note also, that we cannot use the QT_CONFIG(cxx20_format)
check in the qtformat_impl.h header, because the std::format
support is header-only, and user project might be compiled
for a different minimal macOS version, so we do not want to
rely on the Qt-specific config.
Pick-to: 6.9 6.8
Change-Id: Ibc43d243dbb24fcb922647fe2d90f61491144eb7
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
_qt_internal_set_rpath was using CMAKE_INSTALL_PREFIX instead of
QT_DEPLOY_PREFIX for the destination path, which ends up trying to
adjust the rpath of plugins in the regular install destination, rather
than in DESTDIR.
Change the code to use QT_DEPLOY_PREFIX where appropriate.
Amends 5430fb22439db9fc1ad1df4cbf0319b63346b0a5
Pick-to: 6.8 6.9
Fixes: QTBUG-135620
Task-number: QTBUG-109553
Change-Id: Iea1c0b69ba93fa5e81c463df57f8c2e19703a66a
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
QAbstractSlider::sliderChange() is not a signal, but a protected
function, carrying an enum (also protected) to inform subclasses about
changes in the base class.
A user reported (QTBUG-135597) that in 5.15 the function was not
called for SliderOrientationChange.
Add a test that verfies that the function is a) called for all other
enum values and b) add XFAILs for the (still) missing
SliderOrientationChange.
Amends the start of the public history.
Pick-to: 6.9 6.8 6.5 5.15
Task-number: QTBUG-135597
Change-Id: I959077f030976937dd279897748025afa06e74dd
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
A QGraphicsEffect is not rendered inside a QGraphicsView so we must not
set it on a QComboBoxPrivateContainer. We have to do some checks for it
when a stylesheet is set as polish() is then called before the proxy
widget is set on the QComboBoxPrivateContainer. But luckily QComboBox
has the proxy widget already set so do the check there.
Pick-to: 6.9 6.8
Fixes: QTBUG-135340
Task-number: QTBUG-128916
Task-number: QTBUG-128329
Change-Id: I2426701f3aa44a2eb14b66846628dbb9cd16dc9f
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Otherwise we run the risk of a child window referencing its parent
as a QWindow, for example via QWindow::screen(), which is UB, as the
QWindow no longer exists as such.
It's the right fix, but it may have fallout from code that (wrongly)
assumed children would live longer than what they will after this patch.
The reason for not picking to 6.9 or earlier is to mitigate this risk.
We can always pick later once it's cooked in dev.
Done-with: Marc Mutz <marc.mutz@qt.io>
Change-Id: Idca3fe09b83c7bcd9335a48877f2f14b304fb0ac
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Allow both model types to have a policy, and unify the policy API
to always pass the row we operate on by reference (as it must never
be nullptr).
Add test coverage for passing models and rows as pointers, wrapped
references, shared pointers, and unique pointers.
Change-Id: I4797dc4c26fb1676e851df62dae4f8a382cec6fc
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
While the MS docs don't include the NTAPI attribute here, these
functions are presented with stdcall name mangling in the ntdll.lib
import library in the Windows SDK (and likewise in the mingw import
libraries). Therefore, add NTAPI (which expands to __stdcall) here
to fix linking.
Change-Id: I7d59b6a3c64823743498497a2ddc869e5556432c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
parseDecodedMode() encoded only the percent ('%') characters ahead of
the standard transformation into the internal format. This is a result
of the decoded mode being retrofitted on top of the original encoded-
only QUrl in commit 53d0624403f7f2ac8fe8364a7c5cd136717d40ed.
That was slightly inefficient: if we needed to perform any additional
transformations, we could end up allocating two strings. It's probably
not a common scenario that the input contains a percent and something we
usually encode for the internal format, but it can happen.
This commit merges the two functionalities. After all, the recode()
function in qurlrecode.cpp has the retryBadEncoding mode.
Change-Id: I6b6d6a0f6a3553748154fffd8afb4900087ad13b
Reviewed-by: David Faure <david.faure@kdab.com>
Complements the previous commit by using templates so we copy the input
QString if it is a QString, duplicate the input if QStringView.
Change-Id: I1646ead1283e16029fc6fffd850daf12b6f6f913
Reviewed-by: David Faure <david.faure@kdab.com>
Implemented for the internal QUrlPrivate::setXxxx functions that don't
call setError() (that is, all except setAuthority() and setHost())
because setError() takes the full input to store for the error string.
This temporarily means we won't copy the user's QString when no
modifications are made to store in the PrettyDecoded mode. That will be
fixed in the next commit.
Change-Id: I984e855c964c23c93c4dfffd1a703ca00ed2090e
Reviewed-by: David Faure <david.faure@kdab.com>
We don't need to QUrlPrivate::appendPath() to a temporary variable under
QUrl::FullyEncoded mode and then setPath(). We can simply ask
appendPath() to write to the destination variable once and for all, so
long as we take care to ask it to use the encoding form that setPath()
uses (QUrl::PrettyDecoded, which is 0x0). That avoids the side trip
through FullyEncoded mode.
Pick-to: 6.8 6.9
Change-Id: I7908b9cf75742db07145fffd9499ce3b79492fdb
Reviewed-by: David Faure <david.faure@kdab.com>
Amends (reverts) commit 5e936b60fc921e21b8153a83113886a1de333b57, which
forced the encoding of the square brackets ("[]") into their percent-
encoded forms only in QUrl::fromLocalFile(). This commit expands the
functionality to all uses of decoded paths by applying the change
directly to recodeFromUser().
[ChangeLog][QtCore][QUrl] Square brackets ("[]") are now transformed to
their percent-encoded forms ("%5B" and "%5D") when present as inputs to
setPath(), setQuery(), and setFragment() if the parsing mode is
QUrl::DecodedMode (the default).
Pick-to: 6.8 6.9
Fixes: QTBUG-135433
Task-number: QTBUG-134073
See: https://bugs.kde.org/show_bug.cgi?id=502280
Change-Id: Id2b41559af08b5f228e4fffdb9c6f23120f856b5
Reviewed-by: David Faure <david.faure@kdab.com>
yocto/meta-qt6 builds qtbase with DBus and without XCB/Wayland.
The build failed, because QDBusListener is only built with either XCB
or Wayland.
Change CMake configuration and build QDBusListener always with DBus,
except on Apple platforms, where it is not needed.
Change-Id: Ia50a9a78941362a2c5ece68d50de3b3bddd5d878
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Use qobject_cast<QComboBoxPrivateContainer *> instead
QObject::inherits() as this should be slightly faster and we have access
to the type so no need to use error-prone string comparison.
Pick-to: 6.9 6.8
Task-number: QTBUG-135340
Change-Id: I90ebb2323f21c2f5f9dd65bd7b1beeb32f1a91cc
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
GCC, with ubsan and optimization enabled, issues -Warray-bounds for
the cast from &polygonItem to QGraphicsTextItem*, because the latter
is-a QObject and the former is not, so the cast has to adjust the
pointer value to correct for the fact that QGraphicsItem is not the
first base class of QGraphicsTextItem:
qgraphicsitem.h:973:56: warning: array subscript -1 is outside array bounds of ‘QGraphicsPolygonItem [1]’ [-Warray-bounds]
973 | || (item && int(Item::Type) == item->type()) ? static_cast<T>(item) : nullptr;
| ^~~~~~~~~~~~~~~~~~~~
tst_qgraphicsitem.cpp:3193:26: note: while referencing ‘polygonItem’
Check the implementation is correct in this respect by not just
checking for nullptr or non-nullptr, but checking that the result
matches what dynamic_cast produces.
We can assume dynamic_cast works on QGraphicsItems because QPA is
using dynamic_cast, so both QtGui and QtWidgets need to have been
compiled with RTTI enabled.
This doesn't eliminate the GCC warning, but confirms that it is a
False Positive.
Pick-to: 6.9 6.8 6.5
Change-Id: Ifc262cb6e715e8e68c180855adc2467960da89a1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
... not just 'derivedChild'.
This doesn't change anything for the test right now, but will enable
an extended test to be added on top.
Pick-to: 6.9 6.8 6.5 5.15
Change-Id: Id52f785168c97c43433fb15a6a71a9d1fb140036
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The test function created a parent-less QGraphicsWidget, and while it
added a bunch of child objects to it, that initial graphics-widgets
never got an owner so it and all the children were leaked.
Fix by holding it in a unique_ptr. That is the minimally-invasive fix.
Amends the start of the public history.
Pick-to: 6.9 6.6 6.5 5.15
Change-Id: I3ab9db721e1343f2bd8d9fdd0ee6e86733a66da2
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
The populateLayout() function adds parent-less QGraphicsWidgets
(RectItems) to the layout. If the layout had a graphics-widget parent,
it would reparent the items added to it onto the parent. But it
didn't, so it didn't.
Therefore, the last part of the test function (as denoted by the
re-creation of `layout`) leaked a lot of items, including `layout`.
To fix, give the layout the existing graphics-widget parent. Then the
layout itself isn't leaked anymore, either.
Amends the start of the public history.
Essentially the same commit for columnCount() that
b9836518a367a31a48027a5bf81c4973b847b442 was for rowCount().
Pick-to: 6.9 6.8 6.5 5.15
Change-Id: Ic38dfccfa41049d96eb0cf5811271ac17f2b1f91
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
The test function creates a bunch of QGraphicsWidgets without parents,
and adding them to the QGraphicsGridLayout doesn't make them owned by
it. Besides, the layout was without a parent itself, so all these
objects were leaked.
To fix, give the layout a stack-allocated QGraphicsWidget parent. Now,
the layout will reparent the widgets added to it to its own parent
widget, which will delete layout and child widgets when it itself is
deleted on all exists from the test function.
Amends the start of the public history.
Pick-to: 6.9 6.8 6.5 5.15
Change-Id: I8d80713f4ff6b1055bc396d855f98bc1873aee3b
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
The test function created a parent-less QGraphicsWidget on the heap,
and didn't otherwise transfer ownership of it to another object, so
the object was leaked.
The minimal fix is to hold the graphics-widget in a unique_ptr. This
requires to change the following line, too (as would the alternative,
allocation on the stack), but the rest of the function can stay as-is
(unlike with stack allocation, which would require further s/[.]/->/.
Amends 4f072e2d3d7e429359ff15a615d02712bff7ee51.
Pick-to: 6.9 6.8 6.5 5.15
Change-Id: Ide305dde7934747dbc3acdb49f5a75e98563828c
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
The test function contains a negative test where we're trying to
remove an item that isn't in the layout.
Unfortunately, the object we're passing is heap-allocated and has no
parent, so was leaked.
To fix, pass the existing `widget` as a parent. This doesn't change
the test's outcome: Like in QWidget, a graphics-widget is not
automatically added to its parent's layout.
Amends the start of the public history.
Pick-to: 6.9 6.6 6.5 5.15
Change-Id: Ic110ea7b93aa0023c0903c776a30dc5c377ce0c5
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Make deletion of unused tab bars conditional to dockwidget and tabwidget
features.
Task-number: QTBUG-135468
Pick-to: 6.9 6.8 6.5
Change-Id: I0ecb55ab20737f401796cdd4ebbc6040e54b5afe
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Naming the private API "reparent()" was unfortunate. It is ambigous, as
it suggests that the QDockWidget argument may be parented to the group
window. In fact the opposite is the case: It is removed from the group
window and re-parented to the QMainWindow.
Rename the API into reparentToMainWindow(), which is what it does.
Amends e6d85cf28bc4f750b69c33b72c006b067ae1190f.
Task-number: QTBUG-135442
Pick-to: 6.9 6.8 6.5
Change-Id: I6f9f37c190f3550348b1e4e14a8612d8880170dd
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Currently all the tests are expected to pass because we always
convert everything to UTF-8.
This is a pre-requisite for the follow-up patches that would try to
optimize the internal logic to minimize the number of encoding
conversions.
Task-number: QTBUG-124636
Pick-to: 6.9 6.8 6.5
Change-Id: I0ac9212aeb8ccc768393e80c9e0d704fdc227b56
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The addData(QASV) overload was unconditionally converting UTF-16 and
Latin1 data to UTF-8.
However, if we already started reading the XML document, and we know
that its encoding is UTF-16 or Latin1, then we know for sure that the
new data has to be added as-is.
Amends 6bc227a06a0d1392d220aa79ddb1cdc145d4f76e.
[ChangeLog][QtCore][QXmlStreamReader] Fixed a bug when
addData(QAnyStringView) was incorrectly recoding UTF-16 and Latin1
data to UTF-8, thus potentially mangling it.
Fixes: QTBUG-135129
Pick-to: 6.9 6.8 6.5
Change-Id: Ie1171a5e5596b72a6f160031a4c5a9df3baae4fd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
...to match 6.8 that has this added as part of a backport.
The D3D12 backend has this already. Still, move the
resetting of the variable to the outer scope in that one
too, to cover both code paths.
Pick-to: 6.9
Change-Id: Ie4ba22ff9f2a2f6882dd2d5e3063c4e6701fa95c
Reviewed-by: Andy Nichols <andy.nichols@qt.io>