Commit Graph

68035 Commits (16f95639a15cdfd052abbbdded2ee0265509b408)

Author SHA1 Message Date
Mate Barany 16f95639a1 Initialize the ssl variable in QHttpNetworkRequestPrivate
Address the "A constructor must initialize all data members of the
class" warning.

Found by an Axivion Scan.

Task-number: QTBUG-125026
Pick-to: 6.7 6.5
Change-Id: If78cde6a9c3771eb87e62729523b848f2efc2d83
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 6c755dcdd921431b26d22d499ebebb2a0b7de566)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 15:55:31 +00:00
Mate Barany 04787eef80 Apply the PIMPL idiom to QFormDataPartBuilder
Change QFormDataBuilderPrivate to store a vector of
QFormDataPartBuilderPrivates and pimplify QFormDataPartBuilder such that
it stores a pointer to the QFormDataBuilderPrivate and an index into the
vector. This makes it robust against QFDP::m_parts reallocations and we
can make QFDBP copyable which has the benefit that if the user wants to
"go back" to an earlier part, she can do so by storing the result of the
original part() call by value.

Found in API review.

Task-number: QTBUG-125985
Change-Id: I56e9018e539457e9494751bdb62509f84a680889
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit aca8235c753d673abe7442cdf8b628fe4e05c471)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 15:55:31 +00:00
Alexey Edelev ad748f4641 Manage the <module>_DEFINITIONS transformation accurately
Ensure that -D is not prepended to the special sequences like generator
expressions.

Pick-to: 6.7 6.5
Change-Id: I295c289e3d188780d697ff8c62d8c8fc2df6522c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit ff391b5c17309ca8b7bbbaef9028d8b31b847683)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 15:55:31 +00:00
Joerg Bornemann 11592ad3fc CMake: Fix unity build for gcc < 13
GCC 12 erroneously yields -Wsubobject-linkage in a unity build.
Un-unity qresource.cpp for GCC 12 and older.

Change-Id: Ie3aced2668ec8aae797d89ce28a3e5917a6e8f88
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit a06e54d2c88934f1511768d7254e12e6294e6336)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 15:55:31 +00:00
Ahmad Samir 4865577518 QTemporaryFile: de-duplicate docs wrt. file actually created on open
Change-Id: I64f87a8054d732d006599479bd6cca1be217700c
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 88b7a043cf91d8730331eb43523f1d06cae365b6)
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2024-07-05 15:55:31 +00:00
Alexey Edelev 267a559fa5 Add the missing installation and inclusion of qt base CMake properties
The file was missing from both installation and inclusion.

Pick-to: 6.7 6.5
Change-Id: I3e904071cc28f674750aca38050fbe89d75a585d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 084911a67bde29e49bcb001d593e96fca7836142)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 15:55:30 +00:00
Christian Ehrlicher cfb16f48f0 Tests/QSqlQuery: misc fixes for MsSQL ODBC Server
This fixes some tests for MsSQL Server.

Change-Id: I38b1ce5c8761706cafe63a4969770104e8b07bfe
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 73311fb506834d23ca52daaccaa0901327d3e6c4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 15:55:30 +00:00
Christian Ehrlicher 03e6f3859a SQL/ODBC: properly set SQL_ATTR_CURSOR_SCROLLABLE
Setting a query in forward-only or scrollable mode was done with
SQL_ATTR_CURSOR_TYPE in ODBCv2. Nearly all ODBCv3 drivers also honor
this value but some don't and need the ODBC v3 conformant
SQL_ATTR_CURSOR_SCROLLABLE attribute instead. Fix it by setting both
attributes.

Fixes: QTBUG-126118
Pick-to: 6.7 6.5
Change-Id: I6d974b7b3e94113b0a87f1cc7f8cff0deb53642b
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 730de6fbb09f082f32dfa355502551a0d6b8ae34)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 15:55:30 +00:00
Christian Ehrlicher f7f5795ec7 SQL/ODBC: ignore empty connect options
Don'tprint a warning on empty connect options/when no connect option is
set. This ammends 5a03e5c51b.

Change-Id: I83ba8a34a3c08dc596c81ccb494f50af80f9b57c
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 385c9397712b771e0f2c3f0a6322f0f624f09a8a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 15:55:30 +00:00
Mate Barany cd732aaf36 Initialize the isCompressed member variable in QhttpThreadDelegate
Address the "A constructor must initialize all data members of the
class" warning.

