67718 Commits

Author SHA1 Message Date
Tor Arne Vestbø
c410163173 Report 2.x scale factor for UIView on visionOS
The docs claim that this is the default, but in practice it's not
the case.

Change-Id: I5f6184cbfded2efedbac88023644d3c1e80e9901
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit a05f5457ca033214c1efcf528b85a09a9c758920)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-11 16:05:32 +00:00
Tor Arne Vestbø
ad8b330ecc iOS: Merge UIView initializers
We always create UIView via initWithQIOSWindow, so there is no
need to keep part of the implementation in initWithFrame.

Change-Id: I5311ed78fff3294ed49af70d482449cbf3b8211b
Reviewed-by: Doris Verria <doris.verria@qt.io>
(cherry picked from commit 29b6674d3f8d1012def9dbcf89521e4773175dc1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-11 16:05:26 +00:00
Tor Arne Vestbø
6ce8738dd3 iOS: Remove debug code that is no longer needed
Change-Id: I95c29cb1dd237a95c291a8c8874473022e14c65a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit bb5750cd6952e3c6afc5a49406dd22a40929291f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-11 16:05:19 +00:00
Łukasz Matysiak
03ada21195 Use /tmp to test eq operator of qdir
The test checks if two paths test equal if they are pointing to the same
place, but one of them is not a canonical path.
Example of such paths: /tmp/.. and /

The test assumes that /usr is an existing directory on platforms other
than win, haiku and android.
The reason /usr is used instead of /tmp is that /tmp is a symlink on
macos and that interferes with the test (as described in 0b67ad9d).
However /usr does not exist on VxWorks (unless created by the user).

/tmp can (and is in our CI env) enabled by turning on the
INCLUDE_TMP_DIR component.

Solve the problem by using /tmp instead of /usr on vxworks.

Pick-to: 6.7
Task-number: QTBUG-115777
Change-Id: I98b0d46d1b879f404c0b5bd655031e7c3f19ba33
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 70e2fe2bba71ea0a4d1d1e533c1130c97f77df55)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-11 13:13:45 +00:00
Edward Welbourne
addbb45e54 Add missing feature checks in removed API
The #if-ery on the removed API's definition still needs to match its
declaration. Spotted by Axivion.

Pick-to: 6.7
Task-number: QTBUG-122619
Change-Id: I4e3dc03291a8fb7fbc01065bce8e5dc58a051166
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 76f82b8f1334d8a377630876ef2d9681c05d7ee8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-11 08:38:07 +00:00
Mårten Nordheim
555cbb3976 QDnsTlsAssociationRecord: make move ctor default-noexcept
From the API review.

Change-Id: I74140a9268670575488ddc3c31b09c84bc83eae0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit df85c6fd9d65abf44ccdcd1d6e6594cab3fc7d65)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-11 07:41:11 +00:00
Mårten Nordheim
1b3bef3ef4 QDnsTlsAssociationRecord: Use the PURE_SWAP macro for move-assign
Found in API-review.

Change-Id: I77aecfdf31a2a3507798faa03f24f3ea26bf8173
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 7e7b7eb37e780d5c43ba291d4f88d29f4b31d403)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-11 07:41:05 +00:00
Giuseppe D'Angelo
da9da78adc QGraphicsView: add a failing test
Task-number: QTBUG-53974
Pick-to: 6.7 6.5
Change-Id: Ibff3e32080a2978e533bd1f3215fec81bedb72b7
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit f27534158e64ed1fb3aacc090995ea4b2d4b26fe)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-11 00:32:25 +00:00
David Faure
72c97d17bc Fix SSE2-related false positives with thread sanitizer
TSAN has the same issue as ASAN when it comes to the SSE2 usage here.

WARNING: ThreadSanitizer: heap-use-after-free (pid=621)
  Read of size 8 at 0x721000049f78 by main thread:
    #0 _mm_load_si128(long long __vector(2) const*) /usr/lib64/gcc/x86_64-suse-linux/13/include/emmintrin.h:700 (libQt6Core.so.6+0x2ba056)
    #1 qustrlen_sse2 qtbase/src/corelib/text/qstring.cpp:431 (libQt6Core.so.6+0x2ba056)
    [...]
  Previous write of size 8 at 0x721000049f78 by main thread:
    #0 realloc <null> (libtsan.so.2+0x5bdbd)
    #1 QArrayData::reallocateUnaligned(QArrayData*, void*, long long, long long, QArrayData::AllocationOption) qtbase/src/corelib/tools/qarraydata.cpp:244 (libQt6Core.so.6+0x309913)
    [...]
