65539 Commits

Author SHA1 Message Date
Axel Spoerl
16ab2eba72 tst_QMessageBox::staticSourceCompat(): improve diagnostic output
The test function casts QMessageBox::StandardButton variables to
integers, to pass them as arguments and verify expected buttons.
In case of a test failure, this makes it hard to figure out, why a test
was failing.

Add a local macro to cast int values back to the enum before calling
qCompare(). That way the enum keys will be displayed in the logs.

Task-number: QTBUG-118489
Pick-to: 6.6 6.5
Change-Id: I23e766d5026cff3e4775db56e58f808809709e4c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit fd710fbba3d24f6192625f586eea57309630f8ac)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-22 10:06:03 +00:00
Morten Sørvig
5491198cbd wasm: actually save dropped files to /qt/tmp
We were reporting the correct url, but saving to the
root of the file system.

Change-Id: I3e1fd63efb77dd75ccf7a8f44a3211965fe11be8
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
(cherry picked from commit 5b53f9b3f8e5f0b642e9e9c48cd7574f23e77233)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-22 10:06:03 +00:00
Morten Sørvig
564e1748f2 Compile with getOpenGileContent() API changes
getOpenGileContent() takes a parent now, and the compat
API is behind a QT_WIDGETS_REMOVED_SINCE(6, 7) which
the manual tests can't access.