Also, move the isCompressed bool variable next to another bool variable
to save some space.

Found by an Axivion scan.

Task-number: QTBUG-125026
Pick-to: 6.7 6.5
Change-Id: I6f0e789a8188ff141ec7e4e4eb8a1823e8eea0d2
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 13a04975fdc32ead6fe8dc78522e34de065c8908)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 15:55:30 +00:00
Alexey Edelev d4a70a1048 Avoid requiring all Qt targets defined for user projects
When building user projects replace the FATAL_ERROR about the missing
Qt targets with the WARNING and mention that the linking might be
incomplete. The updated check affected some user projects that used
the linking to the versioned targets and our deferred finalizers. If
Qt targets are not propagated to the global scope or not found in the
top-level directories, finalizers might fail to resolve these targets.
Now users will see the warning. The side effect of the missing targets -
missing plugin linking, or incomplete deployment, both use walk libs
results.

Pick-to: 6.7 6.5
Change-Id: I5c68b548122775424909c62f904f887417816fbc
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit b5fa9085146043c9d34025e273b5c9b9918d3db4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 15:55:29 +00:00
Andreas Eliasson 4a087d3e45 Doc: Add note about sortColumn() and sort() behavior
While available in their respective function level descriptions,
add a note about the behavior of the sortColumn() and sort()
functions in the sorting section of QSortFilterProxyModel's
detailed description in order to promote this information
to the reader.

Fixes: QTBUG-125718
Pick-to: 6.7 6.5
Change-Id: Ib7a3c206cd49b446b11063850d294da0811a282c
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 014d2f075ebf811e560aad89a4e8de491e3a179c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 15:55:29 +00:00
Wladimir Leuschner 33c7170fcb QWindowsUiaProvider: Check for empty narrator string
In case of password fields, the narrator may return a emptry QString,
this was not checked when using operator[]. This patch explicitly checks
for an empty string returned by the QWindowsUiaProvider.

Fixes: QTBUG-126822
Change-Id: I9e2c3cfc5fb6dc9a7dd7badff4280f60b24c0a4b
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 1ee349bf9d249ea45bc01c45473db44b9d335eed)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 13:38:32 +00:00
Wladimir Leuschner b64031a6d1 QWindows11Style: Remove frame from ToolButton in QToolBar
Remove the frame of ToolButtons in QToolBar area when not hovered or
selected

Pick-to: 6.7
Change-Id: I11bd7b513871d6d1e0d9bfba761acf061f50e524
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 85c4084331a1049d3e2377f5516cd0d93819ac04)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 13:38:18 +00:00
Marc Mutz d554f36017 QSpan: remove an unused tag type and variable
These seem to have been unused from the initial QSpan commit,
f82cf6333e.

Pick-to: 6.7
Change-Id: Ifa00d042e750145b688a238099506f56f96bad0b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 281044015ff62eaf1473a6fd5f79709b077e19fa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 09:38:42 +00:00
Inho Lee 8d41b5a772 wasm: Revamp QWasmInputContext
1. Use QWasmInputContext by default
2. Use QInputMethodEvent instead of KeyEvent

