Commit Graph

65539 Commits

Author SHA1 Message Date
Christian Ehrlicher a1c6bb8030 SQL/OCI: fix QOCIDriver::formatValue()
The switch needs to be on QSqlField::metaType() instead the internal
QSqlField::typeID() which holds the db-specific type of this field.

This amends 7b391c0d2c.

Pick-to: 6.6 6.5 6.2
Change-Id: Id1d1791826f08adb01cc3da45bf5a66bad288046
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
(cherry picked from commit 55d1480c99)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-09 18:32:21 +00:00
Alexey Edelev 979f6b4eb3 Remove the commented legacy code from Qt6CoreConfigExtras.cmake.in
Pick-to: 6.6 6.5
Change-Id: I44243ed239c21382569f0c4abf9a271da42b9a19
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 74dac559c0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-09 18:32:21 +00:00
Oliver Dawes c56553ae3d Initialize QRhiD3D12::activeAdapter for imported device path
This commit makes it so the QRhiD3D12::activeAdapter is set when
using an imported device. QD3D12MemoryAllocator::create would
crash before as it would attempt to call IDXGIAdapter1::GetDesc1
on the passed uninitalized pointer. With this change using an
imported device with the d3d12 rhi backend will no longer crash
the application.

Fixes: QTBUG-122007
Pick-to: 6.6
Change-Id: Iadc67fee0c7ee70ac904f66a523acd3b1a63e42b
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 95c20ffac3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-09 15:12:46 +00:00
Eirik Aavitsland 6ae9a8441e Refix invalid glTexImage2D operation in FramebufferObject
A recent change fixed the texture format parameter to be RGB instead
of RGBA for opaque internal formats. However, this broke the RGB10
case, since the pixel type is then GL_UNSIGNED_INT_2_10_10_10_REV. The
doc says:

"GL_INVALID_OPERATION is generated if type is [...]
GL_UNSIGNED_INT_2_10_10_10_REV [...] and format is neither GL_RGBA nor
GL_BGRA."
https://registry.khronos.org/OpenGL-Refpages/gl4/html/glTexImage2D.xhtml

This modifies ba9e57d65f.

Pick-to: 6.6 6.5
Change-Id: I9a004331513179a3f840a007af0418d14e7f5dff
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit b0056f052d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-09 14:26:33 +00:00
Tor Arne Vestbø 15c4509018 Apple: Make Qt::Key_Backspace primary sequence for StandardKey::Backspace
This will show up in menus as ⌫, instead of ^H, which is a better fit
with the native behavior.

Task-number: QTBUG-122042
Task-number: QDS-11733
Pick-to: 6.6 6.5
Change-Id: I224971421a13baec2a0f65be8ae4a5791dabafdd
Reviewed-by: Doris Verria <doris.verria@qt.io>
(cherry picked from commit 41b76ffbd0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-09 14:26:31 +00:00
Jonas Karlsson de5820c3f8 Improve KTX file reading memory safety
* Use qAddOverflow/qSubOverflow methods for catching additions and
  subtractions with overflow and handle these scenarios when reading the
  file.
* Add 'safeView' method that checks that the byte array view constructed
  is not out of bounds.
* Return error if number of levels is higher than what is reasonable.
* Return error if number of faces is incorrect.
* Add unit test with invalid KTX file previously causing a segmentation
  fault.

This fixes CVE-2024-25580.

Fixes: QTBUG-121918
Pick-to: 6.6 6.5 6.2 5.15
Change-Id: Ie0824c32a5921de30cf07c1fc1b49a084e6d07b2
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 28ecb523ce)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-09 13:46:48 +00:00
Marc Mutz fbb2bd0a25 Add fast-path in QLibraryStore::findOrCreate() for empty fileName
The LibraryMap can never contain an object whose fileName is empty.

To see that, observe that the only insertion into LibraryMap is in
findOrCreate() and that refuses to add such objects there.

But if LibraryMap cannot contain such an object, and findOrCreate({})
is just an ugly way to get a default-constructed QLibraryPrivate (a
new one for each call), then we don't need to lock the
qt_library_mutex to produce one, and neither do we need to construct a
mapName that we know we'll not find, anyway.

So drag this case to before the mutex locking and the construction of
mapName.

It took me more coffee than I'm ready to admit to figure this out, so
leave a comment for the next reader indicating that an empty fileName
is actually a valid argument.

To avoid repeating the new-expression, wrap it in a lambda, together
with the ref() call. Move the remaining ref() call to where it's still
needed.