(gcc 13.3.0)

Pick-to: 6.7
Change-Id: Id0127d5fb498dcf78bb977e6ff1b6b380ae423c7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 600368279dafa60e788d8e3cd3af5c1915990fbb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-10 23:27:28 +00:00
Joerg Bornemann
1ffe93ae5d CMake: Emit the 'msvc_obj_debug_info' feature only when MSVC is used
In non-MSVC configurations this feature is meaningless.
Restrict it to MSVC.

Change-Id: Ib5111e8adf49a862d8ca0f191837d8c28aab6890
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 433411934c7ebb2a29e950c14871199166e5534a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-10 22:25:32 +00:00
Marc Mutz
c54f772618 QHttpMultiPartPrivate: de-inline dtors of polymorphic classes
Prevents weak (= duplicated) vtables and the associated problems.

Amends the start of the public history.

Pick-to: 6.7 6.5
Task-number: QTBUG-45582
Change-Id: I26618483900437aca05c753a5d53a359e43bd702
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 645509935ad5a2e8a3fcc858c41d08919a2596bd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-10 22:19:28 +00:00
Friedemann Kleint
4206ef4a93 SQL/IBase: Fix some translatable messages
Amends 4b0b41ec3b362715012f8c771b72c4704f8170f3.

Change-Id: If51e22fb9b19755a0d8f222f8c0044563f8c55f8
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 806e02060a8a84509506884d2620010f3b43cdd0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-10 22:19:28 +00:00
Marc Mutz
8c4c66f07f qhttpmultipart_p.h: add missing qiodevice.h include
QIODevice is a base class of one of the classes defined in this
header. QtCreator's clangd goes on a rampage in this header as a
consequence.

Amends the start of the public history.

Pick-to: 6.7 6.5 6.2 5.15
Change-Id: I06c6a26dde7e7ae72b722136fcd666684733d40f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 09fce4a587047ff03c7ca37dbb2bb8f71a18a75e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-10 22:19:28 +00:00
Volker Hilsheimer
194fa0dc02 Fix build error from signed/unsigned mismatch
When building for 32bit Android:

qcolorclut_p.h:45:31: error: comparison of integers of different signs:
'qsizetype' (aka 'int') and 'unsigned int' [-Werror,-Wsign-compare]
        Q_ASSERT(table.size() == gridPointsX * gridPointsY * gridPointsZ * gridPointsW);
                 ~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Fix by casting the result of the multiplication explicitly to qsizetype.

Change-Id: Ica9a2f9738959adfa841270ffdd4893bd7d1d4e8
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 37ba5e94d681c8d65b0e44a14b0e1595d072800e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-10 19:57:37 +00:00
Mate Barany
6c2b076650 Make the new post and put methods inline in QNetworkAccessManager
Found in API review.

Change-Id: I873c8c0b7e9521d07718b7fd38065d33b98e3ba9
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit f0a8fe6cdf3ec5e8c9030fa581df1aad3b78d210)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-10 19:56:21 +00:00
Alexey Edelev
a2af3e11e1 Make the access to QT_USE_TARGET_ANDROID_BUILD_DIR explicit
CMake somehow doesn't treat the access to the cache variable in
condition as the usage. Replace the check of the
CACHE{QT_USE_TARGET_ANDROID_BUILD_DIR} value with the check of the
CACHE variable definition and the check of the CACHE and non-CACHE
value equality.

Pick-to: 6.7
Change-Id: I07d940d457ebbc4ce3cefef2f73394009d52f367
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 69a661e88e6a7799799033030497086a9194caab)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-10 19:29:16 +00:00
Topi Reinio
f15e6d60e1 Doc: Qt Network: Fix linking issues
src/network/kernel/qdnslookup.cpp:1300: (qdoc) warning:
        Can't link to 'certificateUsage()'