Change-Id: I81784baed178bb8efd1a848d32c9ee4510971e26
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
(cherry picked from commit 63a00ef2c09f11c9aec291cf1ab0f01d13b840bd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-22 10:06:03 +00:00
Morten Sørvig
2a57d5b592 wasm: update manual test to handle dropped files
Verify that the file is saved correctly to the local
file system by loading it and printing the sha1 of
its contents.

Also add indents in order to improve legibility. The
output lines should now be correctly nested.

Change-Id: I698c016253656aef29f04129da5f01a9dc35191e
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
(cherry picked from commit a2294287ad3edd729f165280a71b8dd7a5345b1d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-22 10:06:03 +00:00
Krzysztof Sommerfeld
6a35538d3d Exclude VxWorks from trash bin tests
The XDG trash bin code in 6.7 onwards doesn't compile because VxWorks is missing the POSIX at-file system calls and we're working with WRS to find out more. Currently there is ongoing request to add this and more POSIX system calls.

Task-number: QTBUG-115777
Change-Id: I83fd2ab7130362c06c694195e7b33b6ba8011101
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 9735b105588d74c47d4195d367bcac89d3472643)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-22 10:06:03 +00:00
Volker Hilsheimer
1c92de3944 Doc: fix QStandardPaths::displayName qdoc warning on macOS
The function definition at the location of the documentation is not used
on Q_OS_DARWIN, so qdoc cannot tie the documentation to it, leaving
broken links and qdoc warnings when building the documentation on
macOS.

Fix this by explicitly specifying the function that's being documented.

Change-Id: Icf2ad1eba9e9ec8cbeea3818b414f740fa31083f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Safiyyah Moosa <safiyyah.moosa@qt.io>
(cherry picked from commit f63e5318261de755dfeb3d8faedc52333a37c96d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-20 02:53:31 +00:00
Tor Arne Vestbø
2804455965 tst_QWidget::renderInvisible: Use QImage::Format_ARGB32_Premultiplied
The test renders QCalendarWidget, which ends up in the QStyle code
eventually. On macOS we use a CGContext to draw the native style,
into the test's image/paint device, but CGBitmapContextCreate does
not support QImage::Format_ARGB32. It needs either a premultiplied
alpha, or no alpha at all.

The unification of the palette for the calendar, as is done for
Windows, is also needed on macOS.

Change-Id: I5b26e5434b84e4b14eb8784875b76810e0a14230
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit a5292ad2f58252f392ad272f8c99a31c43d175a8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-20 02:53:30 +00:00
Mårten Nordheim
590e1c9cdb invokeMethod: std::forward universal-ref argument
Spotted in API review

Change-Id: I4ab660bb9955176f40b4123e775d65c17edbeeb8
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 99da7c23c3ef8b2525fc570180da017589e840f4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-20 02:07:42 +00:00
Fabian Kosmale
f1bd8bcaba QMetaObjectBuilder: Avoid arithmetic on null pointer
In Prepare mode, "buf" is a null pointer. We never dereference it, but we
still compute an offset from it to obtain a pointer to a (then unused)
QMetaObjectPrivater.
clang's UBSan complains about this, so initialize the pointer to nullptr
instead when in Prepare mode.

Pick-to: 6.6 6.5
Change-Id: Id9d78058f72bb1b44440d07f565374f3eb3c20fd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit d3d224f546d933acef53f7592fea7d69072f7d55)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-20 01:21:19 +00:00
Mårten Nordheim
a338e222cc SignalDumper: protect access to ignoreClasses
It's a shared list that, in theory, can be written to by multiple
threads. Protect it with a mutex.

To make the change in a clean way, move all the .contains() checks
into a separate function so we can simply hold the lock in there.

Pick-to: 6.6 6.5
Change-Id: I99ff185346d52e43a3f59f2910a7b2fa6031e3e4
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit c60db318836cf22b0f00b78ea189ba33fcf7b1c7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-20 01:21:18 +00:00
Morten Sørvig
d7c17432fe highdpi: Update high-DPI in QWSI::handleScreenLogicalDotsPerInchChange
Update m_active early during DPI change to make scaling
calls made during the DPI change use the new value.

The existing call to updateHighDpiScaling() in QGuiApplicationPrivate::
processScreenLogicalDotsPerInchChange() is supposed to
take care of this, however that call is made after
the geometry change event is crated (with incorrect
geometry)

Change-Id: Ia0f6006c90355ec69ef92b88a020089ab21e072d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 454068232eae457c8f62f94b70e17b0ef8b7a74a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-19 22:17:24 +00:00
Paul Heimann
93ddf89037 iOS: Avoid category method name clash for UIResponder
As described in Apples documentation, own methods which are added to
existing classes should be prefixed to avoid category method name
clashes. This prefix was missing from the function
currentFirstResponder() which caused issues when closing the virtual
keyboard on some iOS devices.
(see https://developer.apple.com/library/archive/qa/qa1908/_index.html)

Pick-to: 6.6 6.5
Task-number: QTBUG-119601
Change-Id: I82fb8a8beeb0a3234594357f1e1db67b0ae3da36
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit e51b2d70de65f2ac674afb9c7da2a10c7067f142)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-19 22:16:47 +00:00
Volker Hilsheimer
64c906f59e QFont::Tag: optimize toString by not searching for terminating null
The compiler knows how large the array is, so pass the size and drop
the terminating null.

Change-Id: I5795c89834b8395f04d1777d737d080f19be2a21
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
(cherry picked from commit a73f10aee422bbbee22c63ff1c436cb3193938e6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-19 22:16:15 +00:00
Alexey Edelev
f9d97ee04a Force CMake to look for static versions of xcb components
Add the USE_XCB_<component>_STATIC switches that force using the
static versions of xcb components if necessary.

The xcb components needs to be built with -fPIC option, to make the
static linking possible.

When Qt is built staticaly USE_XCB_<component>_STATIC needs to be
passed to the application command line, since in static case xcb
libraries are resolved and linked when configuring application, but
not when building Qt.

Pick-to: 6.6 6.5
Task-number: QTBUG-120769
Change-Id: I274e9cf4a6a111dc87ad84bb7f49cad76a3d364a
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit 6ce6ff1c529a7a4a09f211980cc749c2b3aa0dab)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-19 20:45:08 +00:00
Marc Mutz
004ccc54d9 QCalendarBackend: disable copying
Silences clazy-copyable-polymorphic.

The Q_DISABLE_COPY_MOVE() disables the implicit default constructor,
so bring it back with =default.

Amends aa8393c94fea01a4806b204fd3aa343a4e90666b.

Pick-to: 6.6 6.5
Change-Id: I44f0b19208d3865fb84e277bcaf65d7f4541d368
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit b211d8a8c0196a96b2aa324c9e3d991ae378c7f4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-19 20:14:19 +00:00
Christian Ehrlicher
fb453fe28c Examples/sqlbrowser: improve coding style
Fix the coding style to match the current Qt style.

Fixes: QTBUG-68661
Fixes: QTBUG-120909
Change-Id: I314ca9da8a03727e3e0336a23fce1ce9d065d3a4
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 2690822428deec4f0c08f4d118d69a7c6036369e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-19 20:14:10 +00:00
Marc Mutz
02ba4b14dc QCheckBox: deprecate stateChanged()
[ChangeLog][QtWidgets][Deprecation Notices][QCheckBox]
stateChanged(int) has been deprecated in favor of
checkStateChanged(Qt:CheckState).

Found in API-review. Amends 5a96d13bb5abd5339cf21dd1de7a17152c71f0fc.

Change-Id: I6ff4aa38c2f43622ba4b127420aff83790785455
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 3512fb1ec5ff088772170540c4e91b1886fbea45)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-19 20:14:09 +00:00
Ivan Solovev
15aec9a37d Introduce macros to simplify testing comparison
The problem with the QTestPrivate::testAllComparisonOperators() and
QTestPrivate::testEqualityOperators() functions is that if they fail,
they point into the helper function, but not into the actual test that
called the helper function. This is specially annoying when some test
calls the helper function multiple times.