The final goal of this exercise is to get rid of the double-lookup in
LibraryMap.

Pick-to: 6.6 6.5
Change-Id: I781eafdb9516410d7a262ad27f52c38ad2742292
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit b28bad0b20)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-09 13:46:47 +00:00
Lucie Gérard c052ee9032 Change license for tests files
According to QUIP-18 [1], all tests file should be
LicenseRef-Qt-Commercial OR GPL-3.0-only

[1]: https://contribute.qt-project.org/quips/18

Task-number: QTBUG-121787
Change-Id: I9657df5d660820e56c96d511ea49d321c54682e8
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit ff1039c217)
2024-02-09 10:50:13 +01:00
Kevin Keating 737dbc8c78 WASM builds now handle bitmap and pixmap cursors
[ChangeLog][QtGui][Platform Specific Changes][wasm] Previously, bitmap
and pixmap cursors were nonfunctional in wasm builds and would trigger
warnings.  These cursors now work as expected.

Fixes: QTBUG-116796
Pick-to: 6.6 6.5
Change-Id: Idd9aa4d458a36452fd5b49f72cc595756fc50923
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
(cherry picked from commit 38c62c5851)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-09 09:32:20 +00:00
Artem Dyomin 07059d4d1d Fix loading QRhiTexture from image on gles
The code should consider that image may be created by
a pointer to user data, with original alignments.
It means that we the way of setting parameters from
raw data and QImage should be the same.

In Qt Multimedia we want to pass a zero-copy image
to rhi creation to get rid of an extra copy:
codereview.qt-project.org/c/qt/qtmultimedia/+/537062

Aslo, data align has been fixed.
Due to the documentation, GL_UNPACK_ALIGNMENT can
be 8, 4, 2, 1. Let's find the biggest possible align.

Task-number: QTBUG-121934
Pick-to: 6.6 6.5
Change-Id: Ic0f1617d4699217a7549c13e916be96108183d03
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 1d6bb23f62)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-09 09:32:19 +00:00
Alexandru Croitor f1cb2edd1e CMake: Add test for configuring a standalone test
A standalone test is one that uses
 find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST)
in its project code.

To ensure we don't accidentally regress this feature, test it as a
cmake test.
Also run test, this somewhat covers testing qt_internal_add_test.

Pick-to: 6.6 6.5
Change-Id: Ia9f27eef2bd7bd5bb57b96e553304924db252365
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit a61ac2ca58)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-09 09:27:42 +00:00
Marc Mutz c4de095be1 QSpan: apply LWG 3346 work-around
We have not hit the GCC < 10.4 problem with containers that define
both element_type and value_type, yet, but we have with
QVersionNumber, so proactively apply it to QSpan, too.

While we're at it, copy the QList code to mark QSpan, too, as
contiguous.

Pick-to: 6.6
Change-Id: I883fd0b5f75db175a730262035ebbf0cb19de529
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 95feea933b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-09 07:20:02 +00:00
Marc Mutz bfd565a4d3 QList: give the LWG 3346 #ifdef'ery a symbolic name
We'll need this in more places, so centralize its definition in
qcompilerdetection.h.

Amends 595b4e1a9b.

Pick-to: 6.6 6.5
Change-Id: I87f84cb9ff3ad339c000604423295180176f5799
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit f4cfc21dec)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-09 07:19:49 +00:00
Tim Blechmann bd17f3f370 cmake: build repo helpers - fine-grained test/example options
the tests/examples could only be enabled globally. when working on a
specific repo, it's beneficial to disable tests/examples for other
projects to reduce project sizes (and cmake configure/generate times)

Change-Id: I0026ba87b667d427043cc8eb1baa6c28b2046dd7
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 25b89f2c88)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-09 07:17:11 +00:00
Christian Ehrlicher 8501df2c09 QAbstractItemView: close all child editors when parent is removed
QAIV::rowsAboutToBeRemoved() closed all child editors when the child was
a direct ancestor of the removed index but forgot to check if the index
is an indirect ancestor. Some of those editors were removed later in
updateEditorGeometries() but not all as the testcase in the bug report
showed.

Pick-to: 6.6 6.5
Fixes: QTBUG-103476
Change-Id: I90b3d3bff3857aa79f96eecf23d980928693b7bc
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 1d799e9108)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-09 07:15:07 +00:00
Ivan Solovev 96775c7c11 Deprecate QDataStream::readBytes(char *&, uint &) instead of removing it
We cannot remove the overload using QT_REMOVED_SINCE, because a qint64
lvalue in the new overload will not bind to an uint& parameter, so the
old code would not compile.