src/network/kernel/qdnslookup.cpp:1388: (qdoc) warning:
        Can't link to 'matchingType()'
src/network/socket/qlocalserver.cpp:273: (qdoc) warning:
        Can't link to 'pendingConnectionAvailable()'

Change-Id: I8ba7e674de6aa548990099e24327f15168fde88e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 6ef3ca87818f9beb9668e45b65ee8a23efd6e809)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-10 19:29:14 +00:00
Olli Vuolteenaho
894c1d4a35 Fix path in Java QML component generation
The parameter buildPath comes from QDir:absolutePath(), which gives a
path that starts with '/' or a drive speficiation. When calling
getImportPaths on a Windows machine the path becomes something like
"/C://dev/qt5/...". As a result, androiddeployqt exists with a failure.

On Linux/macOS systems this was not a problem because // = /

Change-Id: I85376253055549344f06c9da9ebd67364e429112
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 776982a14e53e8661c3508c3d05e0efe538bc67e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-10 07:11:02 +00:00
Jan Moeller
52bb40a088 Android: Remove check for screen/window ascpect ratio mismatch
The check was re-introduced in 7a9bc220c70745cd3689d51cd131efde86f078d7
and moved to QtRootLayout in 6ff88f97a6d24d1098583421161f8f903f9dafde.
It introduces an issue where the resizing of the application window does
not work if the its aspect ratio is different from the screen's aspect
ratio.

Fixes: QTBUG-126122
Pick-to: 6.7 6.7.2
Change-Id: Id6d26b247b9ca7a8d0e89e1fdea2d77db12a6cfe
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit a6b78e6f4dbbf688fc0b1d1487b86890b149d323)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-10 04:54:23 +00:00
Giuseppe D'Angelo
3b1d343215 PCRE: upgrade to 10.44
New upstream release.

[ChangeLog][Third-Party Code] PCRE2 was updated to version 10.44.

Change-Id: I49ecc9f25c104813f87203b8a75338e81a1bd813
Pick-to: 6.7 6.5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 33387ed25f3fa5d914040ebe889b63b7c3daf853)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-10 02:06:02 +00:00
Ahmad Samir
c9b985eae3 QTimer: fix API docs related to QChronoTimer
QChronoTimer is in Qt 6.8.

Found in API review.

Change-Id: I7f20958948cb635ccd1f4cef383aed810a188f12
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 25f2b7c32226fdabcb22fbf928bb0c058cd53022)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-10 02:06:01 +00:00
Ahmad Samir
741c1d0f11 QFileSystemModel: fix leak in unittest detected by ASAN
Amends e524724f9dc6f64f6f94b842682c751dcd07225f.

Indirect leak of 24 byte(s) in 1 object(s) allocated from:
    #0 0x7f73b50fc1d8 in operator new(unsigned long) (/lib64/libasan.so.8+0xfc1d8) (BuildId: 1827a4c72065a9f25ba519b25166029eebbf519f)
    #1 0x7f73b4cc18d4 in std::__detail::_MakeUniq<QSignalSpyPrivate>::__single_object std::make_unique<QSignalSpyPrivate, QSignalSpy*>(QSignalSpy*&&) /usr/include/c++/13/bits/unique_ptr.h:1070
    #2 0x7f73b4cbf0a4 in QSignalSpy::QSignalSpy(QSignalSpy::ObjectSignal) src/testlib/qsignalspy.cpp:259
    #3 0x55c0e313cd7d in QSignalSpy::QSignalSpy<void (QAbstractItemModel::*)(QModelIndex const&, int, int, QAbstractItemModel::QPrivateSignal)>(QtPrivate::FunctionPointer<void (QAbstractItemModel::*)(QModelIndex const&, int, int, QAbstractItemModel::QPrivateSignal)>::Object const*, void (QAbstractItemModel::*)(QModelIndex const&, int, int, QAbstractItemModel::QPrivateSignal)) (build/tests/auto/gui/itemmodels/qfilesystemmodel/tst_qfilesystemmodel+0x83d7d) (BuildId: b2e416794e25fdb925a191cc4a5efe3cb04efb0e)
    #4 0x55c0e30eccac in tst_QFileSystemModel::prepareTestModelRoot(QFileSystemModel*, QString const&, QSignalSpy**, QSignalSpy**) tests/auto/gui/itemmodels/qfilesystemmodel/tst_qfilesystemmodel.cpp:392
    #5 0x55c0e30edacf in tst_QFileSystemModel::rowCount() tests/auto/gui/itemmodels/qfilesystemmodel/tst_qfilesystemmodel.cpp:420