This patch introduces the helper macros QT_TEST_ALL_COMPARISON_OPS and
QT_TEST_EQUALITY_OPS that wrap the respective function calls together
with the QTest::currentTestFailed() check. If the test has failed,
the macro generates a meaningful debug message with the original file
name and line number.

This patch also applies the new macros to qtbase.

Task-number: QTBUG-119433
Change-Id: Iad709de45e5bf53c82e7afa8e9f51e9275c1e619
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 1353c6f85757ad9d9f77bc754bf16c7fb185df00)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-19 15:53:48 +00:00
Ivan Solovev
84fde7ef2f qfloat16: make relational operators constexpr when QFLOAT16_IS_NATIVE
When qfloat16 uses float as an underlying type, the operators cannot be
constexpr, because operator float() is not constexpr.
However, operator NativeType() is, so we can make the relational
operators constexpr when we are using a native 16-bit float as an
underlying type.

To avoid code duplication, introduce new temporary macros for
constexpr and Q_DECLARE_PARTIALLY_ORDERED_LITERAL_TYPE.
Extend the tests to verify that the operators are constexpr when
native float16 type is used.

Task-number: QTBUG-119433
Change-Id: I001b087d78c398c71b71a504b65c316199dd4792
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit cfc385ce3fc674d48ea2bfbaac6d3f907795b1a5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-19 15:53:44 +00:00
Edward Welbourne
c112981789 Prepare to support taking CLDR data from its github upstream
We've previously used the zip-file form, but that's not been published
for CLDR v44.1 - the advice on the list was to use github
instead. That, however, has ↑↑↑ as a special value for fields, meaning
to inherit from a prent locale. So special-case that value. I have
verified that v44 from the zip file produces identical results to v44
from github, with this minor fix. As it happens v44.1 also produces
identical results.

Pick-to: 6.5
Change-Id: I6eb0aedda7556753cdc83bb9d76652fbb68dc669
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
(cherry picked from commit bcdd51cfae24731a73d008add23d3c1e85bbd8d0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-19 14:38:36 +00:00
Edward Welbourne
cbc3c63633 Make QLocale self-consistent on Windows
The constructor and update() method for the system locale were using
GetUserDefaultLCID(), where query() and the fallback locale first
checked the LANG environment variable, leading to inconsistent results
if the user set the environment variable to something different from
the system's configured locale.

Break out the logic of parsing %LANG% into a static helper, replace
the existing parsing with a call to this and add a helper to get the
right ID to use, possibly via it, using GetUserDefaultLCID() as
fall-back. Drive-by: initialize substititionType in its declaration.
Also look up %LANG% each time we want it; it's not that expensive,
given how rarely this code is called, and client code could change its
value at runtime. Partially inspired by a patch from Wladimir
Leuschner <wladimir.leuschner@qt.io>

Pick-to: 6.6 6.5
Fixes: QTBUG-120961
Change-Id: Ie706c7089bd2b3757a3eab627723ec34a5e2b07f
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit fcd2a219c4c222309152f1ea2a3124ddc17d4ea5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-19 14:38:34 +00:00
Jan Arve Sæther
bb61ff9175 Add Qt::AA_QtQuickDontUseDefaultSizePolicy
This flag should be set in order to opt out of that Qt Quick Layouts
takes implicit (built-in) size policies into account, a feature that was
introduced in Qt 6.7

Task-number: QTBUG-117597
Change-Id: I206cd61534b2103b2c3a9b4abc97fec8c88799d1
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
(cherry picked from commit 4ae537e67c99160f5dcac99f40d03a7921456556)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-19 09:44:42 +00:00
Marc Mutz
7b5df411db QMetaTypeModuleHelper: mark instances constexpr
Static and thread-local objects should be constexpr or constinit if possible.

Task-number: QTBUG-100485
Pick-to: 6.6 6.5
Change-Id: I29088798a50d6278252c9088e7c191c4214b2e5b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 88c3cd6e08c86bfb5bb676ceed4c92344f8ed91c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-19 09:15:35 +00:00
Axel Spoerl
ede7d80b39 Test restored state in tst_QDockWidget::hideAndShow()
4c60a11d8f935abb762a83b0ab99cefa6db3060c had to be reverted, because it
broke restoring the state of hidden, floating dock widgets.

Extend tst_QDockWdget::hideAndShow() to test this functionality.
Blacklist test function on Apple, because Apple machines on CI show
dock widgets with the main window.

Task-number: QTBUG-120191
Change-Id: Ibc6121a99f15f33d62ca0a9376dbe9fafbe20290
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 3195e34742731406a923b545bd85a5a33e970a42)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-19 07:54:38 +00:00
Thiago Macieira
8902ed8f89 QUuid: Fix Id128Bytes alignment on some architectures
This partially reverts eb0abd9789062d95bc62dbbc29b2038dc40472b1 so we
depend on __SIZEOF_INT128__ in this structure, not on QT_SUPPORTS_INT128
so the Id128Bytes union has a quad-word integer as a member at all
times, even in QtBluetooth's removed_api.cpp.