Todo:
    1. Platform dependent preedit control
        especially when cursor moved with preedit.
        (Tested on Android, Linux, Windows)
        (Firefox still has a problem but it's not clear
        why PointerEvent doesn't happen.)
    2. Apply existing text to inputMethodQueries.
    3. Test on touchscreen devices.
    4. Test on IOS devices.
    5. When dragging selection, freezing
    6. Support context menu

Fixes: QTBUG-107139
Fixes: QTBUG-124932
Fixes: QTBUG-117096
Pick-to: 6.7
Change-Id: Iceb6af3489b3d1195ad58cf8f3deb91275fd1bf4
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
(cherry picked from commit c844a7a5429e74d7cefb9774f288dbaa76fc2bbb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 08:10:29 +00:00
Eirik Aavitsland aba84d1e6b QImage: retain color space also through right angle roatations
The color space meta data was retained through most image conversion
functions, but missed in the optimized code path for 90/180/270 degree
rotations.

Fixes: QTBUG-126575
Pick-to: 6.7 6.5
Change-Id: Icbd5aa71e88b4d2d79b00b3cadfe850e6714637b
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit bea8beef85d1b5a163021ba4a671bbaddcc1738d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-04 16:15:34 +00:00
Volker Hilsheimer bf97701fd8 QJniArray: use comparison macros
Implement comparesEqual, declare the type as QUALITY_COMPARABLE.

Task-number: QTBUG-126150
Change-Id: I5a2371a850525dbf2e29fefa1a6cf85bb9b59cff
Reviewed-by: Soheil Armin <soheil.armin@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit b5ec0f7a4663f201167e856e5534d7fee5314e8b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-04 15:05:11 +00:00
Mitch Curtis 4378364a50 QCoreApplication: give theMainThread an objectName to aid debugging
It can be hard to distinguish QThreads without object names when
debugging.

Change-Id: I42643495344063b7c05c7639dcc15c6600e617dc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit ba13bbd2d32652c8ffeef691c9a2ed3a7a65a82f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-04 04:47:27 +00:00
Li Xinwei 4757bab0a9 CMake: add missing dependencies to QMake_LIBS_<NAME> in pri files
WrapBrotli::WrapBrotliDec depends on WrapBrotli::WrapBrotliCommon.
OpenSSL::Crypto depends on ws2_32 and crypt32 on Windows.

These dependencies are currently missing in generated pri files, because
WrapBrotli::WrapBrotliDec and WrapBrotli::WrapBrotliDec are
UNKNOWN_LIBRARY. Currently only INTERFACE_LIBRARY's
INTERFACE_LINK_LIBRARIES are processed when generating pri files.

Pick-to: 6.7
Change-Id: I45a7ecbbb843adbe3aea7fdc68cec6c794015552
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 4dce218ac400afcb54aa2a85a0b27947fec583cb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-04 04:10:14 +00:00
Li Xinwei a59cfa47cd CMake: Fix QMAKE_LIBS_ZSTD when zstd::libzstd_shared does not exist
qt_find_package() sets QT_TARGETS_OF_QMAKE_LIB_<NAME> to all provided
targets, without checking if each target exists.

qt_generate_qmake_libraries_pri_content() iterates targets listed in
QT_TARGETS_OF_QMAKE_LIB_<NAME>. If a target does not exist,
qt_generate_qmake_libraries_pri_content() trusts it as a library name
and adds it into QMAKE_LIB_<NAME>_<CONFIG> directly.

3073b9c4de adds zstd::libzstd_shared to
the PROVIDED_TARGETS argument of qt_find_package().
When WrapZSTD::WrapZSTD is found but zstd::libzstd_shared doesn't exist,
QMAKE_LIBS_ZSTD now contains wrong content "libzstd::libzstd_shared".

Pick-to: 6.7
Change-Id: Id2a79d6c028a80e53d7b9a6a6d11f436d40dde65
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 56853235458799bbf993fa7f2fa19ecf9bbdae9c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-04 04:10:08 +00:00
Li Xinwei 7150ad74e1 CMake: fix FFmpeg's linker flags in generated pri and prl files
FFmpeg records its library dir in INTERFACE_LINK_DIRECTORIES, its
INTERFACE_LINK_LIBRARIES are library names without directories.

Currently FFmpeg's linker flags in pri and prl files is broken,
such as "-llibavcodec.a" in QMAKE_PRL_LIBS (should be "-lavcodec"),
and "libavformat.a ws2_32" in QMAKE_LIBS_FFMPEG (should be
"-lavformat -lws2_32").

Fix this by enabling qt_get_library_name_without_prefix_and_suffix()
and qt_get_library_with_link_flag() to handle args like "libavformat.a"
and "ws2_32", to produce correct -l flags.

Also avoid adding duplicate "-L" flags in pri and prl files, since all
FFmpeg libraries are installed in the same location.
(Amends 2c49f85380 and
2915921ad2)

On a Mingw static build with static FFmpeg, and FFmpeg libraries isn't
installed in compiler's implicit link directories. Before this change:

// mkspecs/modules/qt_lib_multimedia_private.pri
QMAKE_LIBS_FFMPEG = libswscale.a libswscale.a libswresample.a
libswresample.a libavutil.a bcrypt libavutil.a libavformat.a ws2_32
secur32 libavformat.a libavcodec.a ole32 strmiids ole32 mfuuid
libavcodec.a

// plugins/multimedia/ffmpegmediaplugin.prl
QMAKE_PRL_LIBS = ... -llibavformat.a -lmfuuid -lstrmiids -lole32
-llibavcodec.a -llibswresample.a -llibswscale.a -lbcrypt -llibavutil.a

After this change:
// mkspecs/modules/qt_lib_multimedia_private.pri
QMAKE_LIBS_FFMPEG = -lswscale -lswscale -lswresample -lswresample
-lavutil -lbcrypt -lavutil -lavformat -lws2_32 -lsecur32 -lavformat
-lavcodec -lole32 -lstrmiids -lole32 -lmfuuid -lavcodec

// plugins/multimedia/ffmpegmediaplugin.prl
QMAKE_PRL_LIBS = ... -lavformat -lmfuuid -lstrmiids -lole32 -lavcodec
-lswresample -lswscale -lbcrypt -lavutil

Fixes: QTBUG-126773
Pick-to: 6.7
Change-Id: I71a06c960a4f9b6010fc2847cc08833d58b74e1c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit e154da485e83d2867da391088ea4acb31eef6293)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-04 04:10:06 +00:00
Ahmad Samir 7ad780e6f5 QTemporaryFile: de-duplicate API docs wrt. XXXXXX template usage
Pick-to: 6.7
Change-Id: I6180d82aab65788b897df4410d13e68f221193cb
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 6ccdb030ae8c604e6674d406036ad980f7767e45)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-04 02:30:25 +00:00
Ahmad Samir b7170f97d4 QTemporaryFile: de-duplicate API docs wrt. default file name template
This also fixes a discrepancy in fileTemplate() API docs.