Pick-to: 6.7 6.5 6.2
Change-Id: Ia085f9235f3bec252290f4fbe5ea0958f91a5e5a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 5686af295c98a5ed4b0793ad0098cef76f39a2d7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-09 14:25:14 +00:00
Ahmad Samir
b1301fffe9 QFileSystemModel: replace a TODO with QT{6,7}Only
So that it's not forgotten come Qt7.

Amends 19258608e9ea02043ce9b53d4a9c99700ce49c1b.

Change-Id: I323f2d2738a295faa1e118c3ea7c8a5b6c6d0ac7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit ef8e1e5861292514a676c5fed4d670fb6ecb887d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-09 14:25:08 +00:00
Tor Arne Vestbø
9bd3752029 iOS: Compute window level when needed instead of up front in member var
When a popup widget is shown, it's first raised(), and then made visible.
In this scenario, the logic in QIOSWindow::setVisible() to compute the
window level was too late, and we ended up showing the popup below other
popups.

Instead of moving the window level computation earlier, we remove the
member variable and just compute the level when needed, as we do in
the Cocoa platform plugin.

Fixes: QTBUG-126052
Fixes: QTBUG-126044
Pick-to: 6.7
Change-Id: If5dbcdcf0500aed57b725bb8eb636fe076459130
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 0e656164e640ff2aca00e82b51b0f1019fd7802f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-09 11:55:16 +00:00
Tor Arne Vestbø
0ad536d65c permissions: Add note about specifying custom Info.plists
Pick-to: 6.7
Change-Id: I468e93c12b5ae2c51a2690c6f171c3aac76c2c31
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 306847d4a3ebfded9480b35954adc90a1cbc98a7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-09 11:55:13 +00:00
Tim Blechmann
c08c615107 QIcc: fix clang's -Wimplicit-fallthrough
Clang's -Wimplicit-fallthrough is a little stricter than gcc's.

Change-Id: Idf933e19ab2d664885743e5db6c1fbb66c8b615e
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit 05a139d5fb5eb3d652f24ef5ebe28c232b69c6a9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-08 08:52:49 +00:00
Volker Hilsheimer
e4c386b0b7 QJniArray: add deduction guide for direct construction from container
That way,

QList list{1, 2, 3};
QJniArray array(list);

works.

Change-Id: If04f8115c51fce533cb4287bf36841ff0daeb11b
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit f199d4f78d528f7a70170d2469ae4807e4a5e765)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-08 08:52:49 +00:00
Volker Hilsheimer
4ef415825c JNI: clean up SFINAE constraints in QJniArray
Rename the predictate for checking whether a container type has the
required member functions and types to IfContiguousContainer (we
need size(), data(), and value_type members).
And since std::initializer_list always meets that criteria, remove the
constraint from the respective constructor.

Add an IfConvertible predicate to test whether the element type of
an existing array can be converted to the element type of the new
array.

Change-Id: I7e5ba31de9664088b027c277c068c948f2189238
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 468126d34a8c3a2fdd486768f935d13ebe565dd0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-08 08:52:49 +00:00
Christian Ehrlicher
a2b442fef8 SQL/IBase: code cleanup part 5/5
Make some untranslated texts translatable.

Change-Id: I636cdcaff749d6770d82095e4a2381097f83ed2c
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 4b0b41ec3b362715012f8c771b72c4704f8170f3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-08 06:25:15 +00:00
Christian Ehrlicher
2e98bc7ffa SQL/IBase: code cleanup part 4/5
Make sure that QByteArray does not detach when not needed and avoid some
copies by using QByteArray::fromRawData().

Change-Id: I4454a3113c6bd1fe30b404af091f5cc0f904f78a
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 54853352bbeff7ad3ee3b3aa3a90e45de5082e17)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-08 06:25:09 +00:00
Christian Ehrlicher
12b2e08747 SQL/IBase: code cleanup part 3/5
Pass 'const char *' when the string doesn't get modified.