That's required because on some ABIs, the presence of this member causes
the type to be passed differently, usually in registers (we fixed the
stack problem with the alignas(16) in that commit).

The "Itanium Software Conventions and Runtime Architecture Guide" did
the same back in 2001; section 8.5.1 says integers from 65 to 128 bits
are passed "Next Even" and so are aggregates with alignment of 16 bytes.

This rule seems to also exist in the AArch64's AAPCS64[1], which says,
in rule C.10, that the type should be passed in even registers:
 C.10 If the argument has an alignment of 16 then the NGRN is rounded up
      to the next even number.
(NGRN = Next General Register Number)

It's unclear whether this applies to the union type as a whole or to its
individual members. If the latter, then Clang may be buggy.

[ChangeLog][Important Binary-Incompatibity Fixes] The QUuid::Id128Bytes
type had a loose definition that could cause it be passed incompatibly
between functions, in some architectures, depending on whether GNU
extensions were allowed. This is now fixed, but may cause code compiled
with Qt 6.6.0 and 6.6.1 to fail when recompiled with 6.6.2 or later.

[1] https://github.com/ARM-software/abi-aa/blob/main/aapcs64/aapcs64.rst#682parameter-passing-rules

Fixes: QTBUG-119248
Pick-to: 6.6
Change-Id: I6e2677aad2ab45759db2fffd17a86a208f788cb7
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 6f9db71154662a648f19a86ca86585eddbe2f9ce)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-19 02:50:23 +00:00
Thiago Macieira
5cb192ebb3 filetest: add moveToTrash() operation
Change-Id: I76ffba14ece04f24b43efffd17ab43f3f2ecde59
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 89b4a236a4b8310c3bef269414609db3204d0513)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-19 02:50:21 +00:00
Matt Aber
3e29815084 Fix export of QDeferredDeleteEvent, should be Q_CORE_EXPORT
When QDeferredDeleteEvent was declared in qcoreevent.h, it
had Q_CORE_EXPORT. After moving to qcoreevent_p.h, it changed
to Q_AUTOTEST_EXPORT. The correct macro should be preserved.
Noticed that this change was needed to make GammaRay work
with Qt 6.7

Change-Id: I6fab494d9f60b1261edce6f326a3b96467ff7da1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit bc3b18764aabf95a50a65e090863c54b6ac57e3e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-19 02:20:46 +00:00
Aleix Pol Gonzalez
4f9c75901e ibus: avoid a crash when context is not ready
This amends 84cf0e2be54d9ad183db063fd429b792c67edd18

Pick-to: 6.6 6.5
Change-Id: Ia560f785764d4ba0e4aa66943effb9f16a38e699
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Inho Lee <inho.lee@qt.io>
(cherry picked from commit 0d923c2097578682b8553707834ccf52d7cd52e2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-19 00:33:34 +00:00
Ahmad Samir
9e8d939127 QTest: remove static keyword from the new qWaitFor() chrono overload
This is a function template defined inside a namespace, `static` makes
no difference here.

Change-Id: I2eb52b4fb4432c269b2449ae37550bd0be0dbbce
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 85108e1938fad7b6ca1ce267fb10cda5933dbc50)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-19 00:33:34 +00:00
Mårten Nordheim
f6039b08b3 QH2Connection: Fix issue with unity-build/odr
The static function appeared in two places, and in a unity-build
this fails quite visibly.