Deprecate the old overload, and add a unit-test that makes sure that
it still behaves correctly.

This commit also introduces the new deprecation macros that are
required to do the deprecation in Qt 6.11.

Amends fd48ce0b73

Found in 6.7 API review

Change-Id: I02893bfbe040df736f8e746384e0261a0f0041d3
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit cbc6ee0eb9)
2024-02-08 15:24:52 +01:00
Morten Sørvig ab02d2053f qfreetype: Fix caching of memory fonts
Make QFreetypeFace::getFace() not return the same font
face for all memory fonts.

QtFreetypeData has a cache which maps QFontEngine::FaceId
to QFreetypeFace instances. Each FaceId should then
have a unique hash value, which is accomplished by
by hashing the font file name and a stored uuid.

However, we were not setting the uuid in all cases,
which means that in-memory fonts (which do not have
a file name) would hash identically.

Fix this by setting the uuid to a value based on the
address of the FontFile, which should be unique.

Change-Id: I45de37b512fb666c26490551c831c0db824b5f35
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit b33b85cc46)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-08 13:38:00 +00:00
Jacek Poplawski 54a32bdacf Disable unloading libraries on VxWorks
Unloading plugins after each test case in QtDeclarative autotests leads to crashes (signal 11) during type registration in subsequent test cases.
The issue arises due to the unloading process, where unloading and then re-registering types in the next test case leads to sig11.
Disabling the unloading of libraries prevents the crashes.

Task-number: QTBUG-115777
Change-Id: I6712f687134fd452fb0b962363a8f0fde85344ff
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit ef5ab6e006)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-08 13:17:58 +00:00
Marc Mutz e576d50d7c QBitArray: avoid overflow in storage-to-size calculations
Unlike other containers, a QBitArray's size() is not limited by
storage, but, esp. on 32-bit platforms, its size_type: A INT_MAX
size() QBitArray only requires 256MiB of storage.

So we can't rely on "won't happen in practice" here and need to avoid
the potential UB (signed overflow) in the (d.size() * 8 - *d.data())
storage-to-logical-size calculation by using unsigned arithmetic.

Use the opportunity to Extract Method adjust_head_and_tail(),
centralizing the bit fiddling.

Pick-to: 6.6 6.5 6.2 5.15
Change-Id: I485eafdf3ce2087a81c683672ff98a43f97c9968
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 78f8dfc542)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-08 06:40:20 +00:00
Marc Mutz e69a151573 QBitArray: use QDataStream::SizeLimitExeeded where applicable
[ChangeLog][QtCore][QBitArray] Uses new
QDataStream::Status::SizeLimitExceeded now, where applicable (was:
WriteFailed, ReadCorruptData).

Change-Id: If5a8db9c6b2f104b40266784d88cf7cad0b0ce73
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 6504496c64)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-08 06:39:55 +00:00
Marc Mutz 0985c707a9 QBitArray: don't create invalid Qt 5 streams
Qt 5 streams cannot handle QBitArrays with more than INT_MAX bits,
even on 64-bit platforms, because of interface constraints (size_type
int).

Qt 6 can, so make sure to refuse serialization of oversized QBitArrays
to Qt-5-compatible streams.

[ChangeLog][QtCore][QBitArray] Now refuses to stream a QBitArray with
size() > INT_MAX to a Qt-5-compatible QDataStream.

Pick-to: 6.6 6.5 6.2
Change-Id: I263e27bd366757c8e0360dfd337948c44d00647a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 9219e8ff1d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-08 06:39:49 +00:00
Alexandru Croitor 2cf327be82 CMake: Fix undefined symbol: qt_resourceFeatureZstd issue
When cross-compiling, host rcc might generate zstd compressed
resources, even though the target might not support zstd
decompression.

To avoid that, we made sure to disable zstd compression when using
cmake api like qt_add_resources if the target platform does not
support it.
We did not do it for CMAKE_AUTORCC though.

In such a situation, the linker would fail with:
 error: undefined symbol: qt_resourceFeatureZstd

Add the --no-zstd option to AUTORCC_OPTIONS for targets that are
created by Qt CMake public API like qt_add_executable and
qt_add_library if the target platform does not support zstd
decompression (check via the QT_FEATURE_zstd variable).

This in turn applies to our own qt_internal_add_ API as well.

Allow opting out via the QT_NO_AUTORCC_ZSTD CMake variable.