Change-Id: I8b2e06b027362debcd81282dc3123235a7e643a3
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit e623f038f7738c202e745f693458ccb81f9484b6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-08 06:25:01 +00:00
Christian Ehrlicher
fbbd62d90c SQL/IBase: code cleanup part 2/5
The lower bit of the sqltype is used to express NULL values and needs
therefore masked out. Do this before the acutal operations for better
readability/debugability.

Change-Id: I71ee97f4c38241ccc9804562e2826ce9b53567ba
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit fc4750bd753999e9a0787614ac8960e0506075dd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-08 06:24:53 +00:00
Christian Ehrlicher
1c423e57d3 SQL/IBase: code cleanup part 1/5
Cleanup the code by replacing repeated access to sqlda->sqlvar[] with a
temporary (const) ref to enhance readability and avoid repeated lookups.

Change-Id: I716812f4446bac7fb3e92bc6fbb099845836624f
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Andreas Bacher <andi.bacher@outlook.com>
(cherry picked from commit 2a7e28923c5aae99690fc5a32460b3dbb376c4c4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-08 06:24:44 +00:00
Vladimir Belyavsky
7728b53679 cocoa: remove redundant macOS version checking
Since the current minimum supported macOS version is macOS 11 (Big Sur),
we can remove redundant OS version checking and cleanup the code a bit.

Change-Id: If42251cc193e8daae81a73cb25582fa014f2b9a0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 23f6d954ec5a4d9437cad433e957a718aeb9ce49)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-07 14:41:06 +00:00
Tor Arne Vestbø
18375f3bff Promote specific scoping for blacklist-file comments
A standalone comment added before a test case or keyword will
be confusing once more test cases and keywords are added, as
the comment likely doesn't apply to those added lines.

Change-Id: I4e36c1c2ae4547bcffa9df817cd53c64cf66defb
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 2f939540c7a7dac262dd61210351cbd24545ee83)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-07 14:28:47 +00:00
Thiago Macieira
ae44b283a9 tst_QStringConverter: compare pointer distances, not pointers
Strictly speaking, we did want to compare pointers, but char* are
special with QCOMPARE in that the pointed-to strings are compared, not
the pointers. So this wasn't doing what we wanted it to do.

We could static_cast to void* to do it, but subtracting one from the
other also gets us what we want, with simpler code. The drawback is that
if appendToBuffer() ever returns nullptr, we'll print a huge number as
the offset.

Found by Valgrind:
==3769588== Conditional jump or move depends on uninitialised value(s)
==3769588==    at 0x483FEDC: strcmp (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==3769588==    by 0x4C41EB6: qstrcmp(char const*, char const*) (in lib/libQt6Core.so.6.9.0)
==3769588==    by 0x48975D8: QTest::compare_string_helper(char const*, char const*, char const*, char const*, char const*, int) (in lib/libQt6Test.so.6.9.0)
==3769588==    by 0x12B12A: QTest::qCompare(char*, char*, char const*, char const*, char const*, int) (in tests/auto/corelib/text/qstringconverter/tst_qstringconverter)
==3769588==    by 0x10EE94: tst_QStringConverter::invalidConverter() (in tests/auto/corelib/text/qstringconverter/tst_qstringconverter)

Amends c46ee7df57c30c94107df8506d30d8872ffa3baa.

Pick-to: 6.7 6.5 6.2
Fixes: QTBUG-126107
Change-Id: I44265a5eb67e47a59fc8fffd17d64051657af529
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 9d5611dc97979dab1932b07f8cfab367c3872d24)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-07 06:59:22 +00:00
Ivan Solovev
7b08477977 qstringalgorithms: remove unused function declaration
The findStringInsensitive() function was declared but never
implemented.

Amends b347d487048cf36d609dd31952dbef1813b5b0e5.

Found in API review.

Change-Id: I178c7529f21adecaa568ba8da9195c1d5057c88b
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 6c4f7dffec7683fd8b9299a6328921d1f1beb584)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-07 06:59:22 +00:00
Ivan Solovev
f473c321e2 Fix QString::(last)IndexOf inlining conditions
The original patch didn't make it into 6.7, so the conditions should
be changed to 6.8