Change-Id: I60000d01194a2c79ca9c101f2a6d3f77f469f1a7
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Nodir Temirkhodjaev <nodir.temir@gmail.com>
(cherry picked from commit a3a48815cc9430d6f5c736a312ea4ea5c0895205)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-18 21:12:32 +00:00
Axel Spoerl
be4f933c0a Revert "API Review / QDockWidget: Remove const/ref debug operator"
This reverts commit ca2f46c04c26ed4649cb6c2c62d3b2e52cd8d5ad.

Reason for revert: <BIC in 6.6 found by Marc Mutz>

Pick-to: 6.6
Change-Id: Ia5b8849e55ebccb514bc753ce1d31855d91e2406
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit b148a362c36a9b34b0c21c60530353d6bf6b92cb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-18 21:12:32 +00:00
Axel Spoerl
4a45799609 Add missing include in tst_QHttpHeaders
A QMultiMap is used, while only qset.h is included.
FTBFS w/o precompiled headers.

Include qmap.h as well.

Pick-to: 6.6 6.5
Change-Id: I5f6e1d204bfa94cc6a81f6883c7a7b0ee1e9963c
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 84b792fa98b3a21119f16b0cd9443f90b1ad504d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-18 21:12:32 +00:00
Ivan Solovev
b5f1794d4d TestLib: consistently wrap comparison helper macros into do {} while
The CHECK_SINGLE_OPERATOR macro is used inside FOR_EACH_CREF macro,
which, like all other FOR_EACH_* macros in Qt (see qdebug.h or
qmetatype.h), expects its parameter to have a scope or a semicolon.

All other CHECK_* macros are *not* used inside FOR_EACH_CREF, so
they can follow a more traditional approach with the
`do { } while (false)` scope without a trailing semicolon.
This allows to use them in the code like:

 if (condition)
     MACRO(args);
 else
     OTHER_MACRO(args);

In the example above, if MACRO ended with the semicolon, adding
one more semicolon would have discarded the else part of the
conditon, leading to compilation error.

Amends bfb237d19a5319bfa020ad0cefaff72e8d94a9be.

Task-number: QTBUG-119433
Change-Id: I9a7f17416ba7c37a50f022f685b54e2643e4a9e2
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit ecafbc4d5d9a4c12f44de856dec544404c633a6e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-18 21:12:32 +00:00
Ivan Solovev
1b5211a542 Improve documentation of Qt ordering types
Apply some documentation improvements that were suggested before FF.

Task-number: QTBUG-119433
Change-Id: I9b1d83c69821e25ae4cd8db0cbf3fa6d6330a6dc
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit aae6cf8d15837c9a29503d5fdeceb2a4b5befc55)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-18 21:12:32 +00:00
Tor Arne Vestbø
267a34e490 cmake: Improve folder structure for Xcode and Visual Studio projects
CMake has a built in file extension list for "Source Files", that does
not include qml files. We can't extend that file list with a regex,
so we need to add qml files individually as a finalization action.

We also stuff generated files (both auto-gen as well as other generated
files) into a separate source folder, to focus the project on the user's
files.

Change-Id: Ic9a4d9daad088b1874bcf81e75c776537f3ff531
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 06ea3e3994b38e5fe9ac4f33044b0efa1f1be294)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-18 15:39:28 +00:00
Marc Mutz
e5d1c778ad QH2Expected: use Rule Of Zero
It doesn't always pay to be explicit about SMFs. In the present case,
clang-tidy complains that the move ctors of the class aren't
noexcept. It's a false positive, but just removing all the =default'ed
SMFs makes it go away, too.

Amends 0dba3f6b713a657eb3bf2037face72d16253eb92.

Change-Id: Ib641d4eed9e214b41c143b60494e82790da6fda8
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit fab57c25e22239516dec737f2d42a7fccae9d37f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-18 14:49:32 +00:00
Ivan Solovev
ecfdb8b180 QEventLoopLocker: use macro to implement move-ctor
We do have special macros for this case, so use one of them!