[ChangeLog][Build System] Targets created with qt_add_executable
and qt_add_library will now add the --no-zstd option to AUTORCC_OPTIONS
when the target platform does not support zstd decompression. You can
opt out via the QT_NO_AUTORCC_ZSTD cmake variable.

Pick-to: 6.6 6.5
Fixes: QTBUG-121948
Task-number: QTBUG-106466
Task-number: QTBUG-101353
Change-Id: Ibdcfecd9a4b1e206479a3f4588b1b624dd91e122
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 329dbfcc78)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-07 18:31:17 +00:00
Ivan Solovev 7ccd63fd89 QDataStream: use SizeLimitExceeded status in write operations
Set this status when the stream tries to write more data than the
current serialization format supports.

Update the methods that write containers to return early if they fail
to write the container size, and do not try to serialize the elements.

Convert the manual tst_manualqdatastream test into a data-driven
test, allowing us to specify various stream versions. Adjust the test
code to check that the SizeLimitExceeded status is set when the
stream version is <= Qt_6_6.

Amends fd48ce0b73

Found in 6.7 API review

Change-Id: If4c62ea53ac9bccd423f00f0f03afd6ba6bdc4f5
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit dd514160ce)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-07 15:10:29 +00:00
Ivan Solovev 44dc38ebc9 QDataStream::readBytes(): make the growth of the buffer geometric
The algorithm tries to allocate the memory using 1 Mb blocks.
When the input data is large, this results in a lot of reallocations,
which is slow and inefficient.

This patch modifies the algorithm in such way that the allocation size
increases at each step, resulting in geometric growth of the buffer.

Pick-to: 6.6 6.5
Change-Id: I071df68d51ba1dbd8b2eb5f94eb078a33223505f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit a1bfac287e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-07 15:10:29 +00:00
Ivan Solovev 635be3cdf1 Fix QDataStream::operator<<(const char *) to handle 64-bit length
The operator was not converted to using a new streaming version, so it
supported only 32-bit length.

Fix it and add a manual test for serialization/deserialization of
large c-style strings.

Amends fd48ce0b73

Change-Id: I83704edec021d400b992de810feba5da52d5ffe1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 0aaf7092cd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-07 15:10:29 +00:00
Ivan Solovev cc1476c608 QDataStream: use qint64 to represent size while reading and writing
Do that to avoid narrowing at the call site on 32-bit platforms.

Amends fd48ce0b73

Found in 6.7 API review

Change-Id: I31142399385521d973b2ed3789745569e44d5d63
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 0ed34d1992)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-07 15:10:28 +00:00
Lucie Gérard 7d0578b11f Change license for examples files
According to QUIP-18 [1], all examples file should be
LicenseRef-Qt-Commercial OR BSD-3-Clause

[1]: https://contribute.qt-project.org/quips/18

Task-number: QTBUG-121787
Change-Id: I185ebdff2faa5e4af6ac0ee77c3ae33faae06e7d
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit f45dffa8b4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-07 15:10:28 +00:00
Lucie Gérard de0a46c966 Change license for tools files
According to QUIP-18 [1], all tools file should be
LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

[1]: https://contribute.qt-project.org/quips/18

Task-number: QTBUG-121787
Change-Id: I89e08859871d29a9cf8c7a56b30b07b2c2f34b42
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit fb226262e8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-07 15:10:28 +00:00
Lucie Gérard 596341782c Change license of configure.bat file
According to QUIP-18 [1], all build system files should be
BSD-3-Clause

[1]: https://contribute.qt-project.org/quips/18

Task-number: QTBUG-121787
Change-Id: I58689f832ed3a5c8475c9bd7e0205e2128fb7cc2
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 20f7c54fdc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-07 15:10:28 +00:00
Johannes Grunenberg fdd4d5df69 QLogging: Add missing newline in win_message_handler()
Neither win_outputDebugString_helper() nor OutputDebugString() add a
newline at the end of the message, so one needs to be added before being
passed to the output handler.
A newline was previously present but removed when deduplicating calls to
qFormatLogMessage().

Fixes: QTBUG-121947
Change-Id: I9f1c1d8726e4234f24999f47c52340140d5a4614
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit c05f987fcd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-07 15:10:28 +00:00
Eirik Aavitsland cd59980f72 Update bundled libpng to version 1.6.42
[ChangeLog][Third-Party Code] libpng was updated to version 1.6.42