Found in API Review.

Amends dfe968e9702c740b3522715fa9f0e9a281c92885.

Change-Id: I8ba16370d3b04c6a921539a8f4c70a407c175bf9
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 2e7ac6ecf4eb39aa64b23e7113d78b56435b9150)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-07 06:59:21 +00:00
Marc Mutz
1f34a9b270 QSharedMemoryLocker: make ctor explicit
A QSharedMemory* is not a faithful representation of a
QSharedMemoryLocker, so the resp. converting ctor should be explicit.

Found in API-review.

Pick-to: 6.7
Change-Id: I2267a193868c4d0979f59ed0847a0e4af64ffe76
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit 54a57b1e6a011450bc4549abb98141e2440c3f6a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-07 06:59:21 +00:00
Mårten Nordheim
dbb945fd43 Update public suffix list
Version 903a83ff7bfc3148e3692e09396f9f3bdc9462ef, fetched on
2024-06-05.

[ChangeLog][Third-Party Code] Updated the public suffix list to upstream
SHA 903a83ff7bfc3148e3692e09396f9f3bdc9462ef.

Pick-to: 6.7 6.5 6.2 5.15
Task-number: QTBUG-126060
Change-Id: I96320b5df1a3573ab9198ad412fc1eca55204c02
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit c0d5c1b2fef140a44b6512ee79ba7fb67187a39c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-07 06:59:21 +00:00
Ivan Solovev
1d72f3f935 Fix QByteArray::(last)IndexOf inlining conditions
The original patch didn't make it into 6.7, so the conditions should
be changed to 6.8

Amends 5ea4e27661e1805a6ed01c7a61643f9a50c15d62.

Found in API Review.

Change-Id: Ib8b77e3370685057b09b5eea2d982d3a6b77a1a2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit b3ebfc64d4c6fefde970c18c89e59cef9abc56c8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-07 06:59:21 +00:00
Marc Mutz
462088b115 QSharedMemoryLocker: add missing move SMFs and member- and ADL swap
This fixes clazy-rule-of-three (and -Wpeppe). The actual operations
performed are copied from QMutexLocker.

This code predates the public history.

Pick-to: 6.7
Change-Id: Ieba73502187b32178ec2601e1902ac6b20a8e477
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit a6f1779207958f25abeaa39b03d6459586bc7575)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-07 06:59:21 +00:00
Rym Bouabid
8d907213ef totally_ordered_wrapper: add reset(P) function
The ctor is explicit so there should not be an assignment operator op=.

Changing the assignment to = Qt::totally_ordered_wrapper(ptr) is also
possible but if ptr is nullptr, I have to forward declare a pointer as
follow "T *n = nullptr" and then call Qt::totally_ordered_wrapper(n).
So I think adding reset(P) function is better.

Found in API Review.

Change-Id: I0acfcacc97a43f3cf8bfa65b2b16a65cae95b727
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit dc49d84abc35dfbbc4028a5f86017786cff13ae7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-07 06:59:21 +00:00
Ivan Solovev
814dc9715b Update Qt::compareThreeWay(Qt::totally_ordered_wrapper) overloads to take compatible pointer types
Unlike the old Qt::compareThreeWay() overload for raw pointers, the new
overloads for the Qt::totally_ordered_wrapper didn't allow to compare
wrappers of different (but compatible) pointer types (base vs derived).

This patch fixes it.

Ideally the constraints on operators in Qt::totally_ordered_wrapper
should use std::common_type_t, but we hit a bug in VxWorks that
prevents us from using it, so simply demand that the types are
convertible pointers. For now that should be enough, considering
that Qt::totally_ordered_wrapper only expects pointers as wrapped
types.

Found in API Review.

Change-Id: I9f7184468bea3e1f2944ca5347f0b79eded2f4d3
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit d73bdec05101b34745156c8cd4ea571f1223ad32)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-07 06:59:20 +00:00
Ivan Solovev
e37c0a33a4 Deprecate Qt::compareThreeWay() overload for pointers
compareThreeWay() was supposed to be an operator<=>(), but for C++17.
The idea was that at some point when we unconditionally demand C++20,
people could just replace all the usages of compareThreeWay() with
operator<=>().