Amends c2956f8f7685b624d7693ff644125d0f594c585d

Found in 6.7 API review.

Change-Id: I205966d6f7363abf1a26f59b04555b1a48a4e696
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 26b8e99b1ce616a063fcbd0d67f44ba9e7712f23)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-18 14:32:59 +00:00
Ivan Solovev
f2b9258cdb qcompare.h: fix comment for std lib implementation selection
Amends 4b6f757020382ed157bf6beb572549f05e881359

Found in API review

Change-Id: I9154c6ad0236776054816bcdde03737290a633ad
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit edf92b8e33f896c764c8aac549385f6e46571a0e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-18 14:32:59 +00:00
Mårten Nordheim
0002ba47e6 Http: Start more connections faster after determining network layer
Previously we would more or less wait for the first connection to finish before
initiating more connections. This was just happening by virtue of
calling startNextRequest when a request was finished.

Since we have already determined the preferred network layer, let's just
try to start more connections. In case we are using https this doesn't
make a difference because we will try http2 upgrade first before allowing
multiple connections. Unless, of course, http2 has been disabled.

Fixes: QTBUG-120619
Pick-to: 6.6 6.5
Change-Id: Id3c3be59fd07120bff574d63481119e5ed9eb88a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 88f5fc47ebf558fa72b7b447f8394a0d44b6bf9d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-18 14:32:59 +00:00
Christian Ehrlicher
6224c3b0dc SQLite: Update SQLite to v3.45.0
[ChangeLog][Third-Party Code] Updated SQLite to v3.45.0

Pick-to: 6.6 6.5 6.2 5.15
Change-Id: Ibf37acf5bcee4639766d445991f5265dc78593c4
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 24a95c22fc9f09ca4415946e965615d022704ca3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-18 14:32:58 +00:00
Mårten Nordheim
47ae5f9178 D3D12: Fix warn-on-error for unused parameter
Amends 445fb40081c870c0a9b1c1c3cf27b20fdd36a531

Change-Id: Iee3eaffcb7fbbdb3cec8020ee7c9280d52faa0a2
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 54824e7d2bf1066014f4e6f3bb3c2a9535435779)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-18 14:32:58 +00:00
Laszlo Agocs
273c96a941 Update QRhiWidget API based on review comments
Spell out some API names in enum.

Some functions are now protected.

Remove property for autoRenderTarget.

textureFormat -> colorBufferFormat.

Used "fixed" instead of "explicit" and follow
the above naming, so that explicitSize becomes
fixedColorBufferSize.

Change-Id: I2fd6ad46033313a3febbb8846146021d5dd11010
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit acebb97b58807d1d5910c79209664b21e741a9c5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-18 14:32:58 +00:00
Marc Mutz
256ac39943 QMetaTypeModuleHelper: suppress cppcoreguidelines-virtual-class-destructor
Says clang-tidy:

   destructor of '(unnamed struct at qmetatype.cpp:966:14)' is public and non-virtual
   in file:src/corelib/kernel/qmetatype.cpp line:966 col:14

       static const struct : QMetaTypeModuleHelper

Yes, these classes are polymorphic (because the base class is). Yes,
the destructor is non-virtual (because the base class' one isn't, but
it's also protected, so fine).

But these classes are not used as base classes, so suppress the
warning.

Pick-to: 6.6 6.5 6.2
Change-Id: I75be86bca36a4a0e93d72acb1a0d2fe0dca1c505
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 11d153ae1ce3ce75e76a1fcac7bf99e4cff05716)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-18 14:32:58 +00:00
Tor Arne Vestbø
c7bfee363e macOS: Explicitly show extensions in save dialog if filter is "all files"
Otherwise clicking an existing file in the dialog will not populate the
full file name, which is what you'd expect for a filter allowing all
files.

Change-Id: Ib9a014352d5e567e54f95414e744566615d735d8
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit c53955eaa085b14ef8e5348e951f8cd2cbfa4ea5)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-01-18 10:44:45 +00:00
Allan Sandfeld Jensen
c44caa1eaa Fix FP rasterization on Win-x86
We can not guarantee 128bit alignment on 32bit windows

Change-Id: I16bd3bded16bd29f4cb84b0cdf2671e4d9a19601
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 0e8086887a2c931dc687b3c344ab5004749fa3eb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-18 10:43:10 +00:00
Eskil Abrahamsen Blomfeldt
1b90af74dd Fix build with -no-directwrite
QWindowsFontDatabaseBase::invalidate() was defined inside an
the declaration was not.