Pick-to: 6.7
Change-Id: Ie36278417406848db2a9759e996ce98b87d19f89
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 7fc2eae710c885e5152ed37c75fe6993c36c7171)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-04 02:30:20 +00:00
Ahmad Samir 9bccfb80bb QTemporaryFile: de-duplicate API docs wrt. note about rename() method
Pick-to: 6.7
Change-Id: I57bcf0b40785fd15aba0790673e7723b132f587c
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit bf8fb9c3d94bfa9dcb3d0b181663bab245650ab3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-04 02:30:18 +00:00
Marc Mutz b0e9c0d740 QVersionNumber: add missing size check for comparesEqual()
The whole point of separating comparesEqual() and compareThreeWay() is
that the former can fail faster than the latter.

To wit: segmentCount() is an inline operation and, for the common case
of SSO storage, a single byte read. compare(), OTOH, is an out-of-line
call.

So compare the segmentCount() before calling compare().

Amends ecb0878cbc.

Change-Id: I3e46e73d4b8827532cc16428ca5e7f25bfa8608e
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 9bd3d39b3fe2d760b9c484663bdc6c863a68e22e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-03 23:28:55 +00:00
Marc Mutz a2d858febf QtDBus: don't detach in registerComplexDBusType()::Hash static destruction
The old code's use of ranged-for loop over a QHash would trigger said
QHash to detach. We don't require a detach here, so avoid this
unnecessary program shutdown slowdown using std::as_const().

Possibly-related: remove the pointless std::move() around QMetaType
passing - QMetaType is trivially copyable.

Amends 1697fbdf05.

Pick-to: 6.7 6.5
Change-Id: I7b8d404e93ae4dde71a30e22e9e2f56a4b5354fb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 167382beaad38fd7cbd9764abe76055544e61c20)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-03 23:28:49 +00:00
Marc Mutz a22ae96ab9 QDBusSignature: de-inline the default ctor
It used to merely default-construct the QString member (which is just
zero-initialization), but since we discovered that we need to set
m_signature to empty instead of null, it's doing too much for inline
code (temporary QString (atomics), compile-time), so de-inline.

Amends ed6d1fa71a, but since this is
adding a new symbol on non-Windows platforms, only pick to unreleased
branches.

Change-Id: I610dad86ac4a080f5a45495ebc9536aa1d0bcbea
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 271876bbcecedccf66179bc46c26e78d04732d6c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-03 23:28:43 +00:00
Marc Mutz 9cc1825c0b QDBusSignature: fix default ctor to not allocate memory
The QDBusSignature default ctor is noexcept since
49f7281d36 (Qt 5.5-ish), so detach()
(which must needs allocate memory) cannot be used without breaking the
contract.