Pick-to: 6.6 6.6.2 6.5 6.2 5.15
Change-Id: Ie41c2df610fcd456af2bc4dee05dde90c426602b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit a046bc19e4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-07 15:10:27 +00:00
Edward Welbourne c2400042ba Update Valgrind to version 3.22.0
[ChangeLog][Third-Party Code] Updated Valgrind header used by QtTest.
The change only affects portability of s390 inline assembler.

Task-number: QTBUG-121346
Pick-to: 6.6 6.5
Change-Id: I7eca3b13d4f5475693c548b85b837d5d4b4b090f
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 79badf1b2c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-07 15:10:27 +00:00
Assam Boudjelthia 6ca01cd2d2 Android: request POST_NOTIFICATIONS permission for Android Notifier
Android 13 and above requires the notification permission
"android.permission.POST_NOTIFICATIONS" to be requested at runtime.

Pick-to: 6.6 6.5
Fixes: QTBUG-121668
Change-Id: I38512ffc07c1a3ffe7cddffa937b98332f172d15
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit 7fa6d09ca2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-07 10:10:08 +00:00
Assam Boudjelthia 8c5ea5b368 Android: fix style extraction when set to none
If extract_android_style meta data is set to none currently the app
still tries to extract full stlye and crashes. If this option is set
no style data should be extracted after this patch.

Fixes: QTBUG-121667
Change-Id: I764e1eb6a582073196f991ca930d245d17a1f7e5
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit ff6a6d3285)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-07 10:10:08 +00:00
Lucie Gérard ae8a5adb96 Change license of .qdoc files
According to QUIP-18 [1], all .qdoc files should be
LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only

[1]: https://contribute.qt-project.org/quips/18

Task-number: QTBUG-121787
Change-Id: I7c4d8a1957db6f6d7ad18cbc1928499724e9305f
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 60889fcf72)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-07 10:10:08 +00:00
Lucie Gérard 7fdb18afda Change doc snippet license
According to QUIP-18 [1], all doc snippet files should be
LicenseRef-Qt-Commercial OR BSD-3-Clause

[1]: https://contribute.qt-project.org/quips/18

Task-number: QTBUG-121787
Change-Id: I6e5bc9d05a5d510cc07a15abafe2257034562510
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 1dbc57ad0c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-07 10:10:08 +00:00
Marc Mutz 5e3723e7ff QBitArray: DRY operator<<(QDataStream&)
Drag the common parts out of the if-else. This also means that
qsizetype size() is no longer truncated in the assignment to quint32
len, but that doesn't fix the problem that we create invalid Qt 5
streams when the QBitArray has more than INT_MAX bits in it. That is
for a follow-up patch (which is why the {} stay for now).

As a drive-by, replace verbose constData() with data() (the QByteArray
is already const).

Pick-to: 6.6 6.5 6.2
Change-Id: Iabf816e16f823bb3959469a635a21339242f36fc
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 741617aea0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-07 10:10:07 +00:00
Ed Cooke 277aa8e61b Update the icons in the system tray example
Update the icons for bad, heart and trash in the system tray example.

Fixes: QTBUG-119127
Change-Id: I0b6d4600397a0cb2a5474da04297ab92689358cd
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
(cherry picked from commit 1878556f25)
2024-02-07 10:10:07 +00:00
Juha Vuolle 02abe2152f Remove HTTP 1XX status test from tst_qrestaccessmanager
1XX statuses are not final statuses, and testing 'error' on it is not
necessarily very meaningful. Furthermore the internal handling of
these statuses changes in Qt 6.8.

Fixes: QTBUG-108068
Change-Id: I9c18c579cd310266273eccd2aee2e032f60538e0
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit cdfeca26cf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-07 10:10:07 +00:00
Christian Ehrlicher e9b187a836 Q(Plain)TextEdit: don't crash when using a style sheet
When using a style sheet, Q(Plain)TextEdit::isReadOnly() might get
called during the initialization before d->control is properly
initialized which lead to a crash.
This amends 43ce457cbd.

Fixes: QTBUG-121697
Fixes: QTBUG-121790
Task-number: QTBUG-1857
Pick-to: 6.6 6.6.2 6.5 6.2
Change-Id: I15c357c9eef7f6559bcc2ad89033a3d8e7fcbfef
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit c6af5b9c12)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-07 01:17:47 +00:00
Matthias Rauter bf8edf8036 Update visuals of remote controlled car example
* Added icons to the controller.
* Keep the car within the scene.
* Removed the ui file because 4 buttons can be maintained in code easier.