Since the font file loader is only protected by
QT_CONFIG(directwrite), we move it out from the previous block
and add an #if for the contents instead.

Change-Id: Iedc02cceb15fe3d25d21b49af1486659a4d6373b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 0d1ac449bbc38aee4341dd47189de901860d7870)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-18 10:16:40 +00:00
Thiago Macieira
96d03949d2 QNetworkRequest: export the static constexpr (inline) member variables
All that is required is that we write the declaration as if they weren't
inline, like we used to for C++98 non-constexpr static members. Amends
090991123dd82796fe956e4153bc26ace22280ca.

This is required with MinGW and happens with both GCC and Clang: when a
static constexpr variable found in an exported class is used in a
context that requires getting its address, the compiler emit a DLL-
importing statement. For example:

 void f(const std::chrono::milliseconds &ms);
 void f()
 {
    f(QNetworkRequest::DefaultTransferTimeout);
 }

Emits with GCC:
 _Z1fv:
        movq    __imp__ZN15QNetworkRequest22DefaultTransferTimeoutE(%rip), %rcx
        jmp     _Z1fRKNSt6chrono8durationIxSt5ratioILx1ELx1000EEEE

And Clang:
 _Z1fv:                                  # @_Z1fv
 # %bb.0:
        movq    __imp__ZN15QNetworkRequest22DefaultTransferTimeoutE(%rip), %rcx
        jmp     _Z1fRKNSt6chrono8durationIxSt5ratioILx1ELx1000EEEE # TAILCALL

Fixes: QTBUG-121135
Change-Id: I76ffba14ece04f24b43efffd17aae1a98071c570
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Reviewed-by: André Klitzing <aklitzing@gmail.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit c09219e946ed3d90349c3638afe304553bf38011)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-18 00:33:55 +00:00
Eskil Abrahamsen Blomfeldt
97dc63861e Fix race condition when destroying Freetype font engines
If a QFont is moved to a different thread (B) than where it belongs (A),
and the font cache is then purged on thread A, the last remaining
reference to the engine will be on thread B. When this QFontEngine is
later replaced with one created on B, we end up deleting A's QFontEngine
on thread B.

This caused QFreetypeFace::release() to be called on the wrong thread and
the face would never be removed from the thread-local Freetype cache in
A. Hence that cache would contain a dangling pointer to the freetype face
which we would later end up fetching.

To avoid this, we make sure the thread-local cache itself increases
the ref count of the face. That way, the only time it will be deleted
on a different thread is when the cache has been destroyed because the
thread has shut down.

If the last reference (except the cache reference) to a face is cleared
on a different thread, we keep it in the cache until later. It will
then be in a "deferred delete" mode and will be deleted as soon as
possible. This is done either when the thread shuts down, when a lookup
causes the "deferred delete" face to be returned, or when release()
is called on any font on the thread (at which point we will purge all
faces that only have the single cache reference.)

Fixes: QTBUG-118867
Change-Id: Ifa07a9cb6f4cd3e783e12a73d8b283e70d6fb474
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 5761dd55c824afb7a7809c7a0d3ce3050b03fe7b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-17 18:07:58 +00:00
Alexey Edelev
4b662e9a92 Allow configuring the qtbase documentation-only build
Use the QT_SUPERBUILD procedure when configuring the qtbase
documentation-only build. This only makes sense for qtbase since we
disallow building it using existing Qt installation. Other repositories
should be configured using qt-configure-module script from the existing
Qt installation and simply run 'ninja docs'.

Fixes: QTBUG-120485
Pick-to: 6.6 6.5
Change-Id: Iafed5c17bea5c61edc239f08045922497215fb73
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 02a556674f0b3f04de5ab09dca53ed8e86a8ba06)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-17 16:56:45 +00:00
Liang Qi
2bcfe080d9 tests: skip tst_QGuiApplication::topLevelAt() on Wayland
This amends 189f9873ae3f23377708fbf9880398fd6a078715 .

Pick-to: 6.6 6.5
Fixes: QTBUG-121015
Change-Id: I66d2a2b0162b9c7b488af840ff5d3a881b657782
Reviewed-by: David Edmundson <davidedmundson@kde.org>
(cherry picked from commit d4f7d2aeabe2e778224d64a65667aa09b9e42a70)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-17 16:56:45 +00:00