Fix by assigning ""_L1 instead, the canonical way to access the shared
empty state. While fromLatin1() isn't noexcept, fromLatin1(""_L1)
never throws.

Amends ed6d1fa71a.

Pick-to: 6.7 6.5
Task-number: QTBUG-124919
Change-Id: I5f0c3bdc199998deaa22971a60388f8f3ed0eaa8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 11dbf821942dbda6e53d7bfcf378904318634196)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-03 23:28:36 +00:00
Christian Ehrlicher 5910dd7fe0 Testlib: remove no longer used function call
QBenchmarkEvent::nativeEventFilter() was changed with Qt6 but the old
Qt5 version was still there and no longer used.

Pick-to: 6.7 6.5
Change-Id: Ia740ce0dc743666c9b3bcbe12d1d310fb9ffcd7b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit ef215fdd8bd36c0312d657e0aafaa766d7c297f7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-03 20:12:03 +00:00
Christian Ehrlicher 3a32bab2aa Fusion style/QProgressBar: don't ignore the paint offset
The progress bar drawing only works correct when the topLeft corner is
at 0/0 therefore we have to translate the painter to fix the drawing in
such a case.

Pick-to: 6.7
Task-number: QTBUG-126426
Change-Id: I51086dab65cc0d4a360ee539e59e3f3f4af2a375
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 369b5a3194f69072a961283c4d5e19395e0d8b06)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-03 20:11:59 +00:00
Christian Ehrlicher d69c8fd98a Tests/QComboBox: use QTRY_COMPARE instead processEvents()
Use QTRY_COMPARE instead QCoreApplication::processEvents() to make
sure the event is really delivered.

Pick-to: 6.7 6.5
Fixes: QTBUG-62970
Change-Id: Iacacc912ec890d231f6e32feae436d0e3db23ddc
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 7afe277914f9ba7cc5940b474113ecb8842503c5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-03 20:11:57 +00:00
Thiago Macieira bcfa650ced QUuid: simplify the three-way comparison functions to make them constexpr
While retaining the old sorting order, this allows us to simplify the
ifdef'ery and produces much better code.

With Clang, an equality check is
        vmovdqu (%rdi), %xmm0
        vpxor   (%rsi), %xmm0, %xmm0
        vptest  %xmm0, %xmm0
        sete    %al
in C++20 mode.

GCC generates four 64-bit loads instead of using vectors:
        movbeq  (%rdi), %rax
        movbeq  8(%rdi), %rdx
        movbeq  (%rsi), %r8
        movbeq  8(%rsi), %rcx
        movq    %rdx, %r10
        movq    %rax, %r11
        movq    %r8, %rdx
        movq    %rcx, %rax
        xorq    %r10, %rax
        xorq    %r11, %rdx
        orq     %rdx, %rax
        sete    %al