Change-Id: I10af821beb442939e1e7fbdd3ffbde67a272bb2f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 29a4323974)
2024-02-06 21:24:14 +00:00
Alexey Edelev 256c39f9d5 Add plugins of imported QtModules to the _qt_plugins property
This covers the following use case:
QtModuleX is pre-built and installed, it's imported. The plugin has
a PLUGIN_TYPE that is associated with QtModuleX and is built with
application that links QtModuleX. When deploying the application
it's expected that the plugin is deployed, as the one that belongs
to the linked QtModuleX.

This ensures that we udpate the internal _qt_plugins property that
is used in the __qt_internal_collect_plugin_targets_from_dependencies
function.

Pick-to: 6.6 6.5
Change-Id: I9824351ebab5a24509800da4db69f1e282a35884
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 75d83d5a65)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-06 19:23:27 +00:00
Matthias Rauter 13c57d394b Update icons in the torrent example
Fixes: QTBUG-118876
Change-Id: I7b3c24db220a0501bc2b99341589211bdf217c05
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 0da459ec5b)
2024-02-06 12:18:40 +00:00
Tor Arne Vestbø 68a8a8b309 Harden WidgetAttributes debug stream operator
The call site may pass in a null-widget, so guard for that.

Change-Id: I631cb2fc105bad69faf3daaeac4b893457d27cc1
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 97c02b80ae)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-02-06 12:18:40 +00:00
Tinja Paavoseppä 5511f64ded Android: Fix QtTextureView inverted opacity condition
The Android TextureView class wants to know whether the view is
opaque, while the condition has been evaluating whether it should be
transparent. Invert the condition to let Android know correctly whether
the TextureView should have transparency.

Change-Id: Ic636f78dd3c691e85456c579e4559b8bc7a077a2
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 8b601e6dbe)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-06 09:22:46 +00:00
Tim Blechmann e7f10f7e76 corelib: serialization - fix macos unity builds
CarbonCore defines `DEBUG`, which can nameclash with the `DEBUG` define
in the json parser when using unity builds

Change-Id: Ic9f666a1da98aaebe30836abf877228f2f83004c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit cadc239c48)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-06 07:18:23 +00:00
Juha Vuolle b21556bf2b Add missing QRestAccessManager constructor documentation
Fixes: QTBUG-121859
Change-Id: Ie8d9033a8efe36767f47509afe1a46c788cb13ca
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit d5f3a9095b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-06 06:11:13 +00:00
Juha Vuolle 5f821c72ea Add missing QHttpHeaders::isEmpty() documentation
Change-Id: Ib0d19cabc09d96b3920ade3db4d46b0bb0a6decb
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit 118ee59d8c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-06 06:11:12 +00:00
Tim Blechmann 1e5892f74a core/gui: fix odr violation
When linking Qt statically, QtCore and QtGui are not separated into
different DSOs.
when both statically linked versions of QtCore and QtGui are linked into
the same binary with LTO, gcc emits:

```
/usr/src/debug/qtbase/6.3.0-r0/git/src/gui/painting/qicc.cpp:105:
warning: type ‘Tag’ violates the C++ One Definition Rule [-Wodr]
/usr/src/debug/qtbase/6.3.0-r0/git/src/corelib/kernel/qtranslator.cpp:78:
note: an enum with different value name is defined in another
translation unit
/usr/src/debug/qtbase/6.3.0-r0/git/src/gui/painting/qicc.cpp:106: note:
name ‘acsp’ differs from name ‘Tag_End’ defined in another translation
unit
/usr/src/debug/qtbase/6.3.0-r0/git/src/corelib/kernel/qtranslator.cpp:78:
note: mismatching definition
```

we therefore define the `struct Tag` in an anonymous namespace or the
QIcc namespace

Change-Id: Ib4edeede35c51322ab1959d70fb87359b196e59b
Pick-to: 6.6 6.5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 6b13e0ca59)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-06 05:03:19 +00:00
Thiago Macieira 6c89a9d606 QDBusAbstractInterface/Doc: fix example to match the description
The docs say "This example illustrates function calling with 0, 1 and 2
parameters" because it was copied from the synchronous call()
documentation. But the snippet didn't do that, because back in Qt 4 when
this was created, it was too difficult to exemplify that for
asynchronous use. It now no longer is, with lambdas.

Drive-by update the docs for both functions to refer to each other.

Fixes: QTBUG-121873
Pick-to: 6.6
Change-Id: I664b9f014ffc48cbb49bfffd17b089b7f77c1cde
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
(cherry picked from commit 9e73917537)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-06 03:36:27 +00:00