However, the Qt::compareThreeWay() overload for pointers is different
from the operator<=>() for pointers, because it is actually using
std::less{} or std::compare_three_way{} to do the comparison, thus
avoiding an UB. This is not bad as such, but can potentially lead to
UB when mass-replacing all compareThreeWay() calls with operator<=>().

To avoid this problem, deprecate the overload, and suggest to use
the Qt::totally_ordered_wrapper together with the respective overload
instead.

Found in API Review.

[ChangeLog][QtCore][QtCompare] Deprecate Qt::compareThreeWay()
overload for pointers.

Change-Id: I9c57871145dc3cb9656d6006db88b48a1553bef4
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit b1ae4334ea11f6942c7ce37a80a3aa98a3447809)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-07 06:59:20 +00:00
Ivan Solovev
e24f931b9f Add Qt::compareThreeWay() overloads for Qt::totally_ordered_wrapper
Provide the overloads as free functions in Qt namespace instead of
making them hidden friends of the Qt::totally_ordered_wrapper class,
because they should replace the to-be-deprecated overloads of
Qt::compareThreeWay() for raw pointers, so they should be
easily discoverable.
Also, we treat Qt::compareThreeWay() as a C++17 equivalent of
operator<=>(), so we need to have an overload for pointers (even
if it takes only the wrapped pointers).

Found in API Review.

[ChangeLog][QtCore][QtCompare] Added Qt::compareThreeWay() overloads
for Qt::totally_ordered_wrapper. These overloads do the comparison
using strict total ordering.

Change-Id: I2b5bc542c546330ca78c6284188c8167136a849e
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit d6e1df3513c7d5b6e93d68583fc4c1febb7bcd85)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-07 06:59:20 +00:00
Tor Arne Vestbø
8e61693bea iOS: Reflect QScreen DPR if UIView has not been added to a UISCreen yet
At QWindowPrivate::init time we initialize the cached device pixel ratio
from the target screen's device pixel ratio. Once the window is created
we then pick it up from the platform window, but at that point the
window may not yet be part of a UIWindow hierarchy with a UIScreen,
in which case the UIView reports a contentScale of 1. Once the window
is shown, the content scale starts reflecting the UISCreen.

To avoid the intermediate step of reflecting a DPR of 1, which also
triggers a warning from QGuiApplicationPrivate::processExposeEvent,
we reflect the window's QScreen DPR as long as it doesn't have an
associated UISCreen.

Fixes: QTBUG-125479
Pick-to: 6.7
Change-Id: I0e038e3c3f0bfff116e0910d24e85cc817c890d4
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 31f9f80ad38177605a3011b6fde70e3a8d536d47)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-07 06:59:20 +00:00
Tor Arne Vestbø
00c17ac63a QAction: Remove duplicated QDebug logic for handling null-actions
We already include the action's address by printing
static_cast<const void *>(action), so no need to include
the additional "0", as that just results in "QAction(0x00)".

Change-Id: I8ce1f5030db146a737fa73bd8f2b86e89401d345
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit a85c336597a80ca96ea745830c0d9776b98c835c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-07 06:59:19 +00:00
Marc Mutz
dbb4a80a29 QCoreApplication: fix a clazy-rule-of-three
The local RAII class was missing the Q_DISABLE_COPY(_MOVE). Add it.

Amends f9035587b98ac5dc9491e642b8ec84470ec03f0e.

Pick-to: 6.7
Change-Id: I19dfa18c301698e45353435b9b77e62332e54c31
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit 199a4535e7e665c656c8e35e3e3fdc5da7e5bd51)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-07 06:59:19 +00:00
Assam Boudjelthia
707388775e Android: private export GenericMotionEventListener and KeyEventListener
Partially reverts ac7f22ed0a4bb25146b87c0f6be54323909ea401.

Bring back the following to qjnihelpers_p.h so they can be exported
as private APIs used to handle event listeners.
* GenericMotionEventListener and KeyEventListener
* register and unregister listener calls

Task-number: QTBUG-118077
Change-Id: I5b9c7073801f0b1305237184bb2ab91678e1b1b1
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
(cherry picked from commit 6b105c54eee069f6ddeeac41d9f93ad533f24586)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-07 06:59:19 +00:00