(the four MOV in the middle don't seem necessary)

For the sorting case, the compilers need to generate extra code
because of the check on the variant, something I'm scheduling for
removal in Qt 7.0. For long-term sorting code, both GCC and Clang
generate four 64-bit load-and-swap-endianness instructions, but Clang
for some reason also kept the 128-bit vector code (I'm guessing it's a
minor optimization bug that will be corrected in due time).

Change-Id: I46feca3a447244a8ba19fffd17dceacc8e528c3e
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 15f753ca5a60b5273d243f528978e25c28a9b56d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-03 19:34:09 +00:00
Tor Arne Vestbø 079b8b16d2 tst_qmakelib: Account for test directory with spaces in system() test
Change-Id: Icb695fe40de9d72524c191c0d593c8f2ab746790
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit da3997af0d87aa8ebe25a195c08130f69c6b19e5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-03 18:57:34 +00:00
Volker Hilsheimer c6a2d3155c Mac style: remove appearance observer
We have one in the theme already. If that observer gets called we update
the palette from the system, and let the style polish the palettes. So
we can clear the cached cocoa controls when the palette gets polished.

Change-Id: I1dcfba67ca0d60f79741c0a0cf0d07c9fd217a9e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit cb9f5b5d0a538e69dbb099c5c8069fa8716e03cf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-03 15:03:12 +00:00
Oliver Wolff 24f26ca9bb windeployqt: Fix typo in mkspec detection
When adding support for ARM64 hosts a typo sneaked into the mkspec
detection. This typo broke deployment for mingw builds.

This patch amends 81984807b3

Pick-to: 6.7
Fixes: QTBUG-126775
Change-Id: I37ee3617dc6b92520250da3ff0665ce06cea1cb8
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
(cherry picked from commit 3b789ed01e1efead3538b7cdc08f456e55f1d882)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-03 15:03:12 +00:00
Eirik Aavitsland 95101d4e50 CMake: Make baseline tests standalone projects
Just as was done earlier with the autotests (in commit
8450ab8dec), add the boilerplate
standalone test prelude to each baseline test, so that they can be
opened with an IDE without the qt-cmake-standalone-test script, but
directly with qt-cmake or cmake.

Boilerplate was added using the following scripts:
https://git.qt.io/alcroito/cmake_refactor

Change-Id: Iaf3d490211c5f3404bcc31f4dd0a6c02821f4232
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 5d1ded3359ee8bffa33a4b83d5e72b855d61dcc2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-03 11:42:45 +00:00
Volker Hilsheimer f715325932 Document in a test that mixing connect/disconnect syntax doesn't work
We cannot go from member function pointer to method index for slots (we
can for signals), so using string-based syntax to connect and PMF-syntax
to disconnect doesn't work, and vice versa.

Document this in a (partially failing) test, and add a warning to the
relevant QObject::disconnect documentation.

Task-number: QTBUG-126580
Task-number: QTBUG-126581
Change-Id: I4b17662aa9aa7b624049c5b0a3b046ed35230f05
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 27a3229626249a100d8e6fa495927715aba6963d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-03 06:02:34 +00:00
Mårten Nordheim 0fb43e4395 HTTP2: Delay any communication until encrypted() can be responded to
We have the encrypted() signal that lets users do extra checks on the
established connection. It is emitted as BlockingQueued, so the HTTP
thread stalls until it is done emitting. Users can potentially call
abort() on the QNetworkReply at that point, which is passed as a Queued
call back to the HTTP thread. That means that any currently queued
signal emission will be processed before the abort() call is processed.

In the case of HTTP2 it is a little special since it is multiplexed and
the code is built to start requests as they are available. This means
that, while the code worked fine for HTTP1, since one connection only
has one request, it is not working for HTTP2, since we try to send more
requests in-between the encrypted() signal and the abort() call.

This patch changes the code to delay any communication until the
encrypted() signal has been emitted and processed, for HTTP2 only.
It's done by adding a few booleans, both to know that we have to return
early and so we can keep track of what events arose and what we need to
resume once enough time has passed that any abort() call must have been
processed.

Fixes: QTBUG-126610
Pick-to: 6.7 6.5 6.2 5.15 5.12
Change-Id: Ic25a600c278203256e35f541026f34a8783235ae
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit b1e75376cc3adfc7da5502a277dfe9711f3e0536)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-03 06:02:32 +00:00
Ahmad Samir 4d9bedc97b QString: move empty "before" note to the relevant replace() overloads
Amends 3e56757d651ffcba9ea65aa990b4e02b05e00b17.

Pick-to: 6.7
Change-Id: I91a59a8b9e3abfeb14272554d5ca0833141ff2ee
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit d16f4cf826d25a7fd1e8c617e4cafaf7cc9a2711)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-02 19:43:55 +00:00
Jan Moeller 2bc0647805 iOS: Always insert created a11y elements to the cache
By having all known a11y elements in the cache, the iOS Screen Reader will
stay up-to-date with the UI elements that are currently present.
Do ensure this behavior, the ctor is made private.

Fixes: QTBUG-126622
Pick-to: 6.7
Change-Id: I23452ffd60128889a49e5844a6fc17d45683cee5
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 9a6c32bed15ed3aa13ff82e15ac6834d6e7bdc3b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-02 17:04:15 +00:00
Ivan Solovev 916ce646b7 Rename QIdentityProxyModel::isHandleSourceLayoutChanges()
... to handleSourceLayoutChanges(), as this is more in line with the
Qt naming guidelines.

Amends 675b4f63fe.

Change-Id: Iea515693337b8b5332df192191bd9ec3e6cdd65c
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit ae7a8c84b0c65696ca6eda188bb54a50d8ef6e28)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-02 17:03:45 +00:00
Joerg Bornemann 2e58e04c75 CMake: Set CFBundleDevelopmentRegion from QT_I18N_SOURCE_LANGUAGE
The value of QT_I18N_TRANSLATED_LANGUAGES is reflected in generated
Info.plist files. We should do the same for QT_I18N_SOURCE_LANGUAGE.

Pick-to: 6.7
Fixes: QTBUG-126790
Change-Id: Id9d680a183047942585e00f5d8cf1ac3c2352c9f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit ea435bb12766fea1a20cfdf67b8433593d20aeae)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-02 17:03:40 +00:00
Liang Qi 38ce3c67be Revert "QGestureManager: use gesture owner target if topLevelAt returns nullptr"
This reverts commit 10c3dd87d3.

QtWidgets depends on the old QApplication::topLevelAt() behavior too
much, especially for the single top level window case. It's not easy
to be decoupled in this way.

Task-number: QTBUG-113404
Task-number: QTBUG-125878
Task-number: QTBUG-126313
Pick-to: 6.7 6.5
Change-Id: Ica9753bfc85f54ef24ff3db12ea954b06b50b1f0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 04b8b61ce56d552c1240a8f5e3f089edc7b56f52)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-02 17:03:39 +00:00
Wladimir Leuschner 2a10643d44 QWindows11Style: Change appearance when Button is disabled/hovered
Fixes: QTBUG-126503
Fixes: QTBUG-125781
Pick-to: 6.7
Change-Id: Ib3e1ff2cab2c82c04445d238861766dd93237ce0
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 3aca4589b06c6614538c9d96cd1c38e548499e82)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-02 17:03:37 +00:00
Eirik Aavitsland a6e399251a Doc: Add basic info about icon engines to QIcon
Some of the function doc refers to icon engines, but the concept was
never properly introduced. Also explains why order of adding icon
files matter.

Task-number: QTBUG-125772
Change-Id: I342d3d90e3cb58f0c12b205a226aaf78b2136dac
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 17bf4cd98084ff882bdddb1bd55a9ee52613b4bd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-02 07:20:13 +00:00
MohammadHossein Qanbari 4b7ad06dc4 Gtk3 Theme: Fix disabled colors for texts
Previously, disabled text colors were a darker version of the normal
text color. However, when the text color is black, the darker version
is also black, making the disabled text indistinguishable from the
enabled text.

To fix this issue, a source struct called `MixSources` has been
implemented. This struct contains the mixing sources. For disabled
texts, a mix of the background and text color sources creates a more
sensible appearance, making the disabled text look more like the
control's background color.

This solution does not require access to the system's color scheme, as
the disabled color depends only on the background and foreground colors.

Fixes: QTBUG-123449
Pick-to: 6.7 6.5
Change-Id: I469e4fc05ddd4851120b89646bd7ab17a3ee2c00
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 21a070052716c8ce1c471817b985f43e5b19af0c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-01 23:23:47 +00:00
Jøger Hansegård 267e378d14 Simplify VARIANT handling using a QComVariant RAII wrapper
The QComVariant RAII wrapper automates lifetime management of VARIANT
structures and elements that it contains. For example, it will
call IUnknown::AddRef if a COM interface is assigned to it. It will also
clear all held resources at destruction.

Task-number: QTBUG-126530
Change-Id: I543d236293d25cbc70ff25046e553351eccfb850
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 717580c1985dd0804363bafb8822f82dacfb3f90)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-01 23:23:47 +00:00
Jøger Hansegård 51f7513bc0 Replace bStrFromQString with a QBStr RAII wrapper
This makes transfer of ownership explicit. The code is from ActiveQt.
If this patch is accepted, it can be removed from ActiveQt.

Task-number: QTBUG-126530
Change-Id: I613004ba784f87a9b935b2bbaead2205243c3033
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 93686386c078e2be03fb8bc42dee60a9e36fc23f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-01 23:23:47 +00:00
Jøger Hansegård f5ff1096ec Use ComPtr smart pointer to make transfer of ownership explicit
With ComPtr, transfer of ownership is explicit in the code because we
see the 'Detach' function being used.

Task-number: QTBUG-126530
Change-Id: I815c22f21b4a9b174d0d49ceb014bbffe41b6e82
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit d7edf2894c94271c3794a85ecf24a24ce92d2fcd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-01 23:23:47 +00:00