Commit Graph

50409 Commits (c802de110bb57b71ab2a91ea14a3d9f533bb415d)

Author SHA1 Message Date
Jøger Hansegård 89ba182737 Use Microsoft::WRL::ComPtr to manage lifetime of QWindowsUiaMainProvider
Using smart pointers for managing COM object lifetimes reduces risk of
introducing reference counting regressions.

Task-number: QTBUG-126530
Change-Id: If487b78eae6403c762205ecc042e8872e3a6b940
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit f51896b74e57459748313af750c013353d013821)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-01 23:23:47 +00:00
Jøger Hansegård 29c32e7cdc Avoid holding static mutex in QWindowsUiaMainProvider::Release
This patch reworks "Fix cache maybe invalid while the signal is actived
from queue" (80f44954f6) and associates
a mutex with the QWindowsUiaProviderCache tables instead of with the
QWindowsUiaMainProvider reference counting. This makes it easier to
switch to using COM smart pointers to manage QWindowsUiaMainProvider
lifetime, where AddRef/Release may be called as part of copying smart
pointer instances.

It is unclear if the QWindowsUiaProviderCache tables can be concurrently
accessed, still this patch maintains a mutex to protect them.

Task-number: QTBUG-106653
Task-number: QTBUG-126530
Change-Id: I2fc3ba6b6666412ebc86461ebc8f008e1fd6a165
Reviewed-by: Pavel Dubsky <pavel.dubsky@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit caa560931929d544ab816de09ba5f23912585ade)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-01 23:23:47 +00:00
Christian Ehrlicher 817404e396 QPA/Windows: Avoid confusing warning about empty QPixmap
A drag'n'drop operation on a screen with a dpr != 1 tries to scale the
(optional) QDrag pixmap. This results in a confusing warning
"QPixmap::scaleWidth: Pixmap is a null pixmap". Avoid it by checking if
there is a pixmap available before trying to scale it.

Fixes: QTBUG-122755
Pick-to: 6.5
Change-Id: I554675b79840e34ddd3f53153b68e913fd333122
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit db328ca975bc63f3baf3d021dcff1ea37fa6b6a0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-01 20:55:49 +00:00
Christian Ehrlicher 369290d639 SQL/SQLite: add check for localtime_r/localtime_s
Add a check for localtime_r/localtime_s to avoid the usage of a sqlite
mutex when a time needs to be converted.

Change-Id: I536497da1938131298c1198db85dab74d6157e35
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit bcfa0102e5910d99263ebb73515cc9d35b818b5c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-01 20:55:49 +00:00
Tor Arne Vestbø 9758c1556c macOS: Track menu bar clicks for popup closing in QCocoaIntegration
A static member in QCocoaMenuBar relies on the app having at least
one QCocoaMenuBar, and also stays around after the qGuiApp has gone
away, potentially leading to a crash.

As a drive-by, clarify the comment and variable name to point out
that we're closing popups on _any_ native menu opening, not just
menus in the main menu bar (NSApp.mainMenu).

Pick-to: 6.7 6.5
Change-Id: Ib14919e317d70e4c76f3d89c78331edb958bf048
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit daad2b28fdb884e6d796ab024bcb962155cf5534)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-01 20:55:48 +00:00
Lena Biliaieva b694c58d5e QHttpHeaderParser: add rvalue-this overload to headers()
Add rvalue-this overload to be called by corresponding
QHttpServerRequest::headers() method.

Task-number: QTBUG-125859
Change-Id: I2b12d2b80614f627c1aca514a10e1e86a2c5b24d
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 5e9212c1069604dd88fef9f0877459abeb87ad27)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-01 20:55:48 +00:00
MohammadHossein Qanbari 88d8e35ccb Use QFlatMap::operator[] when the reference value is needed
The QGtk3Json::save() function does not save the palettes properly. The
bug was occurring as the QFlatMap::value() method returns a copy of the
value stored in the object.

To fix this bug, the QFlatMap::operator[] operator is used as it returns
a reference to the value. Then the update happens on the original value
in the QFlatMap object.

Pick-to: 6.7 6.5
Change-Id: Ib6f9e350f5447027de4d0a8e6cb8a84012ea8990
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
(cherry picked from commit e17245505ea4ae2bdc05608114586bc5fa933d58)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-01 20:55:48 +00:00
Soheil Armin 2aaafce903 Android: Fix duplicate class names when generating QML to Java code
Whe the QT_ANDROID_GENERATE_JAVA_QML_COMPONENTS flag is present the
AndroidDeployQt generates nested classes with the same name as target
and QML module names. When the target name is the same as the QML module
name, the code gets generated successfuly but will fail at compile-time
in the target user project.

With this fix, we detect such cases and fail early, providing a proper
output message

Fixes: QTBUG-125160
Change-Id: I6303d76bc437f7eee806e4429bef81b5fbeb1e27
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit abfeb4542c9107fa40511209d25bc7d0b5db1a8c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-01 20:55:48 +00:00
Tor Arne Vestbø 3cdc9084ba Pass on NSNotification to QMacNotificationObserver callbacks if supported
Change-Id: I167f2e24453a2f2c75b81207f7293c72243f5a7a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit c7c830057589a91cc369375775d018c5057ba46a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-01 17:57:47 +00:00
Tor Arne Vestbø 5fc66f68da macOS: Don't try to bring all app windows to front on macOS < 14
Most QWindows are shown in main(), at which point the app is not
active yet. When the app is then activated by the OS only the key
and main window is brought to the front, leaving auxiliary windows
behind other applications. This differs from the behavior of showing
windows once the application is active, in which case all windows
will end up in front of other applications.

To remedy this, we bring all of the app's windows to the front
when the app finishes launching. But the way we do this fails
on macOS < 14 due to a bug in macOS, where the OS will deactivate
the app as part of activating all windows, resulting in losing
the original key (focused) window.

To fix the immediate issue we skip the workaround of bringing
all the app windows to the front on macOS < 14. Longer term
we should consider other methods to bring all the windows to
the front, e.g. manual orderFront calls, or deferring the
original orderFront that happened when setVisible was called
from main().

Amends b49211c125.

Fixes: QTBUG-126043
Pick-to: 6.7 6.5
Change-Id: Ia9bc07a41daeb9e5b5b3306df08e5d97fa38f96f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 2fcab872bc28b39b549d941ec6bb71bd25f20593)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-01 17:57:41 +00:00
Andreas Eliasson 199f06e31b Doc: Link to QRhiColorAttachment after 'resolve texture'
After mentioning 'resolve texture', link to the QRhiColorAttachment
class to provide more information.

Fixes: QTBUG-126165
Pick-to: 6.7
Change-Id: Ib6af6b238be2c1ee1f3b15ff08e39dc07d69515d
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit c26bf302963e354ef0f2e3e0bb0a6a4f6dbafc22)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-01 07:38:26 +00:00
Andreas Eliasson df192e7874 Doc: Document *QRhi::create() fail behahvior
Fixes: QTBUG-126263
Pick-to: 6.7
Change-Id: Ic01843a5937c1430d24989c2de24023d4c4655ca
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 1d3ca12338bcefe21205fac46a39ce9989995d55)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-01 07:38:25 +00:00
Even Oscar Andersen e596ce1285 Fix use after destruct for QWidgetWindow
The call to destroy() happened in QWindow destructor, after
̃QWidgetWindow destructor had run. This is to late since destroy calls
setVisible which ends up in QWidgetWindowPrivate which accesses
QWidgetWindow.

Calling destroy from ̃the QWidgetWindow destructor makes sure the object
is still alive when setVisible is called.

Tested manually by running the documentviewer demo as
given in the bug

Fixes: QTBUG-126456
Pick-to: 6.7 6.5
Change-Id: I2ca0384c453d59c5ffb9f3588d592701bebf3aa8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 9b99361698219a73ce1b54fe56497560e02b2229)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-01 06:47:36 +00:00
Doris Verria b792b40378 Cocoa accessibility: Make menu items accessible
To make menu items accessible in Cocoa we need to:
1- Tell the accessbility framework that the focused element is now the
popup menu
Since we don't give focus to the popup menu in Qt, we have to work-
around this in the cocoa accessibility framework by sending a
NSAccessibilityFocusedUIElementChangedNotification when the
QAccessible::PopupMenuStart event happens.
2- Ignore the PopupMenu role
In a native context menu in macOS, the expected accessible element
is not the menu itself, but the menu items. That is why we should
ignore the PopupMenu role and directly access the menu items.

Fixes: QTBUG-68465
Pick-to: 6.7 6.5
Change-Id: I6b45fa3c762734274b4288cddeb038018327a4fe
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
(cherry picked from commit b17a8a9b26368ea39d6cec36b39286ff1b307cd2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-30 06:45:05 +00:00
Ali Kianian b0bcb24bad AssetDownloader: Make local qrc files readable in AssetDownloader
* Also warn using qrc resources for preferredLocalDownloadDir

Change-Id: Id2b54bb1053483cf46f1ee1cbbc07250a2520f18
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
(cherry picked from commit 4f53be92642c2c90dca28ca9b7795a0086e557b4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-30 06:44:58 +00:00
Jaishree Vyas 859af49b97 Doc: Documentation for QStringList::replaceInStrings
Added the text as a \note in QString::replace and QStringlist::replace
to make it more visible to the users.

Fixes: QTBUG-63485
Pick-to: 6.7
Change-Id: I519ab079ec86103a768f313cbc5ac625a0170839
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 3e56757d651ffcba9ea65aa990b4e02b05e00b17)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-30 06:44:29 +00:00
Wladimir Leuschner 41df8e68cb QWindows11Style: Respect ItemViewItem foreground color
Fixes: QTBUG-126596
Fixes: QTBUG-126543
Pick-to: 6.7
Change-Id: I39803927259092be98dad02fa286bc92520ce43f
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 7dc67d98976b7de7a34f74c9840d98aa5512d8dc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-30 06:44:24 +00:00
Rym Bouabid da18a576a9 QRandomGenerator: Add destructor
While not needed from the C++ side of things, the missing dtor in
conjunction with the out-of-line copy SMFs is freaking out style
checkers that check for Rule Of Three/Five/Zero, so just =default
the destructor.

Pick-to: 6.7 6.5
Task-number: QTBUG-124643
Change-Id: Ic21e7c0e4f0630d60eaff724e2f9d6897b720164
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit dd7ad8f8ae44e1ad01c370cd4a0558c5e66efeb8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-30 06:43:52 +00:00
Tim Blechmann 250cdbe404 GUI: accessible - silence clang's fallthrough warning
Pick-to: 6.7
Change-Id: I868aee05315e1258a8872137407a0c5132251c71
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
(cherry picked from commit f91aebaa3f2a11b5681d8c9fa18c69d2ddd0da05)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-29 04:55:06 +00:00
Jøger Hansegård 1af3e2bd91 Fix ASAN crash at at startup with Gallery widgets example
It is not clear how this change fixes the issue. Maybe it is bad code
generation by the MSVC 2022 compiler?

Fixes: QTBUG-126702
Change-Id: I56f4be789aa3d1783d6305b59339984c99454bc7
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
(cherry picked from commit aa3e6ab27dacaef339997c85d3859bcf077b6db7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-28 17:13:49 +00:00
Mårten Nordheim fb79071e16 QHttp2Connection: add take- and clearDownloadBuffer
Instead of retaining the data in the buffer forever.
The downloadBuffer function was only added because there may be data
received before there is a chance to connect to the signal. But then
there is no reason to keep it there forever.

Removing the downloadBuffer() function might be an idea at some point
in preference of using these.

Change-Id: I0b66676c8827570c5a25de2a28617880ccd9cf18
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit ff26a209eaac9a9013a0cc41185a38d448af97e2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-28 17:13:49 +00:00
Mårten Nordheim cb8a8afe42 QHttp2Connection: properly count only the active streams
For a function whose only purpose is to count active streams it was missing
a quite important aspect.

Change-Id: I9110949c0f00acc9fb3bc115f7a66e0c0f4502d0
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 3fe9c38053774ea3dd6b20d14dd664dd8464208c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-28 17:13:48 +00:00
Jøger Hansegård c6d6e05aae Fix leak of QWindowsUiaMainProvider instances
Pair up all calls to QWindowsUiaMainProvider::providerForAccessible
with a corresponding QWindowsUiaMainProvider::Release().

This fixes memory leaks when the Narrator application is running
for applications that are recreating UI elements frequently. RAII
ComPtr is not used here because going directly to ComPtr would make
the change harder to review. Switching to ComPtr can be done in a
separate patch.

When the Narrator application is running, we may see that the memory
usage temporarily increases, but it is reclaimed later.

Fixes: QTBUG-126530
Change-Id: I1fd76da5759354633dbf040ba42a007d349264a6
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 0e65cbc82fbd8585a201c7feb16df410078a8cfb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-28 17:13:48 +00:00
Jøger Hansegård a92e3cf301 Add missing release in QWindowsUiaMainProvider::QueryInterface
If QWindowsUiaMainProvider::QueryInterface does not return an interface
after successfully calling QComObject::QueryInterface, it must reduce
the refcount because no client will do it on its behalf.

This reduces slightly the leak rate of QWindowsUiaMainProvider
instances when no Narrator application is running.

The patch also fixes an issue where the returned pointer was still
pointing to a valid object even if E_NOINTERFACE was returned.

Task-number: QTBUG-126530
Change-Id: I96c4f6e8cfcee41e80e49f3fc874e2e0cdfa55c1
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit a9561e15e86d65e732da7f07d712325c8f16d7c9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-28 17:13:48 +00:00
Jøger Hansegård 46b5edec22 Call VariantClear to free BSTR owned by VARIANT instance
This is a minimal fix to reduce leaks of BSTR instances from
QWindowsUiaMainProvider. Introducing a VARIANT wrapper can be done as a
follow-up task.

Task-number: QTBUG-126530
Change-Id: I0c146049644517aca1b6ad7b096833faf5296329
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit a03931095dde102fdfac82e8f6dd874706cadc6f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-28 17:13:48 +00:00
Wladimir Leuschner a821bb2d32 QWindows11Style: Fix darkmode for ToolButtons in Toolbars
Fixes: QTBUG-126348
Pick-to: 6.7
Change-Id: I7088a6ba2395cce8f79f41831cf22475cd85dfe6
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 86bcddac5f68e9f1d163fac75c09ef8bd0502e1e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-28 17:13:47 +00:00
Joerg Bornemann 7477297c87 CMake: Disable unity build for QGtk3ThemePlugin
The sources pull in X includes that don't play well with unity builds.

Change-Id: Ie50aa6663adc45c86d1798872239b256c1803638
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 48e896baf6e317985c33a761048ef18b089ff891)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-28 14:49:01 +00:00
Marc Mutz 70f38f48c1 QFormDataPartBuilder: delay encoding of the part's name to build() time
This is a prerequisite for making QFormDataBuilder::part() return an
existing part instead of creating new parts with the same name
(idempotence), which was pointed out in API review.

Task-number: QTBUG-125985
Change-Id: I642e56cc7cb3562304573930a01aa1aafa817f36
Reviewed-by: Mate Barany <mate.barany@qt.io>
(cherry picked from commit 9503e2c92c2d3b8f5bb9c86274d2430eb0a57880)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-28 09:04:56 +00:00
Marc Mutz aefa427459 qHash(): make 1-to-2-arg adapter a worse match than regular 2-arg overloads
... by adding more arguments, but then constraining that they don't,
actually, exist.

This makes the the signature of a normal qHash(T, size_t) consistently
a better overload (for same T) than the 1-to-2 adapter. It doesn't
solve the problem that the adapter inserts hash functions for types
that were never defined to be hashable (cf. e.g. QTBUG-116076). But
the adapter is already slated for removal in Qt 7, which will solve
the issue, though maybe we can expedite its demise in 6.9.

Add the test from the bugreport to tst_QHashFunctions.

Fixes: QTBUG-126659
Change-Id: Idb3f275f0409652d55b318d56092764371269c06
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 798c23189c7fb73629c1a98361cb1f50446fecf1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-28 09:04:56 +00:00
Ali Kianian d699966713 AssetDownloader Add a virtual method for resolving urls
Change-Id: Ie771fd955e6b44ff4825243791029c4fcea0d493
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
(cherry picked from commit 3e3cf6dca96180a4f86c0780baad93fb29c2c994)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-28 09:04:55 +00:00
Jan Arve Sæther cfc50c7026 MinGW compile fix: Add missing inline keyword
Some compilers are picky about that the declaration needs to match the
definition also for the inline keyword:

qt5/qtbase/src/corelib/io/qfilesystemmetadata_p.h:239:27: error:
'QFileDevice::Permissions QFileSystemMetaData::permissions() const' redeclared
without dllimport attribute after being referenced with dll linkage [-Werror]
  239 | inline QFile::Permissions QFileSystemMetaData::permissions()...
      |                           ^~~~~~~~~~~~~~~~~~~
cc1plus.exe: all warnings being treated as errors

Fix by declaring the function inline, not only at the definition.

Change-Id: I68d1fd2f9952ec3bf54b1ba27461bf1751c9d301
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
(cherry picked from commit b950ec2525af789b3d447218ae62906c2f78f5a5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-28 06:15:16 +00:00
David Faure 7c97e8d2a6 Fix QFileSystemModel::fileName when the index column is > 0
Fixes: QTBUG-27205
Pick-to: 6.7 6.5
Change-Id: I520a9746c8dc2a7e96ee727167915336442b01b3
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 5eba8693bd4df7bd891938a116ee7405bfa778bb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-27 01:31:41 +00:00
Ahmad Samir 7f3b17b3a6 QDirListing: add getters for iterator flags and name filters
Task-number: QTBUG-125859
Change-Id: I2c60503f37db4668c867760e1fcf061cb4e23faa
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit ffc7c4543e6ae3f4c7c520addaa0875e171c2bee)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-27 01:31:41 +00:00
Ahmad Samir db480e8cd5 QDirListing: remove a redundant include
qduplicatetracker_p.h already includes the needed headers
(<set> or qset.h).

Change-Id: Ice8acf12a0ad10b338ee7e330cf22209e11a1142
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 76970116490cd8876d7d1f923611bf7d2a842056)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-27 01:31:41 +00:00
Ahmad Samir 892f75d430 QDirListing: optimize recursive iteration
By moving the "isDir" check to the end of checkAndPushDirectory().
The other checks could be done without calling stat(), depending on the
implementation. E.g. readdir on Linux (and BSD) fills the d_type field
in `struct dirent`, so we know if it's a symlink without stat'ing, but
to know if it's a symlink to a dir, we'll have to stat.

Thanks to Thiago for pointing this out in code review.

Change-Id: Iad9e954413afddfd4eb4890fb475655cda668385
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 104f8b23f236b1abd840eeaa4b82f54412d8a3b5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-27 01:31:41 +00:00
Ahmad Samir 4a501bb51c QDirListing: add some more API docs
Drive-by change: check the return value of QFile::open() to avoid a
compiler warning about [[nodiscard]], and to show users recommended
practices.

Change-Id: Iba55962c8beb008e63ad9da42e611371e7f8a6e1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 834ff5f996aa6f93180e898db13c146a24e1f85a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-27 01:31:41 +00:00
Ahmad Samir 7c663d04d7 QDirListing: add flags to handle entries filtering
By extending IteratorFlag so that it replaces both QDir::Filter and
QDirIterator::IteratorFlag enums, but with better defaults (based on how
QDir/Iterator is used in 15-20 years worth of code in Qt and KDE).

Make the QDirListing(QDir ~~) ctor private, also change it to use
QDirIterator::IteratatorFlags; it will be used to port existing code.

If QDir is ported to use QDirListing::IteratorFlags, instead of
QDir::Filters, a public QDirListing(QDir) constructor can then be added.

Fixes: QTBUG-125504
Task-number: QTBUG-125859
Change-Id: Ide4ff8279f554029ac30d0579b0e8373ed4337f7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit e583c3d5163a5512abac85e32359652e28a053f7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-27 01:31:40 +00:00
Albert Astals Cid 0cbf579ca1 QString::assign: Don't crash when passed an empty range
Pick-to: 6.7
Change-Id: I7c02abeb1bd8fa5a8609f163a5a722c2c236fc2b
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit aa2cfb58089dcf46d14606964e30d1c695b64393)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-27 01:31:40 +00:00
Mate Barany a6e3710875 Disable copy and move operations in TlsKey
TlsKeyOpenSSL has a custom constructor but no other special member
functions. Instead of disabling them in TlsKeyOpenSSL, disable them in
the base class.

Amends 1a0da3ae69.

Pick-to: 6.7 6.5 6.2
Task-number: QTBUG-125026
Change-Id: I54f3ac01f89a21b8665c4d82a8f38dedab9bb5c3
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 05d4740623477eda83c1ce544aeadffba3014806)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-27 01:31:40 +00:00
Mate Barany 9a788df3d3 Disable copy and move operations in QSslContext
The class has a custom destructor, we should handle the other special
member functions as well.

Found by an Axivion scan.

Pick-to: 6.5
Task-number: QTBUG-125026
Change-Id: I172aeb02d81a0f66ab724892d9f938a12f371ffa
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit d8e86a93303244286881d732aa570cb551b230e9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-27 01:31:40 +00:00
Ivan Solovev 0908c2cdc0 QIdentityProxyModel: fix since for the new functions
They were added in 6.8, not in 6.7.

Amends 675b4f63fe.

Change-Id: I4cb84a592dc60d3ca0a8b98c6436b324817d1c55
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 3fccdd541b6aa5f4ef785b3f4b19d215969165c2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-26 22:52:30 +00:00
Ivan Solovev a11d43e423 QAbstractEventDispatcher: restore virtual function order
The commit af6afad3b3 reordered the
virtual functions in the Qt 6 block, which is known to be BiC.

This patch restores the order of the virtual functions in Qt 6 block.
To save some #ifdef'ery, it also duplicates the unregisterTimers()
function declaration in the Qt 7 block.

Amends af6afad3b3.

Found in Qt 6.8 API review.

Change-Id: I30ff670fd89d37ee4261f77d16f1388dff8f6680
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 4f164ca9bc27338056ccf597e1aa00d3c4a1e88b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-26 22:52:30 +00:00
Ingo Klöcker 09548cb710 Fix accessibility of list views with underlying multi-column model
A list view should always expose a table with a single column to
accessibility tools even if the underlying model has multiple columns.
Several functions need to be changed so that they only consider the
model column that was set on the list view.

For a list view logicalIndex() must only consider indexes for the
model column. For valid indexes the logical index is simply the row
because list views have neither row headers nor column headers.

The column count for list views is always 1 (unless the model has no
columns). The child count needs to use the column count of the
accessible table instead of the column count of the underlying model.

child(), cellAt(), selectedCellCount(), and selectedCells() get
separate implementation for list views.

Fixes: QTBUG-33786
Pick-to: 6.7 6.6
Change-Id: I18c604efa2014267bb6e3b68e403e436bdcbc4ce
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
(cherry picked from commit cd00ce4bea6f0386048bd267495433cffe83ab12)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-26 22:52:30 +00:00
Alexey Edelev ea9df2d8df Propagate QT_USE_TARGET_ANDROID_BUILD_DIR value to ABI-specific projects
The android multi-ABI builds should consider the
QT_USE_TARGET_ANDROID_BUILD_DIR value too. Propagate the value to
the ABI-specific projects when building Android applications.

Fixes: QTBUG-126678
Pick-to: 6.7 6.5
Change-Id: Ifada0d1be7b4f11a82758ba0ee6f69051a2d53d5
Reviewed-by: Tero Koponen <tero.koponen@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 1313c5d3601b47d010eea28d6b104538974d212e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-26 22:52:30 +00:00
Safiyyah Moosa a02c49f3de Doc: Fix broken links
This commit fixes:
Broken URL (404): 'https://doc.qt.io/qtcreator/creator-autotest.html' from qtest-overview.html
https://doc.qt.io/qtcreator/creator-autotest.html is replaced with
https://doc.qt.io/qtcreator/creator-how-to-build-and-run-tests.html.

Broken URL (404): 'http://www.opengl.org/wiki/Tessellation_Shader' from qopenglshaderprogram.html
'http://www.opengl.org/wiki/Tessellation_Shader' is replaced with
https://www.khronos.org/opengl/wiki/Tessellation

Task-number: QTBUG-126281
Fixes: QTBUG-126502
Pick-to: 6.7 6.5
Change-Id: Ifda1258a6500adcfa3fe861135ab98082ed2df10
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit 6e0588225dbe2694de35b7059cf533fe105565ae)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-26 22:52:29 +00:00
Shawn Rutledge 6c17ab66cd Include timestamp in QSinglePointEvent debug streaming operator
It's sometimes useful. QEventPoint debug output includes the timestamp;
but for ordinary mouse events, we're often focused on the event itself
rather than its eventpoint.

Change-Id: Ib65922331c8601bbed5aea3ea96c820906c89ef2
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit ac1ee25bcfe812adb9d57ee0b78214d91223fde3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-26 22:52:29 +00:00
Mate Barany d9fc08c719 Add a note to QFormDataPartBuilder::setBodyDevice
If the body is sequential, QNAM::post should be called after body has
emitted finished.

As this is already mentioned in the documentation of
QHttpPart::setBodyDevice it probably won't hurt to mention it here
as well.

Task-number: QTBUG-125985
Change-Id: Iaa29c45b8da41a9af893523ff140afa9a0945f95
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 704362f3dd06798c8c33ce48aa6c71fa3ac4624f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-26 22:52:29 +00:00
Tor Arne Vestbø 1d4654493f macdeployqt: Deploy canbus plugins from QtSerialBus
Fixes: QTBUG-89484
Pick-to: 6.7
Change-Id: Id72184b0bdb45bd099a2c1a85049c0e84ef30d9f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit cc0937877f9fefc1bed03b849ae6d649c2c4e97f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-26 03:16:14 +00:00
Tor Arne Vestbø 2d6a3b89ef macdeployqt: Skip qrc files when deploying QML modules
The logic for deploying QML modules copies the entire QML module
directory, which includes build artifacts such as qrc files.

Pick-to: 6.7 6.5 6.2
Change-Id: I7fa5c4c5247d1e2a04b83bb8f897cb58e417dded
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit a962f45adebbc6ea0c83bc9be3a50da245976a77)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-26 03:15:43 +00:00
Tor Arne Vestbø a8ec0858a5 macdeployqt: Skip dSYM bundles when deploying QML modules
The logic for deploying QML modules copies the entire QML module
directory, which includes build artifacts such as dSYM bundles.

It's unclear why we special case QML resources, as the needs of
a Qt module to deploy its resources goes beyond QML, but that's
for later investigations.

For now let's skip the dSYM bundles explicitly.

Fixes: QTBUG-56590
Pick-to: 6.7 6.5 6.2
Change-Id: I0f87c452ca3f8f58b0b2a407159881cff071eac0
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 35801a6a8c6c5f1e89e5e3132ae103e7a3bf1812)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-26 03:15:36 +00:00
Thiago Macieira 591a9512a2 QFile::moveToTrash/Unix: ensure we try to remove the proper source
We already had code to strip ending slashes, which makes sense if trying
to trash directories. In the case of symlinks to directories, that also
changes from trashing the directory to trashing the symlink. But had to
removeFile() on the same modified path.

Fixes: QTBUG-126621
Pick-to: 6.7
Change-Id: I46feca3a447244a8ba19fffd17dc0b56f2b1c68c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 3302b0cdc15995fb9e70cf9e911d3ab408691b42)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-26 03:15:06 +00:00
Albert Astals Cid 6abe7d05a1 QByteArray::assign: Don't crash when passed an empty range
Pick-to: 6.7
Change-Id: I712725a1bc8c6efb97969676673ac7ca01ef3ee2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit c0afb1ae836b779fbf0b0b60b7c55517e2e2f00f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-25 20:35:25 +00:00
Alexey Edelev d3caab52ef Manage the PrintSupport dependencies on Cups correctly
Add the missing interface include directories to PrintSupportPrivate
and record the dependency on Cups package in PrintSupport if the
cups feature is enabled in UNIX systems. PrintSupport doens't require
the Cups library to be linked, but still rely on it's headers in the
private part.

Pick-to: 6.7 6.5
Fixes: QTBUG-126594
Change-Id: I9409fedc0f1e457ab740a40c18a04e31be074b02
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 30bb15e7bf42a07b49700b6e822513f125d9ed4d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-24 19:40:06 +00:00
Alexey Edelev 0608451392 Set the CMP0156 policy to OLD for Qt calls
We want to avoid using the NEW behavior of CMP0156, since the linking
order we specify matters in several cases, even if this lead to
library duplication in linker command line. Until the NEW policy
behavior with the Qt code is not fully tested we should force the
policy to OLD, and keep the existing behavior.

Pick-to: 6.7 6.5
Change-Id: I61641f499e71a14d90b4d92419a6b916029dbc0b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 9702c3c78b2c16db6a9d0515d7d7698d9b064cd8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-24 19:40:06 +00:00
Eirik Aavitsland b8aa8ec88c Partially revert "QPaintDevice: inline keyword only on a method's declaration in-class"
This partially reverts commit 77f5846d213b8355d369695c68d585d0d5fa47ce.

Reason for revert: caused a link error in Qt for Python.

Change-Id: I0e8034cb35b7b6cfc0f70e1d46d8fb7486c4aae3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 53e44e753b7cfc5c873ef5a1fc577cfb6308d9d0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-24 19:40:06 +00:00
Jarek Kobus 308f80d172 TaskTree: Use QLatin1StringView for s_activeStorageWarning
Change-Id: I7c58fa9e84227a5798359f22c53f3e69bf98dc9a
Reviewed-by: hjk <hjk@qt.io>
(cherry picked from commit 7c3db02ad3753a4dc6bb691588cf1e0b4a89514f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-24 19:40:05 +00:00
Eirik Aavitsland 985bc72f22 Avoid crash in font distancefield computation
A very particular glyph in one particular font would hit an assert in
the glyph path simplification code. It is not clear why this happens,
but at least it should not crash. So instead, this patch makes the
code bail out cleanly, just leaving that glyph empty (invisible).

Task-number: QTBUG-124310
Change-Id: Id3b9c0b03fb82800f029fc718000ee6ca81408f7
Pick-to: 6.7 6.5 6.2 5.15
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit b6f962c87f5084eaf962bfb033b1398f80475120)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-24 12:36:29 +00:00
Allan Sandfeld Jensen 84971028ea Add NEON optimized versions where missing
A few methods only had SSE2 versions, this adds NEON version the last
optimized QRgba64 methods.

Change-Id: I61fc916183a08a7d3c41572af10ca92d73ef831a
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 9612547343098174e2317ded3f52cdab160aa0b6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-24 11:58:14 +00:00
Morten Sørvig b64373a997 wasm: fix handling of invalid EXPORT_NAMEs
Commit a3ab79ec8 fixed the "leading digit" case, but
broke the original "replace invalid chars" case.

Fix regexp usage. Use "^[0-9]" for matching a leading
digit and then "[^a-zA-Z0-9_]" for matching all chars
not valid in a JavaScript identifier.

Change-Id: I2ab2dcb73b201a996c38b0cab55a049eb39d8b2b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit ba42c48dd460110d02b078c1460be0e268624faa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-24 11:58:12 +00:00
Nicolas Fella 016ee800bb QKdeTheme: Fix default value for ItemViewActivateItemOnSingleClick
Plasma 6 defaults to double click. When the default value is read we
get an invalid QVariant. Use the proper default value in that case

Pick-to: 6.7 6.5
Fixes: QTBUG-124481
Change-Id: I4cdbb04ee8f56b48bb6ab66ec6b3cd42bcf1b187
Reviewed-by: David Redondo <qt@david-redondo.de>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 92de89a941e48f5cd95cce40cd997022c3dc0ab9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-24 11:32:26 +00:00
Kai Köhne 16f88076b3 Use SPDX identifier to Wintab attribution
We want to migrate away from non-spdx licenses in LicenseRef.
As there's no license equivalent in SPDX (yet), let's use a custom
license.

Pick-to: 6.7
Task-number: QTBUG-126403
Change-Id: Iaf705af167c63f76fa5c8d732272523a42c3b661
Reviewed-by: Lucie Gerard <lucie.gerard@qt.io>
(cherry picked from commit 5707bb2556108272185b62622354a24be23a7aaa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-24 10:03:44 +00:00
Volker Hilsheimer de23caa4f6 JNI: don't declare namespaces nested into QtJniTypes as inline
Sadly, inline namespaces are resulting in ambiguities. With two
declarations

    QtJniTypes::android::io::File

and

    QtJniTypes::org::qtproject::qt::android::QtWindow

referring to QtJniTypes::android already is ambiguous if `org`,
`qtproject`, and `qt` namespaces are all inline. This breaks the
idea behind Q_DECLARE_JNI_CLASS as a variadic macro that generates types
that we can transparently use as QtJniTypes.

So remove the inline keyword from the namespace declarations. The macro
might still be the way to go, but user code will to either fully qualify
the types, or use `using namespace QtJniTypes::java::lang` to use e.g.
the `String` type without ambiguities.

Types declared with the two-argument overload continue to live
directly in the QtJniTypes namespace anyway.

As a drive-by, break the excessively long lines.

Change-Id: Ie9303e6c9117fb96b3cff31c7df4df92237b5520
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit d1b89671de70ac9ffca52337058e976d86a367c1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-23 03:39:05 +00:00
Christian Ehrlicher ed5435877c QLabel: cleanup QLabelPrivate
No need for std::optional<> here - simply use QPixmap/QPicture::isNull()
instead. Also use non-static member initialization instead
initialization list and cleanup the needed includes.

Change-Id: I255e9e068cff1e66fbaf35be51be64228e48ffac
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 8bd532b1e54e220c81cd742fabaa236b1e7679c4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-22 07:32:39 +00:00
Tor Arne Vestbø 3852a6a779 Don't use _debug suffix to determine if a plugin is built in debug mode
The string based suffix check is fragile, and doesn't account for Qt
builds where the build is debug but we don't suffix the library.

The check was added in 27239f4fcf, where
we started linking explicitly to the debug library in a framework,
in which case we could end up loading both the debug and release
Qt libraries into the same process if we loaded mismatched plugins.

However 7044409c87 removed the explicit
linking, and nowadays we always link to the release version of the
framework library, and rely on DYLD_IMAGE_SUFFIX to switch to loading
the debug libraries, which applies globally to all libraries loaded.

This means we no longer need the _debug suffix check in the plugin
factory loader to account for the logic introduced initially in
27239f4fcf.

And as we now have logic to avoid loading duplicate plugins in the
case of a debug-release-build we can safely remove the check.

Change-Id: I75685afa16a33aa41448f9a369dbefa8539418fd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 195d9f1ce7753a38c4dd871b981749017839227a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-21 21:23:56 +00:00
Tor Arne Vestbø 1364db690a macdeployqt: Treat argument parsing errors as fatal
Passing options such as `-codesign` or `-fs` without an additional
argument would just print an error, but proceed with deployment,
giving the user an app bundle that didn't reflect the intent of
passing the command line options.

We now treat such errors as fatal.

Change-Id: Iff1b3fac3eb8defadea0425dc13996ed80fe3840
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 58615c066707d0c3592e79b5a03f1330e28c64b5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-21 21:23:51 +00:00
Tor Arne Vestbø 67b3c40ae2 QFactoryLoader: Prioritize plugin that matches Qt's build config
In debug-and-release builds (on Windows or Apple operating systems),
we will scan for plugin libraries and find both debug and release
versions of these libraries.

However, we do not end up loading both, thanks to additional logic.
On Windows we rely on logic in QLibraryPrivate::updatePluginState()
that uses the IsDebug metadata of the plugin, skipping any mismatch.

On Apple operating systems, there is logic in QFactoryLoaderPrivate's
updateSinglePath that ties to match the `_debug` suffix of the plugin
with the Qt build config.

As the string matching logic for Apple platforms is fragile we want
to remove it, but we can't re-use the logic for Windows, to ensure
we only load a single copy of a plugin, as the Windows logic prevents
_any_ mismatch between plugin config and Qt config, even for non-
debug-and-release builds (due to the Windows runtime being incompatible
between debug and release).

To solve this we add logic to QFactoryLoader to prioritize plugins
based on the Qt build config, similar to how we prioritize plugins
based on their Qt version if we find two or more plugins claiming
the same plugin key.

Change-Id: I772ba8ae79627e39418ba80107e3729bba8f9ac8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 90773b501795a088762dd540c442a7cd251a5d8e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-21 21:23:49 +00:00
Christian Ehrlicher 1c66b77f52 QLabel: remove private member cachedimage
Simplify the code - member cachedimage is not really needed as QPixmap
has a scaled() function by itself.

Change-Id: I89cc237ef611f8516588e8b2e7b4056845bc6c69
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit cf0c9de6ed6a4edd6e8e21734e975d2554caa74f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-21 19:34:03 +00:00
Santhosh Kumar 755f964364 Skip rendering border for the decoration area of the tree view
The tree view widget draws a border for both the decoration area and
the text that accompanies the first column whenever any background
color is set to the row. The background color set for the row
shouldn't affect the border of the decoration area.

This patch fixes that issue by handling the background draw for the
decoration area separately by drawing the background for the
decoration area without considering the configured borders.

Fixes: QTBUG-122778
Pick-to: 6.7
Change-Id: I308998a29d16c910a5370633e5bff18418c96a44
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 3ca615d9735f7ddb8e2ae5c13e5effd419a56300)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-21 13:34:45 +00:00
Joerg Bornemann c6dd4856ca CMake: Remove intermediate qt_standard_project_setup parameters
This reverts 18afb3bcd0.

Fixes: QTBUG-126462
Change-Id: Icf9555562503b1abd81a6c33ef52c1eae0fc1105
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 445a74de00aadeb3598d3f578a86491a9a2f4bae)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-21 13:01:22 +00:00
Volker Hilsheimer 2a11f4c032 JNI: document QJniArray and remove tech preview tag
Fixes: QTBUG-86231
Change-Id: I0d61352daae3bc6916c8e3e1698962a11a00750f
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 69132dc613c0801ee6505701ab8ebff72586f248)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-21 13:01:21 +00:00
Christian Ehrlicher 485a9213a5 QIcon: fix call to QIconEngine::scaledPixmap()
QIconEngine::scaledPixmap() takes the size in device independent pixels
and therefore it must not be multiplied by dpr here (dpr is given as a
separate argument)

This amends 245bdc8ec31755d6ab38b796014bdcab6a1d17ae.

Fixes: QTBUG-126388
Change-Id: Ib6cb5d07dd40f39749eb27bf8ed170480d10d28a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 6887986bc509374995e5d838fe2a414cc23ee257)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-21 08:29:33 +00:00
Christian Ehrlicher bf1d4023f3 QIcon/QIconLoader: fix usage of scaledPixmap()
QIconEngine::scaledPixmap() gets the unscaled size of the pixmap, not
the scaled one. This is correctly handled by QSvgIconEngine,
QAppleIconEngine, QAndroidPlatformIconEngine and QWindowsIconEngine
but not internally. Therefore fix this here and also make sure the
pixmap with the correct dpr is saved in the QPixmapCache to avoid a
detach resulting in an increased memory usage when the pixmap dpr did
not match the expected dpr.

Fixes: QTBUG-124573
Change-Id: Ic75d7a89dae89da326c72cac326490f49d135fa7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 245bdc8ec31755d6ab38b796014bdcab6a1d17ae)
2024-06-21 08:29:27 +00:00
Tor Arne Vestbø 1a9f4e8413 QFactoryLoader: Clarify how we track the prioritized library for a key
Assigning to a variable named `previous` to promote a library to be the
current/prioritized library is needlessly obfuscated.

Amends 6675e8c942.

Change-Id: Ibdd48cbb5daba60c231f9f71133c3b58d32f7781
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 67bf3f9625c50a2af2d79d85247c1eee5b727682)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-21 00:19:05 +00:00
Albert Astals Cid ffb0a15ea4 Use QModelIndex::data()
idx.data(role) is much nicer to read than idx.model()->data(idx, role)

As a drive-by, mark some QVariants const.

Change-Id: I00c0a5ac311a03095050b2542a5c396a6c1c2c6a
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 319cca2e2b8679bc553e8ebf97505f0625ee1c94)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-21 00:19:04 +00:00
Marc Mutz e2ffa8ddf6 Port tst_QFormDataBuilder to new style [6/6]: picksUtf8NameEncodingIfAsciiDoesNotSuffice()
We don't want to have to rely on QDebug:toString() and the private
QFormDataPartBuilder::build() function for checks, so use the
framework originally introduced by Máté for the the moveSemantics()
test for picksUtf8NameEncodingIfAsciiDoesNotSuffice(), too.

Requires to revert the needles from QString back to QByteArray.

This completes the port away from QFormDataPartBuilder::build() use in
the tests, allowing us to remove the tst_QFormDataBuilder friend
declaration and unexport build().

Task-number: QTBUG-125985
Change-Id: Icae84f54c6f768e097b36b4c4f964eeb6d676809
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit d0b0fe76663a4c7fe007cb66afa936ea7fe3d918)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 23:11:01 +00:00
Mate Barany ff60cb2b42 QFormDataBuilder: make default constructor implicit
Default constructors should be implicit. No Q_IMPLICIT needed.

Found in API review.

Change-Id: Id0ca95102330a345b58bdf5641cf07bae0a8c6b3
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Reviewed-by: Mate Barany <mate.barany@qt.io>
(cherry picked from commit ed1774584d0231fadda0e9197d92ddcdb6bf2ea3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 23:10:02 +00:00
Mate Barany 08fb81fb17 Add missing variable to code snippet
Task-number: QTBUG-125985
Change-Id: I841339818a31253c6c7d444cd4ba2e66e965f3fa
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 90a9ab2a472e5a9c796deb989ce5db2e099c4382)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 23:09:59 +00:00
Thiago Macieira fce7a45268 Strings: get rid of the last std::char_traits use
LLVM's libc++ became pedantic and insists on only accepting
instantiations for one of the standard Char types, so remove all uses of
it with a template parameter.

Complements dc2ae08e02.

Pick-to: 6.7
Fixes: QTBUG-126214
Task-number: QTBUG-122753
Change-Id: I8c5c4dba62924541bfb0fffd17d7d8ddc78338bb
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit ab05e05f60253b9be615c09aa340ee75f2e5bcaf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 22:59:08 +00:00
Hatem ElKharashy 28b9a653ea QTextHtmlParser: parse border color correctly
Use QCss::Declaration::brushValues to parse the values into a list. This
will not only lead to correctly parsing the values, but also prevent an
an assertion from firing when ValueExtractor::extractBorder is called.

Fixes: QTBUG-126381
Pick-to: 6.7 6.5 6.2
Change-Id: Ic6f3d722ffe0d72dcb5faa9916a23c804211ce49
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
(cherry picked from commit a37ca7c85933979351d99f1bb22191763a78de46)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 22:59:08 +00:00
Tor Arne Vestbø f0f9cc602f Let QWindowContainer know when its top level is about to be destroyed
When the top level window that a QWindowContainer is in is about to
be destroyed the QWindowContainer must reparent the contained window
into a dummy window, as otherwise the destruction of the top level
will bring down the contained window as well.

We were notifying the window container about this situation when
the window container was moved from being a top level itself, to
being a child widget, but did not have any logic for other ways
the window container could lose its parent QWindow.

An example of this was when RHI-needs would result in recreating
the top revel with a different RHI backend.

We now have a last minute call to toplevelAboutToBeDestroyed in
QWidgetPrivate::deleteTLSysExtra().

Fixes: QTBUG-126303
Pick-to: 6.7 6.5
Change-Id: I5b14e156956ae76a8f53cac31904eaadee9e791f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 006cbf658ea1f5986bbe1baafa7c146780320661)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 19:30:49 +00:00
Tim Angus 94e8419ed5 Fix WASM QtLoader environment variable warning
There is a function throwIfEnvUsedButNotExported in qtloader.js that is intended to warn the user when they attempt to use environment variables without adding ENV to EXPORTED_RUNTIME_METHODS. (Presumably) through various changes this function no longer works. This change fixes it and adds to the warning to give Qt/CMake relevant advice.

Pick-to: 6.7
Change-Id: Ia04c087d43bfe5ba988e0cf98230d796f1aaa069
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 8e04cb27357ab5dffa3d1fd00a416635c7881bc6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 19:30:46 +00:00
Ahmad Samir 3242676cd0 QDirListing: make the class move-only
Define both move SMF out-of-line, otherwise MSVC complains that the
private class isn't fully defined at the point of destruction of
std::unique_ptr<QDirListingPrivate>.

Both move SMF are = default'ed; GCC didn't show a warning about this
issue... different implementations, I guess.

"partially-formed" docs boilerplate borrowed from other existing
classes.

Found in API review.

Task-number: QTBUG-125859
Change-Id: I98b57a14bd94e407d9bfafa9ef32cf40c978d7df
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 4e32a45d492fb057cc996efc6791030f3dd525d5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 19:30:44 +00:00
Tor Arne Vestbø d69e73b9f9 macOS: Check NSRunningApplication.active instead of comparing pointers
When checking whether the current application was the active one
during launch, we compared the pointers of the frontmost and current
app, but these two can be different even for the same app (PID).

This was not a problem in practice, as the result was just that we
would always activate, just as we did prior to the change that
introduced the code.

We now check NSRunningApplication.active instead.

Amends 6343caae25.

Pick-to: 6.7 6.5
Change-Id: Ib3557e5ea676be5291904aaa444f7ede2160e1fd
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 0255d3a9af69c9accb23f7ac2c08b19bec9dd6a0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 19:30:42 +00:00
Morten Sørvig 0dcdca5127 wasm: saveFile(): copy data before returning
Make saveFile(char *, size) make an immediate copy
of the data also for the case where we use a save
file dialog.

Previously it would make a copy after the file dialog
was closed, but at that point the content pointer may
be stale if the calling code did not keep it alive.

This makes the behavior for the two save code paths
be identical: a copy of the data will be made right
away, before the function returns. This is also the
only behavior which makes sense, since the function
has no way of communicating to the caller when it is
done with the data.

Pick-to: 6.7 6.6
Change-Id: I890a4897f20251e9abbf90d0a4b96d8ba12d3740
Reviewed-by: Even Oscar Andersen <even.oscar.andersen@qt.io>
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
(cherry picked from commit 4b324202433365ff43f623903beefc4286345839)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 19:30:39 +00:00
Mate Barany cd92f7f069 Pimplify QFormDataBuilder
Same will be done with QFormDataPartBuilder in a follow-up patch.

Found in API review.

Change-Id: I863faad8b59ba16ef35b10afd9990c1b82c8634b
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit e763177209a9b50347acae4ddeb9806145385717)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 19:30:38 +00:00
Kai Köhne 48fd0b3807 Use SPDX ID for Bitstream-Vera license
Bitstream-Vera was added to the SPDX database in v3.17 onwards.
So let's use it.

Pick-to: 6.7 6.5 6.2
Change-Id: Ief4b8614d10d1914eb1cc824e7abce789c07250a
Reviewed-by: Lucie Gerard <lucie.gerard@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 672382cd43d9be578c3a27c00c85f1d51338544e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 19:30:37 +00:00
Volker Hilsheimer 8352306cdc QTranslator: fix loading order when loading from locale
A locale's UI language includes the script, e.g. the QLocale::uiLanguage
list for the Australian locale en_AU is {"en_Latn_AU", "en_AU", "en"}.
The old code iterated over each language in the outer loop, and for each
language tried several times, removing a segment from the back with each
try in the inner loop. The de-facto search order was then

en_Latn_AU
en_latn_au
en_Latn
en_latn
en
en_AU
en_au
en

Usually, translation files are provided for country_Territory, i.e.
en_AU. But if an en file (for a generic English translation) was also
present, then en_AU was never tried.

Fix this by breaking the logic into two loops: first, create a list of
candidates by removing segments from each UI Language. Then sort that
list of candidates so that entries with more segments come first. The
search order is now:

en_Latn_AU
en_latn_au
en_Latn
en_latn
en_AU
en_au
en

This way, en_AU gets loaded correctly, before en is tried.

Adjust the test, which was essentially duplicating the logic from
QTranslator to generate files. This only tested that two identical loops
result in the same thing. Instead of using the system locale, make the
test data-driven, and explicitly try en_US and en_AU, with candidate
files generated based on a hardcoded list for each data row.

Pick-to: 6.7 6.5
Fixes: QTBUG-124898
Change-Id: I6bdcff289d2843e61c9053c116e955b79e09e95a
Reviewed-by: Mate Barany <mate.barany@qt.io>
(cherry picked from commit 9a11273b745a30cebb5cd648c89eb224e9704492)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 19:30:33 +00:00
Morten Sørvig 61ad998226 wasm: print error message on missing preload file
We would previously try to json-parse the 404 error
message and then abort with an json parse error.

Throw a custom error instead.

Change-Id: I7240294b2b107cd758f22187ae6f2b1d6923fdd7
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
(cherry picked from commit ce62b60d8590f707a0d011e6b95f1f7c729ba4e1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 19:30:32 +00:00
Juha Vuolle 838a2fde28 Extract Method for escaping name/filename multipart parameters
Task-number: QTBUG-125985
Change-Id: Iab10e7a198d883d66c9862073c737f7e703eddb6
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 14a59bf0bfe7add2b6f5810e49cea77bfe0fba1f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 19:30:30 +00:00
Marc Mutz 36019d9368 [doc] QFormDataBuilder: don't state the obvious
If a function returns a unique_ptr by value, the caller cannot but
take ownership of the payload object.

Change-Id: I0465e4daf42b57aa33203d66fdc3231ae9a88751
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit 3d2a194edd7aa758f3df3b2b853929945dbc6659)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 19:30:28 +00:00
Marc Mutz cb65bbf02b [doc] QFormDataPartBuilder: mark private build() as \internal
It makes no sense to document (non-virtual) private functions.

Change-Id: Ifeed52ea5e9a5b8e358277140419c8d68204a45b
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit 19b7a08fc24c5947fb1ea921e3d24f4efce4d1fb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 19:30:26 +00:00
Morten Sørvig 30786c02d9 wasm: don't make normal-state windows StaysOnBottom
Setting StaysOnBottom creates a special case where
the first window is always kept at the bottom of the
window stack.

However this becomes confusing if the first window
is not maximized or fullscreen, since it's then not
possible to bring it to front by clicking the title bar.

Add a check on the window state, and set WindowStaysOnBottomHint
for maximized or fullscreen windows only.

Change-Id: I0f43874cfcdc7c951c47cd278f5acdd42368cd5a
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
(cherry picked from commit 1d612c5100a02d3d4f9b1caba3489e76ef6a81fe)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 19:30:24 +00:00
Eskil Abrahamsen Blomfeldt 260685d1ee Make it possible to create distance field with specific size
The distance field size calculation is floating point math
and  sensitive to numerical errors. When used in Qt Quick,
it is vital that the allocated memory is the same as what
we calculate in the cache, otherwise we will get memory
corruption. In certain cases, numerical errors would cause
a qCeil() to round what was actually an integer up, and
we would end up with an allocated size that was off by one.

To avoid this, we allow the user to specify the size to
allocate, so that we can do the calculation in a single
place.

Pick-to: 6.7 6.5 6.2 5.15
Task-number: QTBUG-124572
Change-Id: I14e381952fdf331286f1ae4b51bb5fef9e39d704
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit b959b8f5ed537f530221e0174b723ea39a34cd58)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 19:30:22 +00:00
Morten Sørvig 56d0227a73 wasm: prepend underscore for invalid EXPORT_NAMEs
JS identifiers may not start with a digit:

  em++: error: EXPORT_NAME is not a valid JS identifier: `2dpainting_entry`

Change the regex to match leading digits as well (note it is
inverted).

Prepend an underscore instead of replacing the invalid character;
this makes sure we don't create new conflicts between for example
"2dpainting" and "3dpainting".

Change-Id: If78a87e7ed352b88bc99aee7c5829facf1fc35a0
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
(cherry picked from commit a3ab79ec8cab51255b108646f475c5796448d1a1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 19:30:20 +00:00
Łukasz Matysiak fd1066ad41 Force requested permissions when calling mkdir on VxWorks
Calling mkdir with mode == 0 works just fine on Linux - it creates a
directory and the permissions are set to 0.
On VxWorks, calling mkdir with mode == 0 uses the default mode set in
the system.
This leads to a failing test (tst_QDir::mkdirWithPermissions(0000)) and
potential confusion when the same code does not behave in the same way
when called on Linux and VxWorks.

To keep the same interface between unix-like systems, explicitly set the
permissions to 0 when on VxWorks.

Pick-to: 6.7
Task-number: QTBUG-115777
Change-Id: I75e429c086500cb7c19f9bb14693bb4266e18046
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Michał Łoś <michal.los@siili.com>
(cherry picked from commit 90e79aea8e3f297de65a69d4e6c82a5d753b9c86)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 19:30:18 +00:00
Ahmad Samir ea138d7557 QPaintDevice: inline keyword only on a method's declaration in-class
Putting `inline` on the definition and not the declaration could cause
some issues with some compilers, e.g. MinGW[1].

Putting `inline` on a method's declaration and definition is redundant;
I am not sure if that could cause an issue with MinGW, but just in-class
on the declaration is enough/more-idiomatic.

Amends a5953d20e2.

Found in API review.

[1] https://wiki.qt.io/Things_To_Look_Out_For_In_Reviews#Methods item
1.2

Change-Id: Ieaba422670261330b5558f60dce2fcca2cb2723b
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 77f5846d213b8355d369695c68d585d0d5fa47ce)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 19:30:15 +00:00
Mate Barany 4ca0c6db5e Add move semantics autotest for QFormDataBuilder
Change-Id: If9df38f0afd09218c15587b2864edb957cbbdaac
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 12d2ba9c913d03d637ffb9d123949a5f45e69e5e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 19:30:13 +00:00
Volker Hilsheimer 9cb2200d4f JNI: pre-declare JNI classes for standard Java types
This avoids that we or users have to declare e.g. String or Uri in
several places in Qt. This also prevents problems where multiple
declarations (possibly from different headers) cause build errors.

As a drive-by, remove some unnecessary type declarations (e.g.
UriType, which had the same class string as Uri).

To ease the submodule update process, define a preprocessor symbol
that submodules can use to conditionally declare the type locally.
Once the dependency update is through, the symbol can be removed
and submodules can use the declaration from qjnitypes.h.

Change-Id: I7d96edf644a54246302b5c5cb478e66fa615e73e
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 457a1c973d68e705f9cf72ac72b19fc26cdb2917)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 19:30:06 +00:00
Volker Hilsheimer 1adc8648c1 JNI: Allow list of namespace to be passed into Q_DECLARE_JNI_CLASS
Make the macro variadic. For N > 2 arguments, interpret the first
N-2 arguments as nested namespaces that are declared as inline
namespaces. We can then construct the signature string from those
namespaces, so

Q_DECLARE_JNI_CLASS(String, "java/lang/String")

is equivalent to

Q_DECLARE_JNI_CLASS(java, lang, String)

except that with the second overload, the C++ type will be in the
QtJniTypes::java::lang namespace. Since both the java and the lang
namespaces are made inline, QtJniTypes::String still works.

This helps with avoiding conflicts, as there might be Java classes
in different packages, but with the same name.

Change-Id: I0355239e7fc3c91cb26e041f19c4e0853d3678ac
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 2b1312bc954b72f59d0c1d7b1192e2f029016012)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 19:30:04 +00:00
Tor Arne Vestbø a9d3a0b47c macOS: Don't use full screen geometry for popups
The fullscren geometry when an application is in full screen includes
the area above the menu bar. Unfortunately, when clicking on areas of
a Qt popup that overlays the menu bare area we get a callback for
NSMenuDidBeginTrackingNotification, and as a result we close all
popups. As macOS for some reason treats the menu bar area as special
and tracks clicks there even if another window is on top, we should
not put our popups there.

This also matches the geometry of windows shown full screen, which
does not overlap the menu bar area either when using the native APIs
to make a window fullscreen (which we do).

This change does not affect the original issue (QTBUG-39403), as the
QScreen::availableGeometry() nowadays does not exclude the area of
the Dock when in fullscreen mode.

Pick-to: 6.7 6.5
Task-number: QTBUG-39403
Fixes: QTBUG-123298
Change-Id: I5890d7fc7a9b95a98b8fd2b9ce58ed9789e7f36e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 7f63b0fabb3f2ae67596cc061f202ddd77ddf56b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 19:28:57 +00:00
Topi Reinio 3b1d3db793 Doc: Qt Core: Increase warning limit to 2
Technically the Qt Core documentation builds without warnings, but
testing in CI two warnings are observed:

  warning: Already generated qtcore-attribution-extra-cmake-modules.html
           for this project
  warning: Already generated qtcore-attribution-kwin.html
           for this project

These pages come from a qtattributionsscanner-generated source file,
codeattributions.qdoc.

The warnings do not affect the generated output. Increase the
documentation warning limit temporarily to let integrations pass.

Task-number: QTBUG-126546
Change-Id: Ic8641c69b2818c72af72cdc23161314caf376c27
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit cec470561df663a7ea8f0a0ab65fb80b50cacb12)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 19:05:30 +00:00
Morten Sørvig 72dad27a25 wasm: refactor cmake finalizers
Avoid duplication and move finalizer code to a new
function "_qt_internal_finalize_wasm_app", which can
be called from the add_executable functions.

Change-Id: I4859a3999725ebf61a496d78665b6a259dfeb0f5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
(cherry picked from commit 2116c62256bbf1bc3d516430509a93177572d86f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 12:51:33 +00:00
Morten Sørvig c4106cee7c wasm: set embind option in executable finalizer
This prevents setting it more than once, which will
on recent Emscripten versions cause 'duplicate symbol'
linker errors.

Change-Id: Ie6c2ede0569271cf3a02fc993b14bbf27f69ff57
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
(cherry picked from commit 320cb68ce5c0c718c6434adfefa6c7460e3cb08a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 12:51:30 +00:00
Rym Bouabid d06924baef qlibrary_unix.cpp: Make adding 'lib' prefix possible even when the file name starts with 'lib'
Loading QLibrary("library_manager") and QLibrary("lib_example") is not
possible if their binaries are called liblibrary_manager.so and
liblib_examplep.so.

Remove this prefix check: if (!prefixes.at(prefix).isEmpty() &&
			      name.startsWith(prefixes.at(prefix))
,in order to allow calling dlopen() with "lib" prefix added to the name
even if the name starts with "lib".

The drawback of removing the check is that extra dlopen() calls will
take place in other cases such as: "libexample.so". In this case we
will have two extra calls of dlopen() taking "liblibexample.so" and
"liblibexample".

Fixes: QTBUG-23470
Pick-to: 6.7 6.5 6.2
Change-Id: I2c0b1b81edf8253443388aa67d24f4cd64d4123d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 2f11edad9e87311a977cb6edbd908a9fdd86a567)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 09:43:43 +00:00
Mate Barany 7a41956df0 Use fully qualified signal arguments in QDnsLookup
Detected by an Axivion scan.

Task-number: QTBUG-125026
Change-Id: I426ee40d5bfd6c473a90e76d207817596f7aab0f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit ecd38b85dc80f899b685d3c6c031dcabb3c63211)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 09:43:37 +00:00
Mate Barany 766244e033 Use fully qualified signal arguments in QNetworkInformation
Also in QNetworkInformationBackend.

Task-number: QTBUG-125026
Change-Id: I3cc722a9e6db284a393bfddf0dfa4ebbcb6b4d07
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit d9d384b94fba0e15ed7f564309b0fbc48e5f4d7a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 09:43:33 +00:00
Volker Hilsheimer 7225d11156 JNI: don't inherit declared types from JObject
JObjectBase has a protected destructor, but JObject doesn't, so
inheriting from it might result in UB. Declare the Type as an alias to
JObject<TypeTag> instead. Specialize the traits for the TypeTag, and
add a partial specialization of the traits for JObject<T>.

Adjust the return type of the named constructors of JObject.

Change-Id: Ibe74c3cd3b3a2a81779117dd2d228684c365a845
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 691f6b5b0c9dc69f8d019abc53747e7a6bbf6ef8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 06:54:34 +00:00
Sami Varanka 6b2cbb3fd6 Include horizontal scrollbar's size in sizehint
Amends 8c18a245b0

Pick-to: 6.7 6.5
Fixes: QTBUG-123886
Change-Id: I1ae2e29ce12610e10a8c0640458a3812a926c4cc
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 0fa6660352df18134757a9c3f9dd329053e31cab)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 06:54:30 +00:00
Volker Hilsheimer 9b6087b0dd Accessibility: remove compatibility alias for AnnouncementPoliteness
It was only needed to support a smooth submodule update.

Change-Id: I7546b8565bd3f2cb2c5141fc6ea36d1c76f11c48
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
(cherry picked from commit 5ee8ca2e94336e28374308e768f541c58b7725a8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-19 14:14:37 +00:00
Łukasz Matysiak 8f66370ecf Handle VxWorks in QFileSelector
QFileSelector tests fail, because VxWorks is not properly categorized.
Even though it is not a unix-like system, it does provide a
compatibility layer that enables some unix utilities.
It has also been treated as unix on the Qt 5 customer branch.

Solve the issue by assigning VxWorks to the unix category in
QFileSelector and its tests

Task-number: QTBUG-115777
Pick-to: 6.7
Change-Id: Icab80764b66b121995f51ddf149de55dc8c9eb55
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit da5de2926ac9573b13d0d743e43e685cbdb2abaa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-19 14:02:58 +00:00
Łukasz Matysiak 56ec3aa56a Handle VxWorks in QSysInfo
Right now VxWorks is not recognized as a known platform in QSysInfo.
This leads to issues with classes that depend on it to properly handle
the OS specific functionality (like QFileSelector).
Solve the issue by adding vxworks-specific implementation of
kernelVersion, productType and productVersion.

Task-number: QTBUG-115777
Pick-to: 6.7
Change-Id: Ib544d19f604f3f2d1f088f6160dd210cd6743717
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 65b5debe3a22ff47cf77dd25cf1ec85582ca0f6c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-19 14:02:51 +00:00
Alexandru Croitor 27ecdc611c CMake: Mark wasm platform plugin as GPL3 in SBOM
Task-number: QTBUG-122899
Change-Id: I107f4432bf484ea0fb57908db936ab5fda6bd39e
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 877ba5504cb4ed5a9bd0c130ea7547de6425c525)
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-06-19 10:15:40 +02:00
Alexandru Croitor 596d07f647 CMake: Correctly annotate the Entrypoint (winmain) SBOM license ID
According to the documentation, it should be:
 LicenseRef-Qt-Commercial OR BSD-3-Clause

Task-number: QTBUG-122899
Change-Id: I8c614926c9f2811d5dd926ffcb89c59f4f25b47b
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit d78ee6933089fa9b131eb08b8b376f8c9c396f2a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-19 08:15:40 +00:00
Mårten Nordheim eb208a6bb5 compressEvents: simplify TimerEvent compression
While better in some benchmarks, it turns out to be less efficient to
first find an event to the receiver, and then checking the event-ptr
and -type in other benchmarks, compared to just iterating the list and
checking these values.

Partially reverts 3e6b42ae9d

Fixes: QTBUG-126394
Pick-to: 6.7
Change-Id: I748bda3d31350aea6e87db9bd57359ab17cf5d67
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: YAMAMOTO Atsushi - Signal Slot <atsushi.yamamoto@signal-slot.co.jp>
(cherry picked from commit b039d2251a14281947a43e226bae6c6fbae7312a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-19 08:15:39 +00:00
Morten Sørvig e7cf150caa wasm: move MODULARIZE to EXPORT_NAME finalizer
This avoids a "must set EXPORT_NAME when using MODULARIZE
with pthreads" error when linking libQtGui.so.

Both settings only apply for the final executable since
they affect how the wasm module is loaded from JS;
setting them together here makes sense.

Change-Id: Ibebeeee38203486675c43b416cb674e8ece9c147
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
(cherry picked from commit 9768d8e1ba21adace1f590420791e6924a9fad8c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-19 08:15:39 +00:00
Christian Ehrlicher 7a67ed7705 QIcon::addFile() delay-load icons when a proper size is given
Delay-load the icon within QPixmapEngine::addFile() when a proper size
is given - this speeds up QIcon creation and also allows to let
QIcon::actualSize() return the correct size of an QIcon instead the
given one. This is especially useful e.g. when a 32x32 icon has a
smaller width or height and it should be centered during painting.
Also add an optimization for multi-image formats to check for the
correct size without decoding the image.

Task-number: QTBUG-59621
Change-Id: I7ed930ae3f65a8b3a272f70bcc2958980f9f02f2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 94a3a492f52398eb1c08ea910fbd007b31228525)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-19 05:30:05 +00:00
Ahmad Samir 3640aa18d9 QFSFileEngine: remove redundant entryList() override
It just called QAbstractFileEngine::entryList().

Change-Id: Iae154c8aba8c48488f525cc3543bb24467e85088
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit b9c486ed8cd6120a1c60e39325cecd497f26265d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-19 05:30:05 +00:00
Ahmad Samir 8b84c45762 QFileSystemIterator: add constructor that takes QFileSystemEntry only
This is in preparation to adding constructors that take
QDirListing::IteratorFlags, I would have had to add an init() private
method to deduplicate the code, so instead add a constructor that can be
delegated to.

Task-number: QTBUG-125859
Change-Id: Idbc76fcba50f9d0016e4ddba03b2f532a33231bd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit c203c41109e41d03de8145a541ff5c8fbe976492)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-19 05:30:04 +00:00
Volker Hilsheimer 38f08eec14 QTableView: optimize selection when spans are present
If a span is selected, we used to assume that rows and columns might be
moved, and made a selection with a range for each cell in the span. This
resulted in very large selection models.

We already had optimized the case that we didn't have any moved rows or
columns, skipping the mapping for the respective (or, usually, both)
directions and just making a single range. Apply that same optimization
for the case where a span exists and intersects with the selection area.

Avoid code duplication by only updating the top/left/bottom/right values
depending on the configuration of the table, and then create the
selection based on those.

Adapt the test case; we now get a single range, even when a span is
present, and the range includes all cells included in the span. Add a
debug streaming operator in the test case, as there is none implemented
in QTableWidgetSelectionRange, to ease debugging. That operator can
become a hidden friend of QTableWidgetSelectionRange in a follow-up
commit.

Pick-to: 6.7 6.5
Fixes: QTBUG-119076
Change-Id: If699463944ca2abaed8f93a2cd3ea30f33b79145
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 57d209c4fdea4766f24479a1f20c2975d34a1a0f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-19 02:40:18 +00:00
Volker Hilsheimer 208ad426b4 Fix indentation in QTableView's selection handling code
Makes the follow up patch clean to review.

Pick-to: 6.7 6.5
Task-number: QTBUG-119076
Change-Id: I38c2b02876af93ce668ade7bce97b32a9ec2cef0
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 71d0ea7d042d61e8d42e9cf2700c439d4337345b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-19 02:40:13 +00:00
Thiago Macieira e3b0d2f93c QLibrary/Unix: fix mojibake of dlerror()
Amends a6a5681470 where I replaced a
function that correctly did QString::fromLocal8Bit() with
QLatin1StringView.

Pick-to: 6.7
Change-Id: Ic0adfa808d28487a8303fffd17d9ec0817eda3e8
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit 0a1a8355f313ac951e3e615f47aca40f421fc4bc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-19 00:57:44 +00:00
Volker Hilsheimer 63aece5ae7 Clean up QAccessible based on header review comments
Fix the change of the InvalidEvent value to be the same as in Qt 6.7,
where AcceleratorChanged was the last valid event.
Add trailing comma and Q_ENUM. Remove superfluous inline, make
QAccessibleAnnouncementEvent constructor explicit, declare destructor as
override.

Amends 010952a55e and
9ec1de2528 based on header review.

Change-Id: I96f00871acd2bb340ac7fc762a7fca8ac2f61dc9
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
(cherry picked from commit 902dfd08a03b86cb65bfb5da55faad671f7dad20)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-18 21:12:25 +00:00
Volker Hilsheimer 5cb79f8850 QAccessible: rename AnnouncementPriority to AnnouncementPoliteness
Better name given the value names, as discussed during header review.
Keep AnnouncementPriority as an alias until dependencies are updated.

Change-Id: I7b60c429fb60fc30378a9560da12abb87499225f
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
(cherry picked from commit bb305e63ff856a8c6f9649a27a5eabfb31df8aa7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-18 21:12:18 +00:00
Volker Hilsheimer b2f8a7b6a8 JNI: make it safe to iterate over or convert an invalid QJniArray
This is expected behavior for default-constructed containers.

Also add the missing isEmpty() member function to QJniArrayBase.

Change-Id: I23111f6906ef5476567272cb23746fec962afa35
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit e5516191b25d70ee9d6e87246d932fa559ef0b59)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-18 21:12:12 +00:00
Juha Vuolle 78784065a8 Accept QASV for multipart 'name' field
And adjust the encoding of 'name' parameter to  always
use UTF-8 / ASCII. This aligns with how other frameworks
behave. Also amended docs to recommend ASCII for 'name'.

Found in API review.

Change-Id: I54d1148bf95dece54b75c76914c49985da05e0b2
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 6b23a3c5e4316c5f889ea5e9bbfd785b78716268)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-18 17:08:34 +00:00
Juha Vuolle b5dde79bc4 Adjust multipart 'filename' parameter encoding
The RFCs around these encodings are loose and allow
several ways for dealing with non-ASCII characters.
The encoding introduced in this commit should be
interoperable and aligns with other frameworks
(checked Curl, JS FormData, Postman, and Python
requests).

This consists of several adjustments:

1. Enclose the filename attribute in double quotes
2. If filename contains only ASCII characters, use them as-is
3. If filename contains characters beyond ASCII:
3.1. Encode them directly as raw UTF-8 to filename=
3.2. Set an additional filename*= parameter with
     percent encoded UTF-8. This is a legacy encoding
     for compatibility.

Task-number: QTBUG-125985
Change-Id: I5a6ad5388e4bb69e142caa7f6de7127526f441ad
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 8c8a0c06d4f77ba8a707ec0a101b423543bf30f0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-18 17:08:31 +00:00
Mate Barany db1c747c35 Add a static get to QHttpMultiPartPrivate
Needed for the tests of the move semantics of QFormDataBuilder.

Change-Id: If4ea9a0d50addbbeaed1262517b58e7da82c0883
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 2fb79421ee22649eab4ebf6a76d2835022ce43c8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-18 04:53:47 +00:00
Juha Vuolle 34f6210bb6 Relax QHttpHeaders value field checks to allow UTF-8
UTF-8 doesn't per se contain illegal characters from
an HTTP header RFC point of view. UTF-8 is the dominant
character encoding outside of ASCII, and is used
directly at least with HTTP multipart headers.

[ChangeLog][QtNetwork][QHttpHeaders] Allows UTF-8 in header
values now.

Task-number: QTBUG-125985
Pick-to: 6.7
Change-Id: I2d8d8f00855c96c1d2ba190f2e27e2d48fcd4975
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit f39b39b8c72b5c3428396d5e74cf15cafd5bbc42)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-18 04:53:43 +00:00
Ahmad Samir 41009cade5 QTemporaryDir: clarify path/filePath() API docs
QTemporaryDir(const QString &templatePath) API docs say the path is
relative or absolute depending on whether `templatePath` is relative or
absolute.

Pick-to: 6.7
Change-Id: If77f9b378158235a68344689ded6756ac3f083cc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 9dc189e632bd5b6921361af786cf54434d2adf45)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-18 02:23:40 +00:00
Tor Arne Vestbø 7580f42606 iOS: Don't send focus out event when resigning responder without qGuiApp
During shutdown of the app the QUIView may hang around longer than the
QIOSWindow or QGuiApplication, at which point we can't deliver the
resigned responder status to QGuiApp as a focus out event.

Fixes: QTBUG-123018
Change-Id: If377f037c3fb4c2026a2d8d757011f12171e8dd4
Reviewed-by: Doris Verria <doris.verria@qt.io>
(cherry picked from commit a40d546496462e5366c24115707e43a0c8598dd3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-18 01:34:51 +00:00
Marc Mutz 2b8cf058f1 Fix misspelled QTEST_THROW_ON_FAILURE
Amends e769cf026e.

Reported-by: Ahmad Samir <a.samirh78@gmail.com>
Task-number: QTBUG-66320
Change-Id: Ib731acf6b7e56c848aa79772488186efdd856c71
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 45e9f5f2e5f0701ad4dffbe532206b791d698953)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-17 23:17:50 +00:00
Marc Mutz d9f7efba82 QUuid: rewrite compareThreeWay() in idiomatic form
A lexicographical ordering chain with 3way-compare should call op<=>
(or it's stand-in, compareThreeWay()) exactly once per element pair in
the source ranges.

First checking for != and then with <=> means we do the check
twice.

In this case, when comparing built-in types, the optimizer will
probably fold everything for us, but code like this, at this time, has
a high chance of being the source of a CnP operation, and the target
may compare QStrings this way, so use the idiomatic form to let
copy-pasters fall into the pit of success.

Amends ef964c254c.

Change-Id: Ib8344087f23435fc58740165afecd499722d1f00
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 1e6b7e08cf5f5a36fa3007e315a9282054c1a140)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-17 23:17:49 +00:00
Volker Hilsheimer d2637d2323 QFileSystemModel: only use theme icons if a theme is set
The old code checked themes first, and only went through the platform's
file-based icon resolving code if the theme didn't provide an icon. With
the added support for theme icons on macOS and Windows, this broke
standard file icons on macOS and Windows: the icon theme provides the
font-based icons, but they are significantly different from what users
expect a folder, drive, or generic file icon to look like in a file
explorer-like UI.

To fix this, we cannot simply turn the priorities around, as we get a
standard, default file icon for any file that doesn't have a specific
icon configured. The behavior needs to be different on each platform:
on Linux desktop we respect the icon theme, on other platforms we prefer
the file-type based icon.

Add a theme hint that tells the icon provider which one to prefer.
Implemented in on Linux desktop to return true, otherwise returns false.
Adapt the logic in QAbstractFileIconProvider accordingly.

Pick-to: 6.7
Fixes: QTBUG-124829
Change-Id: I9ff3f543c000aec8238bdf36b18be5c7a2349098
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit e10308769592222b97153956feeb9531863bef35)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-17 19:48:04 +00:00
Assam Boudjelthia 92228ed7f2 Android: make internal Java code for QtAndroid private
This Java code is mainly an internal implementation detail for
the Qt for Android plugin, and isn't meant to be public
in the first place.

Task-number: QTBUG-126371
Change-Id: I1155ba7912e2b89c681b57d259170087e840817f
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit 9eed1704a1bf7cdf03825e99260e47c392213165)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-17 19:35:16 +00:00
Assam Boudjelthia ef88e293e8 Android: make internal Java code for QtAndroidNetwork private
This Java code is mainly an internal implementation detail for
the Qt for Android plugin, and isn't meant to be public
in the first place.

Task-number: QTBUG-126371
Change-Id: I5149a583eb2695ff97203d81a059adcc5d1a69a5
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit 900911abee41fb424312dc6675baa47b0792635a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-17 19:35:11 +00:00
Assam Boudjelthia 5888465f16 Android: make internal Java code for QtAndroidExtras private
This Java code is mainly an internal implementation detail for
the Qt for Android plugin, and isn't meant to be public
in the first place.

Task-number: QTBUG-126371
Change-Id: Ic111439a929fa5ad05aca98dd7fa024791a00883
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit eb4e417ef64b832cddfb60fb9e20b0a04ec1ad2a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-17 19:35:05 +00:00
Assam Boudjelthia 96c7ad3590 Android: make internal Java code for QtAndroidNetworkInformation private
This Java code is mainly an internal implementation detail for
the Qt for Android plugin, and isn't meant to be public
in the first place.

Task-number: QTBUG-126371
Change-Id: If2d8386a985757b5d107ece1625bc694d7ae1272
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit a833d431c70054260a556f2f4429dd28c6483201)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-17 19:34:58 +00:00
Thiago Macieira cb517bd2e5 QBitArray: fix read of uninitialized terminating null
Commit 54c373faa4 updated the bitwise
operations to be more efficient, bypassing QByteArray and going straight
to QByteArrayData (a.k.a. QArrayDataPointer<char>). This meant we also
bypassed the initialization of the null terminator.

This wasn't caught in our unit testing and with some runtimes because
the memory we allocated happened to be zero or contain the information
we wanted. But with Visual Studio, the debug-mode runtime initializes
all newly allocated memory with pattern 0xcd, which showed up as a
problem.

[ChangeLog][QtCore][QBitArray] Fixed a regression introduced in 6.7.0
that could cause QBitArray to report wrong bit counts after a bitwise
operation.

Pick-to: 6.7
Fixes: QTBUG-126343
Change-Id: Icdc467f26dea4b05ad90fffd17d939c3b416adca
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 8ac57ff6bc778519bb1edc4036ce79ab8f688e27)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-17 19:06:27 +00:00
Alexandru Croitor 699d50bd8f CMake: Annotate some targets with SBOM information
Task-number: QTBUG-122899
Change-Id: I2eb70ca4d52e30c8e15ca7b350df6965d93732f8
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 79f9b490e7f6e2746de36542cc4c7442dabe8315)
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-06-17 15:54:26 +02:00
Łukasz Matysiak d594fbf12a Make createDirectoryWithParents return true for existing dirs on read only fs
When the filesystem is mounted in a read only mode, Linux returns true
on an attempt to create a dir that already exists on that fs.
However not every platform behaves that way.

VxWorks is not a fully unix-like system.
It is possible to enable a component that provides a virtual root file
system (VRFS) so that devices and paths can be managed using "/" as a root.
The root itself is not an actual path that can be used like on other systems.
It is not possible to store files directly in "/".

On Linux, mkdir on "/" returns EEXIST.
On VxWorks, it returns EROFS (read only file system).

That leads to a failing test (tst_QDir::makedirReturnCode).
It also leads to a broken contract, since the doc for QDir::mkpath states that:
`If the path already exists when this function is called, it will return
true.`
The doc for createDirectoryWithParents has no such comment and it is
used by other functions that also do not promise such things, but the
implementation behaves that way anyway: when errno == EEXIST -> return
true if the target path is an existing directory.

Since the existing unix implementation already returns true for existing dirs
(without checking if it was called in the context of `mkpath` or any other
function), fix the problem by checking if errno == EROFS after a call
to mkdir and then checking if the target path already exists and is a directory

Pick-to: 6.7
Task-number: QTBUG-115777
Change-Id: I849bca56618bf675933cccc5a9d5313e0014628b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Karim Pinter <karim.pinter@qt.io>
Reviewed-by: Jarno Lämsä <jarno.lamsa@qt.io>
(cherry picked from commit 8915ae3a75c4a356d94962dd9b31e1458f2a506f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-16 21:57:12 +00:00
Ville Voutilainen 788e9d7faa Fix building qcompare code in MSVC in C++20 mode
MSVC quite incorrectly errors out saying that weak_ordering's
conversion to partial_ordering cannot access the private constructor
that takes the internal order.

The problem goes away when the types are forward-declared before they
are declared as friends.

Fixes: QTBUG-126386
Change-Id: I50ad6d08ee648eb15109dde4a9ec9c753ee18e68
Pick-to: 6.7
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit d2b4aec865bd834747cd824658e567b83bf081e6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-16 21:57:10 +00:00
Volker Hilsheimer 92071fc0b1 Clean up QColorSpace API based on header review comments
Pass QPointF by value (also in the private API), and mark new
constructors explicit.

Amends 05b8467304

Change-Id: I461d50d9220404746ee6d3544acdeb0f0956ee2f
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 6c2d6cb53a1dc8fb98f7f6447e08762e7e839a23)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-16 17:30:37 +00:00
Eirik Aavitsland ff5b557dfc Fix 6.8 ABI break: missing symbol QPageLayout::setBottomMargin()
This was forgotten when the other set*Margin() methods were moved to
removed_api in 6c72080f26.

Fixes: QTBUG-126374
Change-Id: I4be96c23540fac812ddb456699218bc437c4a3f7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit ad922bbac1d65ff044c63160c73324fa27f44793)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-15 04:29:32 +00:00
Vladimir Belyavsky 0af3e3a45e rhi: metal: remove checking for legacy OS versions
Remove redundant OS version checking (via @available) and stop
supporting legacy macOS (< 11) an iOS (< 14) versions that were
already unsupported in previous 6.5 LTS.

Change-Id: I505217e0f4f4c19bbdb27b535e658d158a5bafea
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 9c199a39d228658a20c1d6650ab6a7aedfaeccf6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-14 16:57:40 +00:00
Michał Łoś 3c494d4e40 Drop checks for VxWorks 6.6 in QThread
1. VxWorks 6.* and older are not supported in Qt6 due to C++17
requirement (among multiple other issues).
2. `_WRS_VXWORKS_MAJOR` and `_WRS_VXWORKS_MINOR` are defined in header
`version.h` on VxWorks 7, which is not included anywhere, causing
`QThread::idealThreadCount()` to always return 1. As a consequence,
instance of `QThreadPool` returned by `QThreadPool::globalInstance()`
have always only 1 thread. This causes failure of
`tst_QEventDispatcher::postEventFromThread` test case.

To fix that, remove VxWorks version checking from qthread_unix.cpp.

Pick-to: 6.7
Task-number: QTBUG-115777
Change-Id: I08ffc4acdb74d13dd822402407a71f5916603440
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 8fec93e9a7bf3f8cb80aafb1e2329d998552fbcc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-14 14:59:02 +00:00
Jarek Kobus 4285216860 AssetDownloader: Implement the downloader using TaskTree
Task-number: QTBUG-122550
Change-Id: I990d0db1c5f0246aab0d796f438b26976650dc2c
Reviewed-by: Ali Kianian <ali.kianian@qt.io>
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 6dff842b2a55cc941e7868a12c725e0a8c6afdb1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-14 13:44:16 +00:00
Jarek Kobus 355f68bc4a AssetDownloader: Import TaskTree solution
An import from Creator 14.0 branch.

Task-number: QTBUG-122550
Fixes: QTBUG-126022
Change-Id: I7a1ce1c05cb388104c2e79a0a270adf3e4c57cd2
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 78de81e286d89a5396b08b67ca98ccedda8a836f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-14 13:44:16 +00:00
Tinja Paavoseppä 4d6fd8302e Android: Check input delegate for null when QtView attached to window
If the Qt libs have not been loaded before the QtView is attached to
the window, it leads to accessing the input delegate, which only gets
initialized after the creation of the libs, so we get a null pointer
expection. Add a null check, and a boolean to make sure we update
the input delegate with the view once the libraries are loaded
and the input delegate has been created.

Task-number: QTBUG-126177
Change-Id: I7372596884c7d0ed6c9cca812b46399ecfb74367
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit dc62ddd1521a5754aec0031ade17743da3ed0585)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-14 13:44:16 +00:00
Mårten Nordheim 5922437534 QDnsTlsAssociationRecord: Use QExplicitlySharedDataPointer
From the API review.

Change-Id: I91bee8899ba12c44453a989f2388fa68d6e75149
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 55796dee5af41e4cce638d04944302864788e5e3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-14 13:44:16 +00:00
Mårten Nordheim fd370355f4 Network: Add a note about ReasonPhrase not being available in h2
It's always been like this, but the documentation never said so.
See https://github.com/httpwg/http2-spec/issues/202 for why.

Task-number: QTBUG-126278
Pick-to: 6.7 6.5
Change-Id: Ie83b105dd78fc1c6c09db46ae8cb5e113cd8a062
Reviewed-by: Mate Barany <mate.barany@qt.io>
(cherry picked from commit 365a1ba7d9a3d731968cb053d5d0677c7a372e0f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-14 13:44:16 +00:00
Mårten Nordheim 40dda06cbe QDnsTlsAssociationRecord: add QML scoped enum entry
If we ever want to expose the class or the enums to QML, we need to have
already done this so no one else exposes it first without the enums
being scoped.

From the API review.

Change-Id: I0ab32743b3cb61d44cc159397435801280d74b80
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit f60c03f26562224574b180699a9518471e879a2b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-14 13:44:15 +00:00
Tor Arne Vestbø 7d2e67b1b3 QRhiMetal: Replace deprecated supportsFeatureSet with supportsFamily
https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf

Change-Id: Ic1d2f6056fb1eff8652d91d63c7db7cc5c6ed005
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit cdcbed3bd63bcf5bc842c3b44a555193b98df5a4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-14 11:03:04 +00:00
Topi Reinio b07932fb66 Doc: Restore QActionGroup signal documentation
When QAction(Group) were moved from Qt Widgets to Qt GUI, the
documentation for QActionGroup's signals - triggered() and hovered() -
were erraneously dropped. Restore them.

Pick-to: 6.7 6.5
Fixes: QTBUG-121586
Change-Id: I7ce5ec715c0d3df7a4f9837a0822c245063eb74d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 22761f13d342df677e653c07b3d066ed2b7354ac)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-14 11:03:01 +00:00
Ahmad Samir ca0f9c4ce8 QFileSystemModel: make it clearer how new Roles should be added
New Roles in user code should start from `Qt::UserRole + 1`; whereas in
Qt code itself it should start from `Qt::UserRole - 1`; adjust the
enumerators accordingly, to have less differences between Qt6 and Qt7.

Change-Id: Ib20f95e841d4d252fa9dd085530e6f3257d2776d
Reviewed-by: Sune Vuorela <sune@vuorela.dk>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 0a133035963b83e886578b9621b1275780c7d9cf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-14 11:03:00 +00:00
Vladimir Belyavsky e05a60c75a cocoa/darwin: remove checking for legacy OS versions
Remove redundant OS version checking (via @available) and stop
supporting legacy macOS (< 11) an iOS (< 14) versions that were
already unsupported in previous 6.5 LTS.

Change-Id: I772d6ca9ca638f00116c9782315e0d0b7139fe23
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 95c7e6565dc0a182f6ca8ec7c73dce58ceb04f47)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-14 11:02:58 +00:00
Tor Arne Vestbø 3a70e669ef Determine Qt::AA_DontShowIconsInMenus default value based on platform
Some platforms, such as macOS, do not natively have icons in menus,
except in a few specific cases, so the default for AA_DontShowIconsInMenus
and in turn QAction.iconVisibleInMenu should be to not show the icon.

QActions with iconVisibleInMenu explicitly set to true will still show
the icon, even if the user does not override AA_DontShowIconsInMenus.

[ChangeLog][QtGui] The default value of Qt::AA_DontShowIconsInMenus is
now determined based on the platform. On macOS icons will not show by
default. To override, use QAction.iconVisibleInMenu for individual
menu actions, or set Qt::AA_DontShowIconsInMenus to false.

Pick-to: 6.7
Change-Id: Ie4fb3e6618486233d64a7818be19a42ed9a2a852
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit d671e1af3b736ee7d866323246fc2190fc5e076a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-14 11:02:56 +00:00
Wladimir Leuschner e9ba7b7660 QWindowsWindow: Use updated windowFlags for framelessWindow query
Currently the internal flags of QWindow are not up-to-date when querying
them during QWindowsWindow::setFlags with QWindow::flags(). QWindow
updates its flags after QWindowsWindow returns from setFlags. This patch
adds a getter, to query the updated internal state of
Qt::FrameLessWindowHint flag from QWindowsWindow's m_data.flags.

This is needed due to QWindowsWindow is calling SetWindowPos, which
immediately enters the WndProc without access to the newly set flags.

Pick-to: 6.7
Change-Id: I826f29ef608d1e0a4b416e123aa4116587a035a7
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 0e6907d2f0e95a8892df55e075837cc0e81e0f3f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-14 11:02:55 +00:00
Tor Arne Vestbø 367e4b3335 Add macOS Sequoia (15) to QOperatingSystemVersion
Pick-to: 6.7 6.5 6.2 5.15
Change-Id: I8d0981a4e311162a2a5f80d10aa1c2c1528fb15c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit d1d17cf070d156d6200e3642614ccacb702a20d1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-14 11:02:54 +00:00
Tor Arne Vestbø 22518b26c9 macOS: Adopt new NSCursor API for window frame resize cursors
Fixes: QTBUG-126240
Change-Id: I25799d5fa38cebae756a393e3d8f27e422567adb
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 4aeb27fbacfade7106b19c460deb5414143a5e53)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-14 11:02:52 +00:00
Allan Sandfeld Jensen 19ca1284c8 Fix HDR transfer function image conversions
Handle TRC LUTs that overflow the 0-1 range.

Change-Id: I336ef9dd56d8cb8c0caa62bff468c9b536550f57
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 60bb057990657ff285ef0d73fa774eea907a0cbb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-14 00:41:03 +00:00
Marc Mutz da4c0de7fb totally_ordered_wrapper: make conversion from nullptr implicit
It's harmless and enables the pointer-idiomatic assignment of nullptr
without having to resort to reset().

Found in API-Review.

Change-Id: Id3a02f55b3578a29943f729d8d734fc3b1d3af11
Reviewed-by: Rym Bouabid <rym.bouabid@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 62d3b3c680ed2c6ca417f30fb3ca57482339c2c1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-13 20:40:41 +00:00
Marc Mutz 5efc98981b Fix return type of _q_futex()
syscall(2) returns long, not int. Says Clang:

  qfutex_linux_p.h:48:18: error:
    implicit conversion loses integer precision: 'long' to 'int'
    [-Werror,-Wshorten-64-to-32]

        int result = syscall(__NR_futex, addr, op | FUTEX_PRIVATE_FLAG, val, val2, addr2, val3);
            ~~~~~~   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Don't truncate to int in _q_futex(), pass it as long into the few
callers that care about the result.

Amends the start of the public history, but not picking back all the
way because the code moved around a lot. In 6.7 it found its current
place.

Pick-to: 6.7
Task-number: QTBUG-103528
Task-number: QTBUG-126219
Change-Id: I54ccaf5564bcaf38f05fab153b1b32379a66a178
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 962539d12b5584e28d32dbc8c6d61a509128d910)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-13 20:40:12 +00:00
Viktor Arvidsson 3d28089f9a QWindowsMime: Fix loading of CF_DIB (non-v5) followup
5b7422f74d fixed falling back to CF_DIB
when CF_DIBV5 is not provided, but the way the logic was written
depended on that typo to load synthesized CF_DIBV5. This change restores
that functionality and simplifies the logic.

Pick-to: 6.7 6.7.2 6.5
Change-Id: Icffbe8d969a47b5337701e13b35ce426e4d32166
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 5eb7141788ae3c0051b9f9c49870c88e209e71b0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-13 20:35:04 +00:00
Friedemann Kleint 690c2f2d60 uic: Prevent code injection via invalid property names/values
Fixes: QTBUG-126265
Pick-to: 6.7 6.5 6.2 5.15
Change-Id: Id0d6706b8565b76fcc7b9e73944dc6d3e8232e49
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
(cherry picked from commit 53c8d1fe7c59f3462b85193b688d02ff353b51d5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-13 20:34:59 +00:00
Volker Hilsheimer c9c96bba78 OpenGL functions: use removed_api to remove old version from API
Implement them out-of-line in removed_api.cpp to call the GLsizeiptr
overloads explicitly.

Change-Id: I7a4b937c2c6f444f2dc8e874ab9e07ddd52437e9
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 756e4d463610c27818a86aa5a063f6dbdd623f57)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-13 20:34:54 +00:00
Laszlo Agocs aca3b95700 eglfs: Revive QWidget rendering
After recent changes to widgets and backingstores, attempting to run
any widget-based application with eglfs resulted in a crash. The
backingstore implementation used here was not fully migrated. Update
flush() to create the rendering infrastructure if needed, and make it
call into rhiFlush().

Amends eb4cb71925

Change-Id: I253c37200f5a902a0e61b62581ac456549f3aeba
Fixes: QTBUG-126221
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 0a10d23c4a49dd14a1ded41b7cc6921909b0ee7a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-13 20:34:48 +00:00
Ivan Solovev ac36373f6c Fix QByteArrayView(QU8SV) constructor
QUtf8StringView is not a class, but just one of the template
specializations, so use the actual template.

Amends fff6562f8c.

Found in API Review.

Change-Id: I8e28704382765e85096885787172a38ea0f1f23b
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit bd581e35e7485cf42fbefd250be7b146737d9d41)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-13 14:55:02 +00:00
Alexey Edelev 10b48d59dd Remove GENERATE_CPP_EXPORTS argument
The behavior that argument was enabling is the default one now.

Task-number: QTBUG-90492
Change-Id: I11711d4c794f0b22169abb595b8ffad2eeb1300d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 1ef3bd05eb45d53cdcf92b933603b995283b3432)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-13 14:39:17 +00:00
Tinja Paavoseppä a4f4058d64 Android: Map touch position to global coordinates
When QtWindow is not at 0,0 of its parent, not mapping the position
leads to offsets in the touched position in Android vs where it is
received in Qt, e.g. needing to touch below a button's actual
position to trigger a click.

Task-number: QTBUG-126178
Pick-to: 6.7
Change-Id: Icd62ed59f0f323ba3977145c3304e4e874aa4fa2
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 15674f4ce9ea455b47f68d8871d5676d7a731630)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-13 14:18:29 +00:00
Christian Ehrlicher 371113810e SQL/QSqlField: move deprecated functions decls to correct place
Don't move them around during deprecation.

Change-Id: I647fec5a440ea063463dc285def5d793726a9e61
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 70475a652a9a44651c25126f6615770e8b43ca1b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-13 14:18:27 +00:00
Allan Sandfeld Jensen dce5164375 Fix BT.2100PQ
From and to algorithms were accidentally reversed before submitting
final patch.

Change-Id: I16e0afda26b77047facf4f65065224c8f3dce6c6
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 1b1f613b56fce643a7565e9280acc90e171caf7c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-13 08:46:16 +00:00
Friedemann Kleint 0723c6fd05 QAbstractItemModelTester: Enable testing the QtGui roles without linking to QtGui
This enables doing QtGui testing when using QAbstractItemModelTester
in Qt for Python, where the QTestlib binding only links against
QtCore.

Port the code to check against QMetaType constructed from type names.

Task-number: PYSIDE-2772
Change-Id: Ifcd8f1ea4758459d8a178226e3f215e5c2b273b8
Reviewed-by: hjk <hjk@qt.io>
(cherry picked from commit bb542a55b28dd591709ed2c68e4505ec08fc62b5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-13 08:46:16 +00:00
Christian Ehrlicher b34fa2f61f SQL: Code cleanup - move Q_PROPERTY to the correct place
... which is directly after Q_OBJECT/Q_GADGET

Change-Id: I3fb2b2e810a68e0ae811e55b286bc5f40364295f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 031eabe845c41ef98cb078d0fae0521156a75b9e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-13 06:26:15 +00:00
Christian Ehrlicher 59b4abd730 SQL/IBase: simplify date/time conversion
Simplify date/time conversion by using QTime::fromMSecsSinceStartOfDay()
/ QTime::toMSecsSinceStartOfDay() and avoiding some intermediate
variables.

Change-Id: I16e673405a347417866cdf100a13d817c1b17ff8
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit c196598390a211b01987995f3fa1f8cc7ca6bc07)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-13 06:26:15 +00:00
Christian Ehrlicher c8fbdb5c38 QIcon::addFile() delay-load icons when no size is given
Delay-load the icon within QPixmapEngine::addFile() when no size is
given and the format supports it (e.g. png) - this speeds up QIcon
creation as the whole image is parsed later.

Fixes: QTBUG-59621
Change-Id: If165ca97c4b91f68a7d98f57de711390de060012
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit a843db6e2d80a99be38c2b66aac92cb912613bd6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-13 06:26:15 +00:00
Christian Ehrlicher c8d8cfa333 SQL/Doc: add note about QAnyStringView
Add a note to all functions now taking a QAnyStringView that their
signature changed from QString to QAnyStringView

Change-Id: Ib9743b5b2c437724c6308e74ef3c5820136a34f5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit a736a3c670929e3b73e11b33cc1705957c42961b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-13 06:26:15 +00:00
Oliver Wolff 33b3054da1 Windows: Remove legacy mouse handling
Pointer handling API was added in Windows 8. As we no longer support
Windows 7, we can make mouse handling code easier to read/maintain be
removing the legacy implementation.

[ChangeLog][Windows] Legacy mouse handling has been removed. It is no
longer possible to enforce legacy mouse handling by passing
"-nowmpointer".

Change-Id: I58387471999a371fd20c644abbcf855e192d220b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 3a38de71da13103fbe5bdf6b822263e282e68368)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-13 04:09:01 +00:00
Assam Boudjelthia fcae2b7f2d Android: restart whole app if the activity was restarted
If the Activity restart path is run while m_layout is null,
it would lead to a NullPointerException when trying to
access m_layout. Moreover, the code here doesn't make sense,
as m_layout.getParent() should probably be only done when
super.updateActivityAfterRestart() returns true because if
it returns false, the app will be restarted anyway.

Testing the restarting behavior of the Activity, it seems
that the code code doesn't really work in bringing the app
to a usable state after an activity restart, and this code
path should be re-evaluated. Thus, I'm simplifying the logic
to only restart the whole app, and later figure out a way to
do a proper smooth transition instead.

Fixes: QTBUG-124786
Pick-to: 6.7
Change-Id: I79f0c53c815bf71c831d0b930f358c9fd820a2d4
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
(cherry picked from commit 7602f71aa6cd10ff1b16d154fa967c8fce8e8d0a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-13 01:08:18 +00:00
Marc Mutz 294f257a0a JObjectBase: make all SMFs protected
This is safer against slicing and more explicit, ie. doesn't leave
readers of the code wondering whether the JObject move SMFs are
actually working or call something else, because the JObjectBase move
SMFs are disabled due to the protected dtor.

Change-Id: I5c94c95c2e2b807a8ea3bfbcc2b80b390b2bd837
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 51c5259fe9c5f5e41a22622830f1ca532f989685)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-12 15:53:35 +00:00
Marc Mutz e5890084dc QThread: mark is(Main|Current)Thread() noexcept
The rationale given for the addition of these functions was that they
are a more efficient way to check these things in public API.

If so, they shouldn't cause compilers to insert exception handling
around their calls, so mark them noexcept.

This is safe, as both conceptually and practically, these functions
should not and cannot fail, so we'll never need to remove noexcept
again.

Found in API-Review.

Amends 7a374c38d2 and
a3d50112e4.

These two commits also lacked each the changelog entry, so adding them
here:

[ChangeLog][QtCore][QThread] Added isMainThread() static member
function.

[ChangeLog][QtCore][QThread] Added isCurrentThread() member function.

Change-Id: Iaf39ce2cc0abd45049bff60b24693e84bf76d9e0
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit d73a2bf0fb3e0a00691c858645a5a5bb2b55b40a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-12 15:53:35 +00:00
Bartlomiej Moskal 7b65e0395f Android: Fix keyboard inputType and imeOptions
There was a small mistake in:
d2ae5ef51e3339c11b1c0ed0b09f9d17b9708f53 commit, which caused a
regression in the input method.

While the function parameter name has been changed, the assignment name
has not. This resulted in the values never actually getting updated.

Fixes: QTBUG-125410
Pick-to: 6.7
Change-Id: I8e64e991d02546ddd078fd273f0b57491c63b55c
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
(cherry picked from commit 79e00b0b25765b85b112b601fee70184b1efe3c0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-12 15:53:34 +00:00
Marc Mutz d908c6162c qfuturewatcher_p.h: fix missing qfuturewatcher.h include
Extending headersclean_check to private headers has shown that
Q_DECLARE_PUBLIC needs to know the Public class in-size, so a
forward-declaration is not enough. Says Clang:

  qfuturewatcher_p.h:31:5: error: static_cast from 'QObject *' to 'QFutureWatcherBase *', which are not related by inheritance, is not allowed
      Q_DECLARE_PUBLIC(QFutureWatcherBase)
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Amends the start of the public history.

Pick-to: 6.7 6.5 6.2 5.15
Task-number: QTBUG-126219
Change-Id: I1e132aaa844f5c87d57446e8818280fd141d2b1e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit b58d926090620079f602f4f2ce9f17fe7025c962)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-12 15:53:34 +00:00
Volker Hilsheimer aaeb4970fd JNI: port QTimeZone on Android to QJniArray
Replace code that manually operates on jarray with QJniArray.

The comment about using separate jobject and QJniObject didn't make
sense; we didn't construct the QJniObject via fromLocalRef(), so
allocated a new local reference anyway, in addition to the local
reference returned by GetObjectArrayElement.

The implicit code now creates a QJniObject (-like object;
QtJniTypes::String contains a QJniObject) as well, but it's also
just a temporary. It would be cheaper to iterate over a
QJniArray<jstring>, but only if we then duplicate the code from
QJniObject::toString to not create an intermediate QJniObject.

Change-Id: I9f10541f533dd2fbd2f7ba6fdacc7d79b3ac3ae9
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 64127a7a0db657cbc844938f02b623f90cdd78ee)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-12 15:53:34 +00:00
Marc Mutz 23013db675 QStringEn/Decoder: port (name, Flags) ctors to QAnyStringView
This reverts commit f8359084b9.

Lookup-by-string functions should be all taking QAnyStringView, not be
overloaded on QString/const char*.

Found in API-review.

[ChangeLog][QtCore][QStringEncoder/QStringDecoder] The (name, flags)
constructor now takes QAnyStringView (was: const char*).

Fixes: QTBUG-126108
Change-Id: If68343ce5ec2ff60ce55156f9f2dc2bb6938e07f
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit d4c4e6b876b948c1a34abdd46cf7f5be1c302137)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-12 12:23:41 +00:00
Marc Mutz 0026955270 QStringConverter: port (name, Flags) ctor to QAnyStringView
These kinds of lookup functions are no-brainers for QAnyStringView.

This is required to replace the QStringEncoder/Decoder constructors
from QString, newly added for 6.8, and found in API review to be
better written using QAnyStringView.

Because this is API-Review-relevant, keep the implementation
pessimized. It's not worse than the code that it replaces (toLatin1()
on an unshared QString performs in-place conversion), and can be
improved later.

Task-number: QTBUG-126108
Change-Id: I4a0d1840d4754670b2e2f20d768ed98f7e1937d5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f6c11ac4f20a16d0b2113014e2dac63b95d946ae)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-12 12:23:40 +00:00
Marc Mutz 09c3e9da1f QStringConverter: port encodingForName() to QAnyStringView
These kinds of lookup functions are no-brainers for QAnyStringView.

This is required to replace the QStringEncoder/Decoder constructors
from QString, newly added for 6.8, and found in API review to be
better written using QAnyStringView.

Because this is API-Review-relevant, keep the QStringView case
pessimized. It's not worse than the code that it replaces (toLatin1()
on an unshared QString performs in-place conversion), and can be
improved later.

[ChangeLog][QtCore][QStringConverter] The encodingForName() function
now takes QAnyStringView (was: const char*).

Task-number: QTBUG-126108
Change-Id: I02cc53bfbc8f1eebe539816487a10b39e96fac2d
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit b3edce58e5aea76d1d84c868f76171c2b40520a4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-12 12:23:38 +00:00
Giuseppe D'Angelo 70dcbb4f17 QESDP: deprecate QT_ENABLE_QEXPLICITLYSHAREDDATAPOINTER_STATICCAST
We've had this workaround since Qt 5.4. It's due time we get
rid of it. This commit deprecates it, in preparation for removal.

[ChangeLog][QtCore][QExplicitlySharedDataPointer] Support for
QT_ENABLE_QEXPLICITLYSHAREDDATAPOINTER_STATICCAST has been
deprecated, and will get removed in a future version of Qt.

Change-Id: I3000ea606b37714542916e105ebd50871dc42935
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 0ed039fd134fb8025236847295681f13f1775847)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-11 23:18:44 +00:00
Volker Hilsheimer ea8277dbf3 macOS: use QStyleHint to get color scheme in the style
That way, an override through QStyleHints::setColorScheme is
immediately respected by the style.

As a drive-by, make the helper static and inline.

Change-Id: Ia6cde1f5099d9194b25fac812c3184f5a61bf1dc
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 4245987f6875d01853053c50d13ecf42b61fc0ad)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-11 19:35:30 +00:00
Volker Hilsheimer 450cd772e2 JNI: use QJniArray in ContentFileEngine
Replace manual array creation and conversion code.

Change-Id: Icd728b69790c0ed7a6ab38ff4f07622bea2be000
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 254d5ca38dff0b580777b5067816a6bb2669704d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-11 19:35:30 +00:00
Volker Hilsheimer 3d9527a102 JNI: port QNetworkProxyFactory to QtJniTypes
Simplify the relevant QJniObject calls to not use callObjectMethod,
but rely on the return type that we have to pass in anyway. Replace
manual loop unwrapping with QtJniArray, and declare the QtNetwork
Java class so that we can use it directly.

This removes the last usage of Q_DECLARE_JNI_TYPE in qtbase.

Change-Id: If872684c8b52bc7789e248cfc3046817c411903c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 909493bae27eeb55c985aa9522a57bc4e60d0893)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-11 19:35:30 +00:00
Jan Arve Sæther 77dd4bb142 Move AA_QtQuickUseDefaultSizePolicy out of Tech Preview
Change-Id: Ibdd23455c266af6748aca9de859ea21caac50634
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
(cherry picked from commit 8b0f56e99838f974a675ce557b8a5646519fd780)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-11 19:35:30 +00:00
Shawn Rutledge b1481a1663 Fix MouseButtonDblClick synthesis from touch double-tap
When QGuiApplicationPrivate::processTouchEvent() sees that the
touch event was not handled, and calls processMouseEvent(), the latter
uses the QEventPoint with pointId 0 regardless of the original
touchpoint ID. Now it updates the persistent QEventPoint from the
original touchpoint so that a double-click event will not be ruled out
because of the timestamp delta or position delta (movement since press)
being too large.

Fixes: QTBUG-125993
Pick-to: 6.7 6.5
Change-Id: I8e9b007818107ac2329454e0ccfb2ac9e506b617
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 2a0b907f11b9c0ad46322ba06482861423246d93)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-11 16:36:38 +00:00
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
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
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
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 7a9bc220c7
and moved to QtRootLayout in 6ff88f97a6.
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 b1301fffe9 QFileSystemModel: replace a TODO with QT{6,7}Only
So that it's not forgotten come Qt7.

Amends 19258608e9.

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
Ivan Solovev 7b08477977 qstringalgorithms: remove unused function declaration
The findStringInsensitive() function was declared but never
implemented.

Amends b347d48704.

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 dfe968e970.

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 5ea4e27661.

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 f9035587b9.

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 ac7f22ed0a.

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
Marc Mutz 1a833d82f4 [docs] Document QDBusObjectPath QDebug stream operator
Amends c89b1bbddc.

[ChangeLog][QtDBus][QDBusObjectPath] Added QDebug stream operator.

Change-Id: I677bef4be07e8138448d1c4bad6d590d607a0161
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 648e3c730afb3c4d15e4f08580d641e54836d88d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-07 06:59:19 +00:00
Axel Spoerl f54e50e513 QDockWidget: fix positioning after unplugging from floating tab
A floating tab is a QDockWidgetGroupWindow, containing a
QMainWindowTabBar, with each tab representing a dock widget.
Users can unplug dock widgets from the floating tab, by dragging
the respective tab of the tab bar. Such a drag triggers an internal
move of the tab at first. When a tab is dragged outside the tab
bar, the dock widget is unplugged and becomes floating. It is
supposed to be placed with its title bar under the mouse cursor,
so the drag can seemlessly continue and move the newly unplugged
dock widget.

To position the dock widget's title bar under the mouse cursor,
QTabBarPrivate::dragStartPosition was deducted from the mouse move
event's global position.

QTabBarPrivate::dragStartPosition holds the the position of the tab
at the time when the drag had started. It is used, to restore its
position, when a move is aborted. Using this point to calculate an
unplug position is wrong. It results in random positions, away from the
mouse cursor, especially if the tab has been dragged over a longer
distance.

Implement a helper function, that positions the dockwidget with its
title bar under a given position.
Use QDockWdget::titleBarWidget()->rect.center(), if it has a title bar
widget.
Otherwise, use QApplication::startDragDistance() as an offset on the
short side and the middle of the long side as coordinates.

The behavior can't be autotested, because
- mouse move emulation doesn't follow a line.
- drag and drop can't be tested on Windows platforms

The dockwidgets manual test (former dockwidgets example) can be used
for verification.

Fixes: QTBUG-126084
Pick-to: 6.7 6.5 6.2
Change-Id: I276cb6ade3944921d747bf5e73b7b6fe402d10c5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 37861df8e5a41f0f654e15776c631da95ba26c03)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-07 06:59:19 +00:00
Marc Mutz 9f1b4d4e09 Make QDBusObjectPath QDebug stream operator a hidden friend
Because that's how we declare them these days.

Found in API-review.

Amends c89b1bbddc.

Change-Id: I5163952e43abc1185b8f8f5c5fde2b4839e78e0d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Kai Uwe Broulik <kde@privat.broulik.de>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 9387ea21cd4ab26dc6a5cdc5d6a732be1fe8e429)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-07 06:59:18 +00:00
Paul Wicking 7c09687275 Doc: Document QApplicationStatic convenience header
Task-number: QTBUG-125097
Change-Id: Ib71dfe7696fb50759e43b0c8dee70860f1837d9b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 197a1f1a7716c9ddbdf9c458686bafa740f726cd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-07 06:59:18 +00:00
Volker Hilsheimer dfdba712c8 Doc: fix warning from typo in type name
Amends 4d6721781806e4ce172f836d4b58df68acc4e4b0. qdoc using
LLVM 18.1.6 doesn't generate a warning for this, but the one
in CI does (but the warning limit is currently inactive).

Change-Id: I1e29e35c9c88d78133a3ed130a3111191b7ad7f9
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 3c81fc5d7337f18fdd6f9fedf7ba436152f3daf1)
2024-06-07 06:59:18 +00:00
Nodir Temirkhodjaev b907752a2c Windows: Fix "__msvc_int128.hpp" inclusion
The "__msvc_int128.hpp" file is not available in MSVC 17.1.5

Change-Id: Iebc611342ffe5baafb8469205e14afc41b55be5f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 1b3ae003e657074a9b3cc5a8e5212a40cf02c0fd)
Reviewed-by: Nodir Temirkhodjaev <nodir.temir@gmail.com>
2024-06-06 10:37:23 +00:00
Tor Arne Vestbø 3964d03f31 Return button index for deprecated QMessageBox APIs
The static QMessageBox APIs taking button texts instead of standard
buttons promises that the return value is 0, 1, or 2. After the change
in b30121041c the return value of exec
for custom buttons was changed (as the documentation says its an opaque
value), which unfortunately affected the deprecated functions.

To fix this, we use the index of the clicked button in the custom
button list, to restore the previous behavior of the deprecated
APIs.

Fixes: QTBUG-125858
Pick-to: 6.7
Change-Id: I96d39e42b64e2b55eab07e2f15df71b94cfe3e6d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
(cherry picked from commit a428c6933565ee8368367534cf306ccc6957f5a5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 5b151ea2d23dc3834180d3ec6495ac5d99cae550)
2024-06-06 10:37:23 +00:00
Marc Mutz f51051bb6b QStringConverter: use nameMatch only in one direction
Always pass the fixed strings on the LHS, and whatever the user
supplied on the RHS.

The old code is not wrong, and the new code is equivalent, for now,
but keeping the same order will simplify an eventual port of
nameMatch()/encodingForName() to QAnyStringView.

Pick-to: 6.7 6.5
Change-Id: I9aa338a9c497764d2ad5d97bbd8b36710186b3af
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit c8feef0bb5825102a397787366df74990cfdbf6e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-06 06:44:40 +00:00
Christian Ehrlicher d05985d229 SQL/IBase: cache return value of record()
Cache the return value of QIBaseResult::record() to avoid the recreation
(e.g. when using QSqlQuery::value(QString) instead index-based ones).

Change-Id: I88568d99ba96e19ae6b661d058e7709ebc5ef2a2
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 71880c018fe98854948a6c7dd9049e4ba0ddb8e6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-06 04:15:43 +00:00
Christian Ehrlicher b67c748e29 SQL/IBase use QT_USE_MSVC_INT128
... instead Q_CC_MSVC to be in sync with qlocale_tools_p.h and avoid
compiler erros when used with msvc versions not providing int128
support.

Change-Id: Ia2166a6260a9340a5e5bbca3f46c3b77a9f8d50d
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 694ce1772db45d115ad02019a46ad2db4c3abeab)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-06 04:15:38 +00:00
Oliver Eftevaag dcc6d6ec22 Remove AA_DontUsePopupWindows
Back when 953f701799 was first introduced,
we thought it would be a good idea to make popups in qtdeclarative use
popup windows by default, and then let users revert back to the old
behavior via setting an application attribute.

We eventually decided to go in a different direction, causing
AA_DontUsePopupWindows to no longer be needed.

More information can be found in here
823026646c62c7e3b42be1549fcb61debb468e60 in qtdeclarative.

Reverts 953f701799

Change-Id: I3c5054d92c4d8c38193e7e0c193f425b7414f6dd
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit a3df8dac90c6f78c6b8832e8413b8542818cea0e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-05 18:27:45 +00:00
Ahmad Samir aa9d5b814c Qt::TimerId: fix typo in API docs
Task-number: QTBUG-125859
Change-Id: Ia751fc325618544f99bdce059afccb9cd90fbcfe
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit 507f75d19e0a8cfc6a3cf552017ba0f0b305a69f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-05 18:27:45 +00:00
Wladimir Leuschner 899f708c70 QStyleSheet/QProxyStyle: Avoid deref after setWindowFlags in polish
When invoking setWindowFlags with a QStyleSheet and QProxyStyle set, a
repolish is recursivly done creating a second QStyleSheetStyle in
QWidgetPrivate::inheritStyle due to not cleared WA_SetStyle window flag.
This leads to a use-after-free in the then following recursive call to
QStyle::polish. This patch uses the previously create QStyleSheetStyle
in the case that there is already a QStyleSheetStyle for the proxy.

Fixes: QTBUG-125513
Pick-to: 6.7
Change-Id: I841bf68143e893d74ab7373b7a3d3d4ee2bce514
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 26af5d1854336907d6d7fd6aa1ad060f6d38ce1c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-05 18:27:44 +00:00
Laszlo Agocs 47a9acb7cf rhi: gl: Only set WRAP_R for 3D textures
It is not clear why an OpenGL implementation would reject
(with INVALID_ENUM) the setting of GL_TEXTURE_WRAP_R
(as making it an error makes no sense and not in the spec
either), but the most likely interpretation of the
associated report is that some Adreno-based Android devices
do that.

So instead of just testing if we are >= ES 3.0, also check
the texture target before setting WRAP_R.

Pick-to: 6.7 6.6 6.5 6.2
Fixes: QTBUG-126012
Change-Id: I0fe1cd71b9fd74748f7bae78030c41ca972932b5
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit f50e946012553771190addbca7deeb498ac992b3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-05 18:27:44 +00:00
Volker Hilsheimer e372ae06a5 JNI: document QJniEnvironment::registerNativeMethods overload
Ideally that doesn't have to be used by clients, as declared types
have a registerNativeMethods static member function that can be
used directly:

QtJniTypes::MyType::registerNativeMethods({...});

But since we don't have documentation for declared types yet (we
could document the QtJniTypes::JObject class perhaps), let's
document this helper for now.

Change-Id: Ic1aca504cc08dfad83b6ba867db24037b1ed7d23
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 4d6721781806e4ce172f836d4b58df68acc4e4b0)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-06-05 18:27:44 +00:00
Juha Vuolle 9b1e98a14e Remove QRestReply TP marking
[ChangeLog][QtNetwork][QRestReply] This class is no longer
"under development and subject to change".

Change-Id: I8c7ae54b33fd9a6edb22a35ca58ef87da68a9b0b
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit f39ce44c733d8cbbb12de8b2413b5f72e5b94be6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-05 14:40:12 +00:00
Juha Vuolle 56019f4d49 Remove QRestAccessManager TP marking
[ChangeLog][QtNetwork][QRestAccessManager] This class is no longer
"under development and subject to change".

Change-Id: If4d1a45c428d15ae7b4c8e83b6fe05327e6d62a7
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 20b85ea8bfeab92e7a4a9c3e1ed2732ff5753635)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-05 14:40:06 +00:00
Juha Vuolle dc8c8b5fc9 Remove QNetworkRequestFactory TP marking
[ChangeLog][QtNetwork][QNetworkRequestFactory] This class is no longer
"under development and subject to change".

Change-Id: Ib0b6fbc6226709a8bcdbb66488c7d3e7097acc8f
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 23a83d6dcee23af02b775bc6af7766c03040ae3a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-05 14:39:59 +00:00
Friedemann Kleint 6333376402 QAbstractItemModelTester: Check size hint role
Returning the wrong data type for Qt::SizeHintRole may lead to a size
of 0,0 and the item disappearing.

Task-number: PYSIDE-2772
Change-Id: I906445f2ed2141da2606774f2b8ad6282662eb17
Reviewed-by: hjk <hjk@qt.io>
(cherry picked from commit 84f2cd6523081ed8774b2a9fe9ee36d05172ff50)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-05 14:39:58 +00:00
Marc Mutz bca56f277e Qt::totally_ordered_wrapper: specialize QTypeInfo
Simple: just inherit the payload type's (QTypeInfoMerger isn't needed,
as the sizeof totally_ordered_wrapper<P> is the same as the sizeof P).

Yes, this means Qt::totally_ordered_wrapper<P> is marked as isPointer,
but that trait is already deprecated.

Found in API-Review.

Change-Id: I4b5df08cd4891bd463d1f127c17ed5c4cd812984
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 5bfb6d513c0692ba1b6621b2ff0b3207088eb742)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-05 13:27:06 +00:00
Łukasz Matysiak a092feb71a Add vxworks to the list of keywords used to blacklist tests
Right now vxworks is not on the list of keywords used to blacklist
tests.
Because of that, it's not possible to blacklist a test specifically on
that platform.
Solve the problem by extending the list.

Pick-to: 6.7
Task-number: QTBUG-115777
Change-Id: I04d55eabc27f7554ea9e3fa030ff118a22a624b6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 8f9b0891f59dbc59d1295bf8eff361070bd01a9d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-05 13:16:46 +00:00
Christian Ehrlicher dc431df8c0 SQL/IBase: add partial support for SQL_INT128 datatype
The previous patch missed the handling of SQL_INT128 in
qIBaseTypeName2().

This amends 373ae6cbd2

Change-Id: I646bd5af23c14761195f9c1089dc4cbbe2e94790
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Andreas Bacher <andi.bacher@outlook.com>
(cherry picked from commit f6bb8f832442a2e70b3d4718fb06807cfe98511b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-05 13:16:46 +00:00
Jari Helaakoski 313392ec6b Fix compilation issues when configuration features are disabled
Commit fixes settings and http features

Task-number: QTBUG-122999
Change-Id: Iff94e9e4f7122a35000376e59cdea2a93e6a7f40
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit ba672abfaed6fa8adde44b32c7f43c91630b5eeb)
2024-06-05 08:55:18 +00:00
Volker Hilsheimer bea866c2a1 Doc: silence some warnings from QDirListing
The type doesn't have hasNext/next member functions, and
the fileInfo/fileName/filePath functions are members of the
nested DirEntry type.

Since the DirEntry type is not documented, linking to it will
still fail. Adding documentation for that type is an exercise
for a future commit.

Amends c39a0d1e89.

Change-Id: Ib223905123264271ce090a991cd73936b49edaae
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 71053abba3b9a6aed51793e7259c34e431b714f9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-05 08:00:52 +00:00
Christian Ehrlicher 20c568fba3 Doc/QIconEngine: fix comment about virtual_hook()
QIconEngine::scaledPixmap() and isNull() are now virtual functions
which can be reimplemented by the icon engines so the comment was out
of date.

Change-Id: I308446dade1da9edeef5c554db146443660b4761
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 3987e938b1004329c6614adcf3c3d2777b8b1cea)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-05 04:17:43 +00:00
Christian Ehrlicher 4735382122 QSqlRecord/QSqlQuery: Use QAnyStringView instead QStringView
Change all functions taking a QStringView to take a QAnyStringView and
remove all functions taking a const QStringRef since this can now be
fully handled by the QAnyStringView ones.

This amends f2dba19194 and
993f318014

[ChangeLog][QtSql][QSqlRecord] All functions taking a QString were
changed to take a QAnyStringView.

Change-Id: Ia1c968c4e2a7a93aa26d090ef6605271305c14a6
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 6b096271cf0aac38d80f292f8b37edd671a8d17f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-05 04:17:33 +00:00
Mate Barany e624d86fc1 Add a simple example snippet to QFormDataBuilder
Add a small snippet that demonstrates how to create a multipart message
with qformdatabuilder

Task-number: QTBUG-114647
Change-Id: Ie85cdcf40bd4333d06ead3f5b8dfabd799d2a9ab
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 8e4f1d9636bd9baf807b42e7c89453109e420b9c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-05 04:17:25 +00:00
Volker Hilsheimer dfab25e18b PaintDeviceMetric: add missing trailing comma
Task-number: QTBUG-125859
Change-Id: Ic02cf9d021649a20b92a8fbb148c80c5913651d4
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 8218f79c40e73cf69aaed248d2802ddbd3ab9629)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-05 04:17:17 +00:00
Volker Hilsheimer f74f66d59f QPageLayout::OutOfBoundsPolicy: add missing trailing comma
Task-number: QTBUG-125859
Change-Id: I7834a5bd0884ab23f83813a87e9c51ab34c10797
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 68ee140d17233ae17d9728dc5967ddf125c21018)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-05 04:17:09 +00:00
Thiago Macieira 34533705b2 Entrypoint/Win32: just use __argc and __argv if available
We were splitting the Unicode command-line using CommandLineToArgvW(),
then converting to 8-bit for argv. That was practically always the same
as what the runtime had already stored in __argv. But not always: it
looks like the runtime splits the 8-bit command-line (GetCommandLineA())
and there are certain Unicode characters that WideCharToMultiByte()
converts to a quote ("), which causes the command-line splitter to
differ from what Qt is doing.

__argv may not always be populated, if the user requested a wmain()
somehow, because that causes __wargv to be populated. Therefore, we need
to keep the old code.

[ChangeLog][QtGui] Fixed a bug that caused Qt applications to disregard
Unicode command-lines on Windows even when argc and argv were passed un-
modified to QGuiApplication or QApplication. This happened only for
builds with Visual Studio and in the "windows" subsystem (not
"console").

Pick-to: 6.7 6.5
Fixes: QTBUG-125380
Change-Id: If05cb740b64f42eba21efffd17d007799f99d8bf
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 993b197d9c944060763fb46514c5c1d31abce205)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-04 15:25:19 +00:00
Juha Vuolle 56a4e72afa Add few qdoc \targets to QDesktopServices
The targets are linked from qtnetworkauth documentation.

Task-number: QTBUG-125344
Change-Id: I95cc746a2dac4d8a99278c7d3ac5edf4b201a41b
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 9b0f58809be68a956fe3cfabce36d8fbb90208af)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-04 15:15:28 +00:00
Tor Arne Vestbø 1d8ae2799d QAccessibleCache: Generalize macOS-specific hooks to all Apple platforms
These are used from the iOS platform plugin as well, so rename the hooks
to make it clear what's going on.

Change-Id: I701550a189b0047b8c604c9c27986f780aa157d4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit c3f1533fba88c2e9fc4ce238f68055e37675292c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-04 13:42:16 +00:00
Marc Mutz aec1edfe40 qtypeinfo.h: move QTypeTraits part to qttypetraits.h
Makes sense to collect the stuff in a similarly-named header, and it's
not like any of the QTypeTraits stuff was needed for QTypeInfo.

Makes #include <qtypeinfo.h> _much_ lighter again, at the expense of
qminmax.h now getting <variant>, <tuple> and <optional> instead, but
qminmax.h is much easier to avoid in Qt headers (just use the std
versions) than qtypeinfo.h.

[ChangeLog][QtCore][Potentially Source-Incompatible Changes] The
qtypeinfo.h header no longer transitively includes <optional>, <tuple>
and <variant>.

Task-number: QTBUG-97601
Change-Id: Ied96113f38c1232fef3ec79847ee62f06c68f268
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit b2eb422699118f4ae8370519b4c7bb3fe121beb2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-04 13:42:16 +00:00
Tuomas Vaarala 8f50ece5fa [QNX] Return Qt::Key_Clear when numpad key 5 is pressed without num lock
Based on the documentation, the numeric keypad key 5 is commonly mapped
to Qt::Key_Clear, when Num Lock is off. Previously the number 5 was
returned also when the Num Lock is off which caused an ui application
being unable to disable the numpad key number 5 when numlock is off.

Fixes: QTBUG-125958
Pick-to: 6.7 6.5
Change-Id: I62f7521376890a201cd11abf78847bcb0eb1752a
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
(cherry picked from commit cc89c4c76567184b2887952dfe44375ff3ebd28d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-04 10:38:50 +00:00
Ali Kianian 98ecccba8d Add AssetDownloader to QtBase as a static library
Task-number: QTBUG-122550
Change-Id: I97419f27079475784ae05e1150493abc87e1b119
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit cbb2493cf76eaad23315ad1a4676d44d396fafc3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-03 19:07:48 +00:00
Juha Vuolle 52a91ac5b0 Fix JNI Types doc link
Fixes warning: Can't link to 'QJniObject::JNI Types'

Amends: aad13ef59c

Change-Id: I9361afe4745ef33908ea9a29f4543cfe044500d3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 5bc1bca2dd390180a3af214e82076228be42a4e5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-03 10:28:04 +00:00
Lorn Potter d2fbcc4cfe wasm: fix mic and camera permissions on firefox
For whatever reason, exceptions are raised on Firefox when
checkPermissions is called.,
"'camera' (value of 'name' member of PermissionDescriptor) is not a
valid value for enumeration PermissionName."
and
 "'microphone' (value of 'name' member of PermissionDescriptor) is not a
 valid value for enumeration PermissionName."

so instead of changing to denied when this happens,
just issue a silent warning and continue.

Fixes: QTBUG-125381
Pick-to: 6.7 6.6
Change-Id: I03ee45297d28f4b99cc96f593cf529113747488b
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2024-06-03 11:57:24 +10:00
Lorn Potter 41cb01dc59 Wasm: fix QtVirtualKeyboard crash
Do not try to access non the existent input element when there is no touchscreen,
as we do not use it in that instance.

Fixes: QTBUG-125120
Pick-to: 6.7 6.7.1
Change-Id: Iedac1890d13b348ef12690947779347e3c2f8476
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
2024-06-02 22:12:57 +00:00
Edward Welbourne 9534341654 Integrate timezone data into the CLDR-via-QLocaleXml pipeline
Future work shall need the timezone alias data to be synchronized
between the (expanded) locale-independent timezone data and the
(coming) locale-dependent timezone data. The latter shall need to come
via QLocaleXml, hence the former now needs to, too.

This makes no change to the generated data, aside from changing the
regeneration instructions for qtimezoneprivate_data_p.h, to use the
same scripts as locale data, instead of cldr2qtimezone.py, which is
now removed.

Task-number: QTBUG-115158
Change-Id: I47ddd95f6af1855cbb1f601e9074c13f213cd61c
Reviewed-by: Mate Barany <mate.barany@qt.io>
2024-06-02 15:25:27 +02:00
Edward Welbourne 4e23dbb742 Add assorted notes and suggestions in util/locale_database/
Change-Id: I22534943f2c9710d501235672811a861a5fd3aea
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-06-02 15:25:21 +02:00
Edward Welbourne 08c877a703 Update the utcIdList (now that I've worked out where it came from)
It was originally (without any comment to this effect, either in the
code or the commit message) just the list of offset-zones
corresponding to known Windows zones' offsets, augmented to include
each whole hour offset out to ±14 hours. Absent documentation, of
course, this was not maintained.

Added the four offset zones implied by that, that hadn't been added
when new entries joined the Windows IDs with novel offsets. Check,
after scanning CLDR for Windows data, that this has been kept up to
date. Updated the generated data.

Change-Id: I3cf3932c320876f7f2f74840d8c3951be49cfe70
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-06-02 15:25:07 +02:00
Edward Welbourne 5f63885e84 Update CLDR Windows timezone data to v44.1
The recent change to IANA ID lists extracted for Windows adds new IANA
IDs to various zones and shuffles the order in some cases, leading to
changes in offsets throughout the related tables (and two test-case
that lose an expected entry that was an alias for one of its
others). This is caused by CLDR doing a clean-up of its zone
information, deprecating some old names, combining some synonymous
zones and reversing some aliases to better match the IANA DB. As a
result, some prior expect-fail tests now pass.

The code that reads the tables is insensitive to order after the first
entry in each list; and the first entries only change where they were
CLDR's ID for a zone, replaced by the modern IANA ID, which is what we
should be using. Various aliases are omitted from lists, but can be
looked up via the alias table.

[ChangeLog][Third-Party Code] Updated timezone data from the Unicode
Common Locale Data Repository (CLDR) to v44.1 to match QLocale's data.

Change-Id: I8d89bef7370b93572a3dcf61f6713d4f21963e3d
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-06-02 15:25:00 +02:00
Giuseppe D'Angelo 48ab909c5d QDateTime::fromStdTimePoint: remove an unnecessary time_point_cast
The constraint now checks that the result of the clock_cast has a
duration which is convertible to milliseconds, so just do the
implicit conversion, without any cast for the duration.

Task-number: QTBUG-125587
Change-Id: Id2c8232d756318c3e4d33cd7e1556773961a9dba
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2024-06-02 11:52:11 +02:00
Jens Trillmann 9ec1de2528 Add Identifier role to QAccessible and use it in OS interfaces
* Unify the default identifier creation for QAccessibleInterface on
  all platforms to be the same as the previous identifier on Linux.
  This may change some identifiers on Windows.

[ChangeLog][QAccessible][QAccessibleInterface] Add possibility to
add unique identifier to QAccessibleInterface to give a11y elements
consistent identifiers.

Task-number: QTBUG-123361
Change-Id: I8c42956a4c497e71909d71dcb27bc87433937b69
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-06-01 22:58:20 +02:00
Ilya Fedin 3c93dedc06 Check D-Bus tray availability every time
It could appear in runtime, this allows applications to watch for it
themselves and re-create QSystemTrayIcon as needed.

Task-number: QTBUG-94871
Pick-to: 6.7 6.5
Change-Id: I10678cca4238ec0212c69155c9f22c07755ab1a8
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2024-06-01 21:50:20 +04:00
Thiago Macieira a98715c127 QByteArrayView: use memmem() to search for substrings
Let's just use whatever your C library provides, on the assumption that
it is optimized. Because it does the memchr() call when the size of the
needle is 1, we also skip the 1-char findByteArray() call.

It's been available on Linux since glibc 2.0, FreeBSD since 6.0, OpenBSD
5.4, NetBSD, Apple OSes, etc. even Solaris. If your OS doesn't have it,
you should ask your vendor to add it or consider upgrading to an OS that
already has it.

The glibc implementation[1] also uses a hashing for short needles and
the Two Way string search algorithm it describes as "a bad character
shift table similar to the Boyer-Moore algorithm" for longer ones. The
FreeBSD implementation[2] (which its man page says came from MUSL) uses
1-, 2-, 3-, and 4-byte search specializations before using the Two Way
search algorithm too.

[1] https://codebrowser.dev/glibc/glibc/string/memmem.c.html
[2] https://github.com/freebsd/freebsd-src/blob/main/lib/libc/string/memmem.c

Change-Id: If05cb740b64f42eba21efffd17d101e24528f7fd
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2024-06-01 11:27:05 -03:00
Allan Sandfeld Jensen e673e5a257 Merge applyGray, applyReturnGray, and apply methods
Combine all into a single flexible apply method.

Also fixes a few issues with RGB colorspace on gray input. Blocking CMYK colorspace on Grayscale and ElementListProcessing RGB on grayscale out.

Fixes: QTBUG-125303
Change-Id: I3987010062fbb5aa708aeb1cc239f3ce9413e34f
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2024-06-01 16:27:05 +02:00
Thiago Macieira 70dd53e3d3 uic: recognize <legal> tag as an alias for <comment>
That is printed at the top of the file and we've used it for the
copyright inside Qt, so just declare an alias.

[ChangeLog][uic] The Qt UI Compiler now accepts a <legal> XML tag to
indicate the copyright of the UI file and other legal terms of use. The
text of this tag will be emitted in the generated code. This tag is an
alias to <comment>.

Change-Id: If3345151ddf84c43a4f1fffd17d15ab77412e289
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-06-01 08:36:42 -03:00
Thiago Macieira d5dd7da3ee rcc: add the ability to output copyrights in the output
According to gnu.org[1]
> When a file is automatically generated from some other file in the
> distribution, it is useful for the automatic procedure to copy the
> copyright notice and permission notice of the file it is generated
> from, if possible.

This commit allows us to add copyright notices to the .qrc files
themselves and additionally have that be output into the generated .rcc
(of which we have a few committed to the repository)

[ChangeLog][rcc] The Qt Resource Compiler now accepts a <legal> XML tag
inside the main <RCC> entry, which can be used to document the copyright
of the resource file itself and other terms of use (even though the file
is probably created by a tool like Qt Creator's resource editor). The
text of this copyright will be emitted in the generated C++ or Python
source code.

[1] https://www.gnu.org/prep/maintain/html_node/Copyright-Notices.html

Change-Id: If05cb740b64f42eba21efffd17d00417433f1ee9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2024-06-01 08:36:41 -03:00
Thiago Macieira 24b1e52a1a QStorageInfo/Linux: reuse the file descriptor
We need it for the ioctl() to get the label and we already have it open.

Pick-to: 6.7
Change-Id: If3345151ddf84c43a4f1fffd17d3f7f1312ca185
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2024-06-01 08:36:11 -03:00
Thiago Macieira 8836b67778 QStorageInfo/Linux: use the mount ID to match paths to mountinfo lines
Linux kernel version 5.8 added support for the stx_mnt_id field in the
struct statx because "Systemd is hacking around to get it and it's
trivial to add to statx, so...". This allows us to much more neatly
match the lines in /proc/self/mountinfo.

The same kernel version added STATX_ATTR_MOUNT_ROOT so we can tell if a
given path is the mount point of a filesystem. We don't have a need for
that information for now.

We need to retain fallback code for two reasons: first, the user may be
running with an old Linux kernel, in which case we won't get the
STATX_MNT_ID bit set in stx_mask. Second, we may have failed to open()
the path in question, because the user may not have the necessary
permissions.

There's still a race condition because the mount IDs can be reused
immediately after something is unmounted. There's a 64-bit unique mount
ID (available since v6.8) but it's not reported in /proc/self/mountinfo,
so we couldn't us it right now. We can with 6.8's statmount().

Pick-to: 6.7
Task-number: QTBUG-125721
Change-Id: If3345151ddf84c43a4f1fffd17d3f7dbce4ff16b
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2024-06-01 08:36:02 -03:00
Thiago Macieira ad968d3602 QStorageInfo/Linux: re-work the mountedVolumes() check for mounted-overs
Commit ddc39eb3a4 ("QStorageInfo/Linux:
fix mountedVolumes() for paths mounted over") added a clever check that
did stat() on the path to figure out if it was the device that we'd just
found on /proc/self/mountinfo. But if the same device was mounted on top
again, we may have got the wrong answer.

More importantly, since kernel 6.9, btrfs subvolume mounts no longer
report the subvolume's block ID in /proc/self/mountinfo, which would
lead us to conclude every single subvolume has been mounted-over.

So let's revert back to string-matching later lines to see if any is a
parent path.

https://lore.kernel.org/linux-btrfs/2548140.Uh0CODmnKu@tjmaciei-mobl5/T/

Fixes: QTBUG-125721
Pick-to: 6.7
Change-Id: If3345151ddf84c43a4f1fffd17d3d59fef4446dd
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2024-06-01 08:36:01 -03:00
Ilya Fedin f6cd286e66 Don't fallback to X11 tray backend on non-X11
This allows to have system tray support on the fly on Wayland at least
where only QDBusTrayIcon is possible and no need to fallback to
QSystemTrayIconSys

Fixes: QTBUG-114439
Task-number: QTBUG-94871
Pick-to: 6.7 6.5
Change-Id: Ic927cde585ef02f9b9ef03f3b6338f35072bef70
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2024-06-01 10:44:48 +04:00
Thiago Macieira 9b2ae564a5 Remove QT_TERMINATE_ON_EXCEPTION: no longer needed
When Marc introduced them way back in 2012 in commit
c856e37c5f ("Logging: mark qt_assert()/
qt_assert_x()/qFatal() as nothrow"), he said:

> QT_TERMINATE_ON_EXCEPTION, which expands to something like
>   try { expr; } catch(...) { std::terminate(); }
> if the compiler doesn't support Q_DECL_NOEXCEPT

Well, all compilers now support noexcept, so we always had the plain do
{ } while (0) expansion instead.

Change-Id: If3345151ddf84c43a4f1fffd17d27dbc0f100ec7
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2024-05-31 22:02:06 -03:00
Thiago Macieira 4c12ae7e67 QByteArrayView: inline the char overload of lastIndexOf()
It's just memrchr()... which unfortunately is a GNU extension (picked by
FreeBSD and OpenBSD too), so we need to provide a fallback
implementation for other OSes and bootstrap mode.

By creating a new overload instead of doing the inlining trick, this
gets inlined in QtCore uses as well and has a simpler #ifdef'ery. We
still reach the C library function indirectly, but that's going to be
minimal (and unavoidable) overhead, more than offset by the gain in
accessing an optimized memrchr().

Change-Id: If05cb740b64f42eba21efffd17d0b681bcfe9cf3
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2024-05-31 22:02:06 -03:00
Marc Mutz 5bf0c3d5d3 QFormDataPartBuilder: allow to override mime-type autodetection
If QT_CONFIG(mimetype) isn't set, this class was silently creating
invalid output. If no mimetype is specified by the user and the type
cannot be deduced then omit the content-type header.

Change-Id: Iff15462b94fa1e992369df26f74b2bd64d523f31
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-06-01 00:14:35 +00:00
Giuseppe D'Angelo c4fc3a74b4 QDateTime::fromStdTimePoint: fix a call to fromMSecsSinceEpoch
The overload taking a Qt::TimeSpec is deprecated; we need to use
the one taking a QTimeZone instead. However I can't just use
QTimeZone because this is inline code in qdatetime.h, and QTimeZone
is only forward declared there. Moving the definition in qtimezone.h is
possible (like it's done for zoned_time), but that is a source break
(requires a new inclusion from users) and also weird (this function
doesn't deal with timezones, why do we need to include qtimezone.h?).

Instead, just add another overload of fromStdTimePoint that takes
precisely sys_time<milliseconds>. As such, it can be always available
even in C++17, and implemented out-of-line.

Even if this is a new symbol, the new commit policy allows the
backport. I also don't think this qualifies as a new feature;
it's a cleanup that we forgot to do (if we had a C++20-enabled
configuration in the CI when we also did the fromMSecsSinceEpoch
deprecation, we would've caught this).

Pick-to: 6.7 6.5
Change-Id: Ica77da291be4bcda2ffc7c164316a2977974c386
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2024-05-31 23:38:28 +00:00
Shawn Rutledge d06047698c QWindowPrivate::forwardToPopup: fix QMenu touch press-drag-release
QMenu doesn't handle touch events, but depends on mouse synthesis.
QGuiApplicationPrivate::processTouchEvent() calls
QWindow::forwardToPopup(), which sends it to the popup window, which
sends it to QMenu. The inherited QWidget::event() calls
QEvent::ignore(). It's important for forwardToPopup() to return nullptr
when the event is not handled, so that processTouchEvent() goes on to
create the synth-mouse event and send it to processMouseEvent(), which
calls forwardToPopup() again, which QMenu::mouseMoveEvent() handles.
And we also follow the usual pattern that when an event is duplicated
for delivery (as a synthetic event, or just to remap it), the accepted
state of the original event must be updated to reflect whether or not
the cloned event was accepted.

QTabletEvents are handled similarly.

Amends e4ef0f03e6

Change-Id: I0c6c03452a5b952161c9898d84d2c17afa52fc95
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2024-05-31 16:35:52 -07:00
Volker Hilsheimer 7afff8c16e JNI: remove tech-preview tag from documented APIs
Change-Id: I6493f53c747df16d9b54710627927e60f43edec1
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2024-06-01 00:24:35 +02:00
Volker Hilsheimer 93ae58fd3c Update QJniObject documentation to refer to QtJniTypes
Change-Id: I5d0c27625eac3ef1c619cb591af110b7659b769a
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2024-06-01 00:24:34 +02:00
Volker Hilsheimer aad13ef59c Document the QtJniTypes namespace and related macros
We use them heavily in Qt's Android code, so can be very certain that
they work as advertised. In order to properly document the respective
QJniObject and QJniEnvironment APIs and to move them out of
Technology Preview, we need to have those helpers documented as
well.

Change-Id: Ifd02cbdde892d7db721204eaf6f18ad59c53e8fd
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2024-06-01 00:24:34 +02:00
Tor Arne Vestbø 9122d826d2 macOS: Present Metal layer with transaction during display cycle
When our Metal layer changes its bounds or contents scale, for
example as a result of a window resize, or moving a window between
screens of different device-pixel-ratios, the layer will be marked
as needing display.

The changes to the layer will then make their way to the screen
as part of committing the root level CATransaction, managed by
the macOS display cycle, which synchronizes the presentation of
the bounds or scale changes to the screen's vertical sync.

By default, presenting a Metal drawable to a Metal layer ignores
any ongoing transactions, so the drawable ends up on the screen
as fast as possible. The downside to this is that the drawable
size or scale may be based on the yet-to-be presented bounds or
scale changes of the layer, as these happen when the display
cycle commits its transaction.

To ensure that the layer properties and content changes in lock
step we can enable the presentsWithTransaction property on the
Metal layer. We do so selectively when the layer is asked to
display, which happens during the display cycle, but not for
update requests (via our display-link).

This would normally be enough to ensure smooth and glitch free
resizing, as long as everything happens on the main thread.
Unfortunately, the [MTLCommandBuffer presentDrawable:] API we
use to present a Metal drawable when rendering in response to
update requests is actually scheduling the presentation on a
secondary thread com.Metal.CompletionQueueDispatch queue. The
result of this is that the presentation on the secondary thread
might race against a presentation on the main thread initiated
from the display-cycle, presenting too early, or overwriting
the layer's content with stale content.

To fix this we use [MTLCommandBuffer addScheduledHandler:]
explicitly instead, which lets us control what happens during
the presentation on the secondary thread. We then add a lock
to the layer that we lock as soon as the layer needs display,
and use this lock to skip presentations that should not step
on the toes of the display-cycle presentation. Once the display
cycle ends we unlock the lock.

The lock is a read-write lock, to ensure we prioritize the main
thread's display-cycle over any other presentations in case of
contention. We also defer update requests if we detect that the
lock is held, as there is no point in rendering a frame if we
are likely not going to present it. Doing this also prevents
the update-requests from starving the main thread from getting
its drawables.

The final case we have to account for is where the display
of the layer during the display-cycle is implemented by asking
another thread to do the rendering, as is the case with the
Qt Quick threaded render loop. In this case the main thread
is blocked while it waits for the render thread to complete
drawing and presenting a frame. But the actual presentation
of the Metal drawable still has to happen on the Main thread
for it to be part of the display-cycle's transaction.

To ensure the latter, we move the presentation of the drawable
to a block, that we schedule to be run on the main thread. Once
displayLayer is done with the expose event it processes the
deferred presentation, on the main thread.

Finally, to mitigate Qt Quick's threaded renderer running
animators without any coordination with the main thread, and
thereby starving it from drawables, we expose the inLiveResize
property on QNativeInterface::Private::QCocoaWindow, so that
the threaded render loop can step back during live resizing
and drive animators via the main thread's update request.

The QT_MTL_NO_TRANSACTION environment variable has been
kept, as an opt-out in case the new machinery breaks somehow.
It will disable the locked Metal layer, and all code paths
that depend on it.

[ChangeLog][macOS] Metal layers are now presented with
transactions during the display-cycle, which should fix
issues with the layer's content being out of sync with
the layer bounds or scale. If this causes issues, set the
QT_MTL_NO_TRANSACTION environment variable to opt out.

Fixes: QTBUG-107198
Fixes: QTBUG-114351
Change-Id: I765e11051c3a4d44b60ff10e787589feec8917a0
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2024-06-01 00:24:34 +02:00
Tor Arne Vestbø eb4cb71925 widgets: Use per-surface-format RHI support and compositor
The RHI support and compositor in QPlatformBackingStore were
tied to the surface format of the top level window owning
the backing store.

This meant that inserting an RHI-enabled widget (QRhiWidget,
QOpenGLWidget, QQuickWidget, QWebEngineView) into the widget
hierarchy required recreating the top level window with a
matching surface format that could support the RHI composition.

It also meant that we could not have two RHI enabled widgets
with different surface format requirements (Metal and OpenGL
for example) in the same top level widget hierarchy.

The recreation of the window had various visual side effects,
such as temporarily switching out of full screen state, or the
widget rendering a frame of black, as well as more serious
problems such as not correctly restoring the window geometry.

In addition, if client code had pulled out the winId() of the
window, and did not invalidate these references on window
destruction via QEvent::WinIdChange or QEvent::PlatformSurface,
the client would reference stale window handles. Although
this is a programming error (QWidget::winId() specifically
mentions this requirement), we should avoid recreation if
we can.

We were already supporting flushing the backingstore to
individual native child widgets, but always did so via a
single RHI managed by the platform backingstore. By
expanding QPlatformBackingStore to keep one set of RHI
support and compositor per surface format, we can refine
the logic in QWidget and QWidgetRepaintManager to not
require recreating the top level. Native child widgets
are then flushed independently, including any RHI textures
and raster content that overlaps with the widget.

We still assume that a single RHI support and compositor
can be be used for multiple windows, as long as those
windows have the same surface format. In the future, if
needed, we can refine this to use one set per surface
format e.g.

Fixes: QTBUG-119221
Fixes: QTBUG-121181
Fixes: QTBUG-120096
Task-number: QTBUG-115652
Task-number: QTBUG-108344
Task-number: QTBUG-113557
Task-number: QTBUG-119309
Change-Id: I2635ed3d20c2fb76eab3b8130007dd656a0b93e5
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2024-06-01 00:24:34 +02:00
Shawn Rutledge e4ef0f03e6 Move popup management from QApplication to QGuiApplication
We need to be able to have true popup windows in Qt Quick and Controls,
including handling the press-drag-release sequence to select one entry
from a menu or combobox. After the mouse press, a new window is created.
On some platforms (such as xcb), the new window gets window system grabs
of both keyboard and mouse (QApplicationPrivate::openPopup() calls
grabForPopup() and it actually works); while on others, the pre-existing
window continues to get the whole sequence of mouse events until the
release. In the latter case, Qt needs to forward events from the
original window to the popup. Until now, the list of popups was
QApplicationPrivate::popupWidgets.

Now we track the open popups as a list of QWindows rather than QWidgets,
in QGuiApplicationPrivate::popup_list, and add a set of static functions
to manage that list. Functions such as QApplication::activePopupWidget()
QApplicationPrivate::openPopup() and closePopup() are rewritten to make
requests to QGuiApplicationPrivate.

276943c8b7 made
QGuiApplicationPrivate::closeAllPopups() virtual. That is now reverted,
because we're putting QGuiApplication in charge of popup management
and trying to minimize widget-specific behavior. So far,
QApplicationPrivate::closePopup() is still overridden to take care
of focus changes.

So far, QtGui does not take care of closing popups when the user
clicks outside: the active popup window gets those events, and needs
to close itself if the click occurs outside. An attempt to move this
logic raised some issues with legacy widget test cases.

Using a touchscreen to press on QMenuBar and open a QMenu, drag to
a menu item and release, is temporarily broken for now. The plan is
to fix it in a subsequent patch.

Task-number: QTBUG-68080
Task-number: QTBUG-69777
Change-Id: I02b5034987b5ee8909917d305f414c8b0db9c7f5
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2024-05-31 10:40:31 -07:00
Eskil Abrahamsen Blomfeldt 1bc78f7739 Introduce flag to use typographical line metrics for fonts
For backwards compatibility reasons, font files have multiple different
ways to specify vertical metrics (ascent, descent, etc.).

For OpenType, the main two are the usWin* and sTypo* metrics in the OS/2
font table. The usWin* metrics are typically used as the clipping bounds
of the font (so no character will ever draw outside these bounds). The
sTypo* metrics thus make it possible to specify a different set of
metrics for use in text layouts which is smaller than the clipping
bounds (or bigger), so that you can have fonts where some characters
overlap with preceding or subsequent lines.

However, GDI (and thus many applications) use usWin* also for line
spacing, which lead to the sTypo* metrics being untrustworthy in some
fonts and later to the introduction of the USE_TYPO_METRICS in the OS/2
table version 4. The idea of this flag is to tell the font system that
the sTypo* metrics can be trusted and should be preferred over the usWin*
metrics.

But the OpenType specification states that sTypo* metrics should *always*
be preferred and modern font systems such as FreeType and DirectWrite
will respect this. This in turn has lead to fonts where the
USE_TYPO_METRICS flag is untrustworthy instead, i.e. the sTypo* metrics
are preferable, but the USE_TYPO_METRICS has accidentally not been set.

Qt trusts the USE_TYPO_METRICS flag and uses the usWin* metrics whenever
this is unset. Since QFontMetricsF::height() (ascent+descent) in this
case includes the line gap metric, a lot of components have been written
to use it for size without adding any margins over the text. So changing
the default now would break a large amount of components, including the
ones in our own Windows style.

Most fonts should work correctly, by setting the USE_TYPO_METRICS flag
if the typo metrics are intended to be used. For those that do not, we
introduce a PreferTypoLineMetrics style strategy.

[ChangeLog][QtGui][Fonts] Added QFont::PreferTypoLineMetrics for using
the recommended line spacing metrics of the font, even if the font has
not explicitly set its USE_TYPO_METRICS flag.

Fixes: QTBUG-125585
Change-Id: Ib2f7df404fe719186d78733bda26da712f1ab85a
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2024-05-31 19:30:53 +02:00
Volker Hilsheimer d41ae1a9a8 JNI: Fix static_assert for type registrations
Types signatures have to start with either "[L" (array of class)
or "L" (just class), and end with ";". Only "[" (array of primitive
type) makes no sense, esp since we also require a terminating
";".

Change-Id: Iea9ce992c31a34639016c967f813ebf9343c6978
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2024-05-31 19:30:53 +02:00
Christian Ehrlicher 102670a82e SQL/QSqlRecord: rework QRecord::indexOf(QStringView)
Move it to the private implementation to be later used as a template
when switching to QAnyStringView.

Change-Id: If9977711757677546cfc058602ada9f54b978509
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-05-31 19:30:53 +02:00
Christian Ehrlicher 5a7c2cbabb QSqlDatabase: Rename currentThread() to thread()
... to be in sync with QObject naming.
This amends b4c63b89df.

Change-Id: I25301f65aa880205d8c0cfd6f4bfa9fdba34a01c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-05-31 19:30:53 +02:00
Christian Ehrlicher 60061f679c QIcon: don't load image twice
QIcon::addPixmap() creates an icon engine when not yet available. During
the initialization, the filename of the image is already passed to the
icon engine and some (e.g. svg icon engine) already loads it. Afterwards
the image is loaded again with addFile(). Avoid this by checking if the
ctor of the icon engine already loaded the file and don't call addFile()
afterwards in this case.

Fixes: QTBUG-8151
Change-Id: I9289f17e5d703c08a82ce51ce8bded70feb6f82d
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-05-31 19:30:52 +02:00
Christian Ehrlicher 6843e5d26d QIcon: remove redundant nullptr check
Remove a redundant nullptr check found by CodeChecker.

Change-Id: I03327475e1df8de27459457fc8fc2c66592889ab
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-05-31 19:30:52 +02:00
Ahmad Samir f26ada15a7 QDirListing: improve the API docs
Change-Id: I27bfc958f278b8e450d0e67b15bcd0dc68476027
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-05-31 20:30:52 +03:00
Allan Sandfeld Jensen ce33e47667 Add Bt2020 and Bt2100 color spaces
[ChangeLog][QtGui][QColorSpace] Bt.2020 and Bt.2100 (aka HDR10) formats
have been added.

Task-number: QTBUG-114722
Change-Id: I4ffce460202837e1077e34f48a9286981ee444bb
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2024-05-31 16:24:52 +02:00
Allan Sandfeld Jensen 53ad7b2d9b Complete color space toICC write
Also write gray, CMYK and mAB RGB color space profiles.

Fixes: QTBUG-125302
Change-Id: Id3b3b64537b9c08f1d40b8243c228ad111d08289
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2024-05-31 16:24:50 +02:00
Lars Schmertmann 57595bd90a Android: Fix missing EXTRA_SOURCE_INFO onResume
Amends 3b6d288e3b.

Pick-to: 6.7
Change-Id: Ib135d8e04b1a7b95dde5cc220472b922069df86e
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2024-05-31 15:03:19 +02:00
Volker Hilsheimer fc96d9d27d Rename AT-SPI specific DBusConnection type to fix clang warnings
DBusConnection is forward declared as a class, and after
c9e62c2444 we include a header that
forward declares it as a struct. This triggers a warning, and also
indicates that we have an ODR violation.

Rename the offending type in Qt.

Fixes: QTBUG-125623
Change-Id: I13ffdceec82b86910a60083aebc2afc47f9f3a4e
Reviewed-by: Tim Blechmann <tim@klingt.org>
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
2024-05-31 13:52:05 +02:00
Eskil Abrahamsen Blomfeldt f09f70fcdf Update to Harfbuzz 8.5.0
Pick-to: 6.7 6.5 6.2 5.15
Change-Id: Icfc5300598cf0ee58e3d791326b7f37b27a1c9c0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-05-31 08:19:23 +02:00
Aleix Pol 244964d06a testlib: Integrate the new object type in the unit testing system
It seems like all subclasses of QAccessibleEvent need to be registered
here, otherwise tests explode.

Change-Id: I924961f351bda1f50e2c73d54abe4b51162dc82a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-05-31 05:13:50 +02:00
Soheil Armin 876991d8b7 Android: Add variable to opt-in QtQmlComponent code generation
The CMake variable QT_ANDROID_GENERATE_JAVA_QML_COMPONENTS
will add "is_generate_java_qml_components" property to the
android-deployment-settings.json file to be read by
androiddeployqt, that enables/disables QtQmlComponent Java
code generation of QML components.

Task-number: QTBUG-124846
Change-Id: I5b3dc009aaa18beaa533296ce489e09c09d864e0
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
2024-05-31 00:58:13 +03:00
Soheil Armin 7282c54fe6 Android: Add Java QtQmlComponent code generator to androiddeployqt
The QtQmlComponent class is a public Java API in Qt Declarative.
ADQt extracts QML dom info using qmldom tool, and creates concrete
classes, extending QtQmlComponent, by implementing abstract methods
of it, based on target lib, QML modules & QML components.

Additionally, it iterates properties and signals of each component
and adds get/set/connect methods with appropriate arg/return value
types, to each component. Java class generation will be invoked if
generate-java-qml-components is true in the deployment settings
file.

The generated classes will be in the same package name as the target.
If the leaf part of the package has the same name as the target,
a new .java file will be created for each module, else Java code
for all modules will be generated under a root level static class
with the same name as the target name in a single .java file with
the same name as the target name.

The first letter of target name & module names get caplitalized
to match Java naming convension.

Task-number: QTBUG-124846
Change-Id: I1f94e059a6573991c991bccc32838a211f3ee456
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-05-31 00:58:09 +03:00
Tor Arne Vestbø 8f6b27fdee QOpenGL2PaintEngineEx: Store context via QPointer
The QOpenGLBuffers used by QOpenGL2PaintEngineEx are tied to a specific
share group on creation, via QOpenGLSharedResourceGuard.

If QOpenGL2PaintEngineEx is later used with a recreated QOpenGLContext,
that happens to live at the same address as the previous one, we will
fail to detect that the context has changed by using a naked pointer
comparison (ABA problem).

If the share group of the new context is different, this will cause
problems down the line in QOpenGLBuffers::bind(). This scenario has
been observed on Android, where the context created in
QOpenGLWidgetPrivate::initialize() ends up with the same address,
but then adopts a new share context from RHI, because the widget has
been moved to a different top level window.

To remedy this, we store the QOpenGL2PaintEngineEx's cached context
via a QPointer, so that we pick up the B state of ABA (null), and
correctly throw away the old buffers in QOpenGL2PaintEngineEx::begin.

Pick-to: 6.7
Change-Id: I5c221a37fd95f846d96e72509bba54f3d10fee3a
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2024-05-30 22:23:35 +02:00
Marc Mutz 5677c111cb QFormData(Part)Builder: simplify filename formatting
We don't need the bodyName member, because it's the same as
originalBodyName, just encoded, and we can delay the encoding to
build() time.

This is not worse than the old code, since we anyway toString() the
QAnyStringView unconditionally.

So we don't need to visit the QASV and implement RFC2232 encoding for
all three view types, we can just use the QString version, after
toString().

This not only has the advantage of less code and not storing duplicate
data, but we now also encode u8"ä.txt" the same as "ä.txt"_L1 and
u"ä.txt", ie. using latin1, as required by Postel's Law, and not as
UTF-8, as the old code did.

Change-Id: If82a33a1cd09b859b3a4450a60083b1d3aedf7bc
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2024-05-30 20:52:42 +02:00
Mate Barany 32610561e3 Add convenience classes to generate QHttpMultipart messages
Constructing and composing a QHttpMultipart contains some aspects that
are possible candidates for automating, such as setting the headers
manually for each included part. As a reference, when issuing a default
multipart with CURL, one does not need to manually set the headers.

Add the class QFormDataPartBuilder to simplify the construction of
QHttpPart objects.

Add the class QFormDataBuilder to simplify the construction of
QHttpMultiPart objects.

[ChangeLog][QtNetwork][QFormDataBuilder] New class to help constructing
multipart/form-data QHttpMultiParts.

Fixes: QTBUG-114647
Change-Id: Ie035dabc01a9818d65a67c239807b50001fd984a
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2024-05-30 18:52:42 +00:00
Eirik Aavitsland a5953d20e2 Add QPaintDevice metric query to get precise fractional DPR value
For compatibility reasons, QPaintDevice needs to query subclasses for
device metrics as int values. To report fractional DPR values, they
have been multiplied with a large constant and divided back
afterwards. However, the loss of accuracy introduced by this, though
tiny, could still lead to rounding errors and painting artefacts when
the values where multiplied up for large coordinates.

Avoid this issue by adding a metric query that transports the full
floating point value encoded as two ints.

[ChangeLog][QtGui] Added new QPaintDevice metrics for querying
fractional device pixel ratios with high precision. Custom paintdevice
classes that support fractional DPRs are recommended to implement
support for these queries in metric(). Others can ignore them.

Fixes: QTBUG-124342
Change-Id: Ia6fa46e68e9fe981bdcbafb41daf080b4d1fb6d7
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-05-30 20:51:46 +02:00
Rym Bouabid 890c270b9b QPointer: Use new comparison helper macros
Provide the new comparesEqual() helper function as an implementation of
(in)equality operators.
Use QT_DECLARE_EQUALITY_OPERATORS_HELPER macro instead of
Q_DECLARE_EQUALITY_COMPARABLE for the comparison between QPointer<T>
and QPointer<X> to avoid creating the reversed version of the
operators in C++17 mode.

Use new \compares command in the documentation to describe the
comparison operators provided by QPointer.

Task-number: QTBUG-120306
Change-Id: Iff24d3ef5c790de7f06ab825f853e06186fa1471
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-05-30 20:51:46 +02:00
Edward Welbourne 99475db542 Revise Windows time-zone mapping to use proper IANA IDs
The CLDR's "IANA" IDs may (for the sake of stability) date back to
before IANA's own naming has been updated. As a result, the "IANA" IDs
we were using were in some cases out of date. CLDR does provide a
mapping from its stable IDs to all aliases and the current IANA name
for each (which I shall soon be needing in other work), so use that to
map the CLDR IDs to contemporary IANA ones.

Revise the documentation of CldrAccess.readWindowsTimeZones() to take
this into account, pass it the alias mapping from the table, use that
to map IDs internally and, in passing, rename a variable.  Update
cldr2qtimezone.py to match the new CldrAccess methods and regenerate
the data.

Change-Id: I23d8a7d048d76392099d125376b544a41faf7eb3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mate Barany <mate.barany@qt.io>
2024-05-30 20:28:55 +02:00
Edward Welbourne e2e5ab0932 Add QTimeZone::aliasMatches()
This makes it possible for the stdCompatibility() test to cope with
the backend (based on the Windows Registry, which disagrees with MS's
ICU-based std::chrono::tzdb) successfully constructing a zone, by
finding a known alias, instead of failing because it doesn't know the
name. It may also be useful to client code when dealing with legacy
names.

Amended some existing tests to only expect what they now should and
added some tests specific to aliasMatches(). Also added some
explanative comments where it isn't needed.

Task-number: QTBUG-115158
Change-Id: I095bdbead78df339e29b29518d5010ef905fa8b2
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-05-30 20:28:55 +02:00
Tatiana Borisova bf9f6791cd Put conditioned header under appropriate feature configuration
- Add #if QT_CONFIG(xmlstream) for qxmlstream.h usage
in removed_api.cpp

Amends cd5dd8b95b

Change-Id: Ibb5962ff1ee9d26a2f115c6cf0a8b9b88109fab7
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-05-30 19:33:20 +02:00
Alexei Cazacov ce26eaf1b9 Docs: Update the obsolete requirements for Q_OBJECT and Q_GADGET
Since 6.5, you can declare the Q_OBJECT macro in any class section, not
only in private. The docs are updated accordingly. The Q_OBJECT macro
specifies a private section on its own, thus making private all the
members declared after the macro. This is an important behavior change,
so the note about it was rewritten for clarity & moved a little bit up.

Fixes: QTBUG-125776
Pick-to: 6.5 6.6 6.7
Change-Id: Ifba063af7cf7fe7258b6183da5a4599784171052
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
2024-05-30 19:05:04 +03:00
Marc Mutz 2b6a77cd15 QMessageAuthenticationCode: add hashInto() overloads
Same change as previously done for QCryptographicHash; same rationale
applies.

[ChangeLog][QtCore][QMessageAuthenticationCode] Added hashInto()
methods, see QCryptographicHash for more information.

Fixes: QTBUG-125431
Change-Id: I88a15479b020b39ff0669a9615793886289c83f7
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-05-30 06:23:45 +00:00
Volker Hilsheimer 87896c03c1 QIcon: enable icon engine plugins to implement themes
So far, the keys of icon engine plugins were only interpreted as the
suffix of icon files, loaded via QIcon(filename). However, an icon
engine could provide a lot more flexibility if it could implement an
entire theme.

Match the list of keys a plugin can register itself with also against
the current theme name. If a matching plugin is found, use that plugin
to create the icon engine. Store the factory from the plugin to avoid
costly lookups for each icon.

Extend the QIcon test case by adding a custom plugin that supports two
themes. Since the plugin and icon engine creation infrastructure
doesn't communicate which theme the plugin was created for, use
QIcon::themeName to record the current theme when the engine gets
created.

[ChangeLog][QtGui][QIconEnginePlugin] The keys registered by an
QIconEnginePlugin implementation are now also matched against the
current theme (system or user theme), allowing engine providers
to implement entire themes through a plugin.

Change-Id: I8a5e30ff8b5bb7c78b5204e82760e4328671e4c1
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-05-30 02:36:04 +02:00
Marc Mutz 5831c31235 totally_ordered_wrapper: add swap and qHash overloads; std::hash specialization
Pointers have these.

We also have qt_ptr_hash for raw pointers, so add an ADL overload for
that, too.

Don't provide a member-swap, since raw pointers don't have that.

Change-Id: I1517588d2ff1aa5caf06ad5861ff09d5e7652183
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-05-30 00:40:38 +02:00
Marc Mutz d397ae4c06 totally_ordered_wrapper: make default-constructible
Pointers are.

The default-constructor is = default'ed, meaning it has the same
semantics as the raw pointer it replaces:

   totally_ordered_wrapper<int*> p; // partially-formed (uninit'ed)
   totally_ordered_wrapper<int*> p{}; // well-formed (nullptr)

   totally_ordered_wrapper<int*> a[1024]; // doesn't write 8KiB of NULs

Change-Id: I0d2e906bc5ec45d95b03a3af451167fec84439fd
Reviewed-by: Rym Bouabid <rym.bouabid@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-05-30 00:40:38 +02:00
Marc Mutz 9dbe681218 totally_ordered_wrapper: make ctor noexcept
Copying pointers is noexept.

Adding unconditional noexcept doesn't limit us to switch to
conditional noexcept going forward, because any P for which
copy-construction isn't noexcept is currently excluded by the
static_assert(is_pointer).

Change-Id: I475e6294515a4c76bb31974cd6fd458fb0c0d42e
Reviewed-by: Rym Bouabid <rym.bouabid@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-05-30 00:40:38 +02:00
Marc Mutz ccb8efbfe5 qminmax.h: move QTypeTraits part to qttypetraits.h
Makes sense to collect the stuff in a similarly-named header.

Change-Id: Ic4190932a32fa06f1219473583327424dd2a8c11
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-05-30 00:40:38 +02:00
Tatiana Borisova d5493d616f Put conditioned header under appropriate feature configuration
- Add #if QT_CONFIG(mimetype) for qmimetype.h usage
in removed_api.cpp

Amends 5dbd6a44d8

Change-Id: I0ef3c07bba7c3df56cfd1551d8962ab2efc15651
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Tasuku Suzuki <tasuku.suzuki@signal-slot.co.jp>
2024-05-29 20:40:10 +02:00
Wladimir Leuschner b457376c03 QWindows11Style: Increase min size of QAbstractSpinbox Widgets
With WinUI3 a new layout of the lineedit and buttons was introduced. The
buttons are now aligned horizontally instead of vertically. Trying to
mimic that layout in widgets results in too few space for the text in
the lineedit. This patch increases the minimum width when using the
QWindows11Style for QAbstractSpinBox elements and saves the original
width in a property in case the style is changed at runtime to restore
the original geometry.

Fixes: QTBUG-124235
Fixes: QTBUG-124150
Pick-to: 6.7
Change-Id: I8067b338fa4a2c1efd0a1b0644fb8a563601385b
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-05-29 20:12:45 +02:00
Marc Mutz 5c1ea2c57f Export QLatin1::convertFromUnicode()
We need it in QtNetwork.

Change-Id: I6d26592ee79bffc7390ea742892f134e69ad77b1
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-05-29 12:27:54 +00:00
Marc Mutz 88b1c96239 QAnyStringView: fix char-ish ctors to not allocate memory
Extending the fromCharacter() tests to check for the construction to
be noexcept and implicit turned up a few bugs:

The constructor from char32_t was simply not marked as noexcept, even
though all its operations were. So just mark it noexcept.

The constructor from QChar, otoh, was never called, (certainly not for
rvalues), because QString happens to be constructible from QChar (and
QLatin1Char and QChar::SpecialCharactor), so due to perfect
forwarding, the if_convertible_to<QString> ctor won, allocating a
QString.

This is a regression of Qt 6.5 compared to Qt 6.4.

To fix this, exclude arguments that convert to QChar from matching the
if_convertible_to<QString/QByteArray> ctors, taking care to not match
those arguments that are already compatible_char<>s.

This, in turn, creates a problem for implicit QASV construction from
QLatin1Char and QChar::SpecialCharacter, because now that we've
excluded them from the if_convertible_to<QString> ctor, calling the
existing QChar or QString non-template constructors for these types
would require two user-defined conversions (from said type to
QChar/QString and from QChar/QString to QAnyStringView). That works
for explicit construction, but we need implicit convertability.

So bring out the big guns once more and add a perfectly-forwarding
ctor for anything convertible to QChar. QChar itself is actually
already handled by compatible_char<>, so the old QChar non-template
ctor can go. The extra copy of the QChar argument will be optimized
away by the compiler.

[ChangeLog][QtCore][QAnyStringView] Fixed a regression where
constructing a QAnyStringView from a char-like type (QChar,
QLatin1Char, ...) would first construct a QString and only then
convert that to QAnyStringView.

Amends 812a0d3125.

This change is forward and backward BC and SC, but not
behavior-compatible: certain operations detectably change
noexcept'ness, and some arguments may now cause the resulting
QAnyStringView to have a different encoding (though I really tried
hard to avoid that).

Since it's a regression, I proposed to pick this to the affected
branches, 6.7 and 6.5 (6.6 is already closed at this point).

Pick-to: 6.7 6.5
Fixes: QTBUG-125735
Change-Id: I86f37df5d80bee36db27e529c017cb73995a6831
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-05-29 14:24:30 +02:00
Marc Mutz d8131960d8 QUuid: port createUuidV{3,5}() to QByteArrayView
Requires to mark the existing QString overload as Q_WEAK_OVERLOAD.¹
And since this non-polymorphic class is exported wholesale, we need to
involve REMOVED_SINCE here, too.

¹ While QString and QByteArray don't overload well, the new overload
  set makes calls with QByteArray arguments ambiguous, unless the
  QString overload is demoted to a weak one.

As a drive-by, change the QUuid argument passing from cref to
by-value, fixing a Clazy warning.

[ChangeLog][QtCore][QUuid] Ported createUuidV3() and createUuidV5()
from QByteArray to QByteArrayView, made them noexcept, and fixed
various ambiguities in the overload set.

Change-Id: I9f71209f2ddb58ace4e15fb68418b1a21d2b3602
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-05-29 14:24:30 +02:00
Marc Mutz fa8256bb5a QCryptographicHash: extend hashInto to more than one piece of data
This allows use of the noexcept static function in cases where more
than one piece of data needs to be hashed, and concatenation of said
data would have to allocate memory.

Port QUuid to use the new function, allowing to mark the V3 and V5
create functions noexcept.

As a drive-by, take QUuid by value in the internal helper function,
fixing a Clazy warning.

Task-number: QTBUG-125431
Change-Id: I17938f0be44c91085e2aaa5574953f8dceacc990
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-05-29 14:24:30 +02:00
Marc Mutz c70c81b371 Long live QCryptographicHash::hashInto()!
Until now, QCryptographicHash had a big drawback over the underlying
C APIs: at least one extra memory allocation: Either you created a
QCryptographicHash object (allocates a Private), and enjoy noexcept
addData() and resultView(), or you used the static hash() function
(which creates a Private on the stack, so doesn't need to allocate
one), but then we needed to return in an owning container.

Enter QSpan and hashInto(), which allow the user to provide a buffer
into which to write, and therefore can be completely noexcept and
(apart from a missing optimization which, however, doesn't affect the
API) deliver near C-API efficiency.

We don't have QMutableByteArrayView, which would deal with the
different types of equivalent char types for us, so we overload for
QSpan<std::bytes>, QSpan<char> and QSpan<uchar>, which makes the
overload set accept roughly what QByteArrayView would accept, too.

Return by QByteArrayView because that has a richer API than QSpan,
which lacks (on purpose) string-ish API.

[ChangeLog][QtCore][QCryptographicHash] Added hashInto().

Task-number: QTBUG-125431
Change-Id: I80ecc7151d3418a36c4d5db6d22d0b82c869b19f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-05-29 14:24:29 +02:00
Giuseppe D'Angelo 0dca6c40e1 PDF: use a map, not a hash, to write the dest roots name tree
A PDF name tree is sorted, so just use a sorted data structure for that.
This simplifies the code.

This work has been kindly sponsored by the QGIS project
(https://qgis.org/).

Change-Id: Ib08b14aaf79c9180319efe7fefa9e797a4364d54
Reviewed-by: Albert Astals Cid <aacid@kde.org>
2024-05-29 09:43:18 +02:00
Christian Ehrlicher 2f9c72028d QTreeView: optimize Private::intersectedRect()
The implementation for QTreeViewPrivate::intersectedRect() calculated
the view rect for every single index which is not needed:
 - when the row is spanned, the first item spans the complete viewport
 - the x-position of an index in the same column but different row is
   the same so no need to re-calculate the boundaries again (similar to
   the implementation in QTableView)

This reduces the visualRect() call count from n*m to n+m

Task-number: QTBUG-124173
Change-Id: I651b2ff9b6d4e68a82f32b3f5c3c0e746f88ce5e
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-05-29 06:17:25 +02:00
Giuseppe D'Angelo 64b6a2aa70 PDF: code tidies
Take by QByteArrayView instead of const QByteArray &.

This work has been kindly sponsored by the QGIS project
(https://qgis.org/).

Change-Id: I2a5b96ba81fc16487e25be3e957c50ea1b11be76
Reviewed-by: Albert Astals Cid <aacid@kde.org>
Reviewed-by: Tobias Koenig <tobias.koenig@kdab.com>
2024-05-29 04:23:16 +02:00
Giuseppe D'Angelo a3a91c947c PDF: write a TrimBox
This is necessary for PDF/X-4 conformance (§ 6.12), but does not
hurt specify it always, matching the MediaBox.

This work has been kindly sponsored by the QGIS project
(https://qgis.org/).

Change-Id: Ifc698f271eb1217da15413e4bf25321dea2e955f
Reviewed-by: Tobias Koenig <tobias.koenig@kdab.com>
Reviewed-by: Albert Astals Cid <aacid@kde.org>
2024-05-29 04:23:16 +02:00
Giuseppe D'Angelo 67dffd871f QPdf: do not write a /Filter key if we are not compressing
Streams may or may not be compressed depending on zlib availability,
so fix this dictionary.

This work has been kindly sponsored by the QGIS project
(https://qgis.org/).

Change-Id: I852569f053a1338d4bc54be5e8fb1e9c7741a5a1
Reviewed-by: Tobias Koenig <tobias.koenig@kdab.com>
Reviewed-by: Albert Astals Cid <aacid@kde.org>
2024-05-29 04:23:16 +02:00
Tor Arne Vestbø fd97a820df macOS: Add support for safe area margins
We reflect both the NSView's own safeAreaInsets as well as the screen's
safeAreaInsets mapped to the view. This covers both in-window views that
obscure the view, e.g. toolbars or the titlebar, as well as areas outside
of the window that affect the window if it has geometry that overlaps
these areas (such as the notch on MacBook Pro laptops).

Fixes: QTBUG-125372
Change-Id: I17af7f456ade83eef910ef5b0eaeab7cd8075263
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2024-05-29 03:27:18 +02:00
Tor Arne Vestbø bee9de0452 iOS: Enable the Qt Print Support module
The print support module was disabled for the initial port of Qt
for iOS due to the lack of a native print backend and native
print dialogs, as we have on macOS.

However, even lacking these we should be able to offer the print
to PDF feature, with widget based print dialogs. We can do so
by opting in to the generic Unix print dialogs and backends,
as these do not have a hard dependency on CUPS.

Longer term we should adopt UIPrintInteractionController,
UIPrinterPickerController, and UIPrinter, but that's a bigger
task.

[ChangeLog[iOS] The Qt Print Support module is now enabled,
allowing printing to PDF. Printing to system provided printers
are not yet supported.

Fixes: QTBUG-125581
Change-Id: I5bc143e47c7277b3cea52760672ac4d0c8a7a898
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2024-05-29 03:27:18 +02:00
Lorn Potter d67d49f45e wasm: fix uri-list handling urls
We were only handling the case where uri-list was a file.
This fixes a regression.

Also - add dragging url into the clipboard manual test

Pick-to: 6.7 6.7.1
Change-Id: Ifbd087ffd157463b6b903199e3ff22c2de1c4942
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2024-05-29 08:18:06 +10:00
Giuseppe D'Angelo 0effdc98dc PDF: fix the encoding for the file name of attachments
A file specification in PDF is a string (§3.10.1 of the PDF 1.6 spec).
As such, it needs to be properly encoded. Right now the code was
doing a naive conversion to latin1 (which was lossy), and was not
considering things like round parenthesis which need to be properly
escaped. Just use printString instead.

This work has been kindly sponsored by the QGIS project
(https://qgis.org/).

Change-Id: Icdcf8b553955d31fe2bc430dea54bb6e68221fc7
Pick-to: 6.7 6.5
Reviewed-by: Albert Astals Cid <aacid@kde.org>
2024-05-28 21:17:46 +02:00
Giuseppe D'Angelo e95812df85 QDateTime::fromStdTimePoint: fix the constraint
The constraint requires the input time_point's duration to be
convertible to milliseconds. That's inaccurate: we need to check the
duration of the time_point we get from the clock_cast, not the input.
In general, clock_cast is allowed to return arbitrary durations, so
it may not match the input. (It indeed doesn't match for some
standard clocks, like gps_clock.)

Pick-to: 6.7
Task-number: QTBUG-125587
Change-Id: I5a93317c8cdc0a3cef4acab17c656e2e5dac5d8d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-05-28 21:11:23 +02:00
Giuseppe D'Angelo cbbe28d85c QPdf: cleanup date formatting in the XMP metadata
Instead of manual formatting, use ISO 8601, which is what XMP wants.
Specifically, XMP part 1 delegates datetime formatting to

  Date and Time Formats, W3C submission, September 1997
  http://www.w3.org/TR/NOTE-datetime

with a note that the time zone designator need not be present
in XMP.

This work has been kindly sponsored by the QGIS project
(https://qgis.org/).

Change-Id: I0468ca21e1cfde47fabdd764af215a2af2efadae
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2024-05-28 21:11:23 +02:00
Marc Mutz d61060dabf QString: toward UTF-8 arg() support [1/4]: port Part to QAnyStringView
Most of the Part internal type (except 'number') was one of two
QAnyStringView-look-alikes originally developed for
QStringView/QLatin1StringView arg() support.

Clean it up to use QAnyStringView directly, thus taking the first step
towards UTF-8 support in QString/View::args().

While we can't encounter UTF-8 Parts with this patch, yet, adjust the
concatenation logic to deal with them already: the concatenation
code-path required by the call to visit(), and the result truncation
due to the potential overestimation of UTF-8 decoded lengths.

Task-number: QTBUG-124365
Change-Id: Idcbcbf10fa8125026115201b963877efe498a18b
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-05-28 21:11:23 +02:00
Tatiana Borisova 9f4f4efb62 Put conditioned header under appropriate feature configuration
- Add #if QT_CONFIG(itemmodel) for qitemselectionmodel.h usage
in removed_api.cpp

Amends 6324075a2d

Change-Id: If979d954caa6992a1e38675e8309fb33fe6b1ea2
Reviewed-by: Tasuku Suzuki <tasuku.suzuki@signal-slot.co.jp>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-05-28 21:11:23 +02:00
Kai Köhne 469367dc08 Doc: Hint about QtMsgType order
You could get the idea that the underlying int value is indicative
of the severity. Make it more explicit that the order in the text
is the correct one, and reorder for Qt 7.

While at it, remove mentioning of Qt 5.5.

Pick-to: 6.7
Fixes: QTBUG-102347
Change-Id: I5d1b46afb37e50baa209a06c192a943980ca774b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2024-05-28 20:19:14 +02:00
Fabian Kosmale 5573ca3599 qt.conf: add private "merge_qt_conf" option
This is meant to allow the buildsystem to add additional paths (for e.g.
QML imports) while still allowing the application to pick up the paths
where e.g. Qt's plugins are located – without having to query qtpaths or
the build system to locate them first, and to then also add them to
qt.conf.
QLibraryInfo::paths will return a list containing any values provided in
qt.conf, followed by the value that would have been provided if there
were no qt.conf file.
If no value is provided at all for a given key in qt.conf,
QLibraryInfo::path will behave as if no qt.conf file was provided,
instead of using LocationInfo::defaultValue.

For now, this is considered to be internal only, and won't be
documented.

Change-Id: Ic74c66b5cbde605b43336cd88c3f909999381f46
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-05-28 20:19:14 +02:00
Vlad Zahorodnii 59b7e143a9 xcb: Correctly report whether QInternalMimeData::retrieveData_sys() fails
QMimeData::retrieveData() checks whether the returned QVariant value is
valid, i.e. the variant contains some data. If the variant contains an
empty QByteArray, it will be considered valid.

So retrieveData_sys() should return QVariant() in case data with the
specified mime type cannot be retrieved.

Fixes: QTBUG-125531
Pick-to: 6.7 6.5 6.2 5.15
Change-Id: I0a668ca7ad5b2c5430335e8554cc597747287173
Reviewed-by: Liang Qi <liang.qi@qt.io>
2024-05-28 18:19:14 +00:00
Marc Mutz 54f2229714 QChar: remove QT_IMPLICIT_QCHAR_CONSTRUCTION opt-in
Users had eight Qt releases to adjust their code, remove the opt-out
now.

[ChangeLog][QtCore][QChar] Removed the QT_IMPLICIT_QCHAR_CONSTRUCTION
opt-in. The respective QChar constructors (`(int)`, `(uint)`,
`(uchar)`, `(uchar, uchar)`) are now always explicit.

Change-Id: I2cca1f98d486840f9e6bcd6c07678f0dd81832e5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-05-28 19:52:06 +02:00
Christian Ehrlicher 0efd2e084d QIcon/QIconLoader: misc cleanup
Cleanup QIcon:
 - factor out actualSize() calculation
 - factor out deleting invalid pixmap entry
 - don't overflow on int*int calculation
 - use quint8 for state and mode in cacheKey calculation
 - sync cacheKey calculation
 - make QIconPrivate::pixmapDevicePixelRatio() static

Change-Id: I7716b6f69687b6e5c910a0cb180b32b2de9a015d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-05-28 19:52:06 +02:00
Christian Ehrlicher 94919aea6a Doc: remove all \since 4.x comments in gui/image
Remove all \since 4.x comments in gui/image - this is no longer of
interest.

Change-Id: Ic2d7252293f1951fb202ea907999301581671081
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Inkamari Harjula <inkamari.harjula@qt.io>
2024-05-28 19:52:06 +02:00
Marc Mutz 89f184b403 QLatin1StringView: fix UB in "a"_L1 <> nullptr
Found by ubsan: if rhs is nullptr, then we fed a nullptr as the second
argument of memcmp(), which is UB.

Fix by catching an empty rhs before we reach that line.

Amends e52d50a03d (which, despite
pick-to's to the contrary, never made it into 6.2 or 5.15).

Change b977ae371a fixed this for
UTF-8/UTF-8 comparison from 6.5 on, but 6.4 ad 6.3 remain vulnerable
there, but they're closed, so can't be fixed anymore.

Pick-to: 6.7 6.5
Change-Id: I12fa986aa82a7440a9d53fad19a15e9420233e0b
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-05-28 19:07:44 +02:00
Axel Spoerl a910daf526 QDockWidget::setFloating() - reparent floating tab to main window
setFloating() called on the 2nd last dock widget in a floating tab
didn't cause reparenting to the main window. The dock widget remained
parented to a QDockWidgetGroupWindow, while no longer being part of
floating tabs. The QDockWidgetGroupWindow would therefore have only
one tab, which is an inconsistent state and causes crashes.

Factor out the implementation of setFloating() to a new
QDockWidgetPrivate::setFloating(). Reparent to the main window, if
the dock widget is part of floating tabs.

Add test functionality in tst_QDockWidget::setFloating().
Turn createFloatingTabs() into a macro, in order to QSKIP() in the test
function's scope.

Fixes: QTBUG-122394
Pick-to: 6.7 6.5
Change-Id: I3719785f310b131446cdea908f09b7195c992b3e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-05-28 15:41:15 +02:00
Giuseppe D'Angelo a9ba0e9634 PDF: emit the Trapped entry in the document info dictionary
Since we don't have any API to specify trapping info, mark
the document as untrapped. (PDF/X-4 requires the entry, and
requires it to be true or false. The default would be "unknown"
but that's not allowed by X-4.)

This work has been kindly sponsored by the QGIS project
(https://qgis.org/).

Change-Id: Id8c3a4356ba5bb74877473549e55ccbb6839b07e
Reviewed-by: Albert Astals Cid <aacid@kde.org>
2024-05-28 15:25:04 +02:00
Allan Sandfeld Jensen 5a2b222619 Fix alpha scaling in format changing qcolortransform
Fixes: QTBUG-125306
Change-Id: I5da11df7a27d1947772f5b90a717df1e258fde45
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2024-05-28 15:22:52 +02:00
Marc Mutz e0d87f70d8 Replace QUuid::toRfc4122() with toBytes() where possible
They're content-equivalent, except that the latter doesn't have to
allocate a return value on the heap.

Pick-to: 6.7
Change-Id: Ifcae47b487c80c2bac02900f08393b386cfe806c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-05-28 12:39:27 +00:00
Giuseppe D'Angelo 19e3ec4e2f QImage: allow for scaling CMYK images
The codepaths for image scaling are a bit convoluted, so some "surgery"
is needed. QImage::scaled() delegates to transformed(), building a
suitable scaling matrix.

transformed() checks if the matrix is a scaling matrix, and then
has several dispatches.

If smooth scaling was requested:

* if the image format is supported by smoothScaled() without needing a
  conversion, delegate to that;

* otherwise, if the transform is "non paintable" or the source image is
  big enough, then again call smoothScale. "non paintable" here means
  that we're scaling more than 2x down, and QPainter wouldn't do a good
  job.

Otherwise, images in color formats (>= RGB32) are converted by applying
the needed transformation on a QPainter and draw the source image with
that transformation.

Otherwise, if the matrix is invertible (a scaling matrix with non-zero
scaling always is, it's a diagonal matrix), then dispatch to
qt_xForm_helper.

--

Amend this reasoning to support CMYK images:

* Make smoothScaled support CMYK without conversions. To do so,
  make qSmoothScaleImage scale CMYK as if it was a ARGB image.

* Make transformed() call smoothScaled() for CMYK images

* In transformed(), consider CMYK as nonpaintable, because we can't
  paint over a CMYK image.

* In the non-smooth codepath, also check that we don't try to paint over
  CMYK, and always go through qt_xForm_helper instead.

Note that we still don't support any other transformation for CMYK.

Add a test, adapting the exiting one for RGB.

Change-Id: Ic72d78923a17fb3963aa22c57265904c716792b0
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2024-05-28 10:06:08 +02:00
Giuseppe D'Angelo e5a5fe7e29 QCmyk32: make it equality comparable
... because it is. It's also convenient for tests.

Change-Id: I1b9e21763f62c446890ddd5970df25fcae9484b7
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2024-05-28 01:23:42 +02:00
Christian Ehrlicher 8931f2c836 SQLite: Update SQLite to v3.46.0
[ChangeLog][Third-Party Code] Updated SQLite to v3.46.0

Pick-to: 5.15 6.2 6.5 6.7
Change-Id: I9029055f8ba1b3a3156b039f830dcf900c77bfc9
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2024-05-28 00:02:04 +02:00
Assam Boudjelthia 0c30c8b916 Android: keep QtNative.onNewIntent() public to not break NFC usecase
Fixes: QTBUG-122456
Change-Id: If5b91d12a0ed324458d3d23d78226dbf91e3812c
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2024-05-27 20:11:42 +00:00
Tasuku Suzuki 0e3aa48c09 Fix build with -no-feature-easingcurve
Amends a4341827ac.

Change-Id: Id0113d7c127365b6efbbdf4758bd6d25a6a33504
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-05-27 20:11:42 +00:00
Fabian Kosmale ef2912334c QLibraryInfo: Introduce paths
QLibraryInfo::path only allows a single value, however, at least for
QmlImportsPath we would benefit from having more than one to ease
deployment (note that this is unrelated to  Qml2ImportsPath which was
necessary to support QML 1 and 2 in a single Qt install).

Users inside Qt will ported in follow-up patches where it makes sense.

[ChangeLog][QLibraryInfo] qt.conf now allows providing mutliple paths,
and QLibraryInfo has a new paths method to fetch all of them.

Task-number: QTBUG-124009
Change-Id: I78b3bcfa94c8d975dbd789f6826cda4fc5e60403
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-05-27 20:50:47 +02:00
Andy Nichols f65d11ecbf visionOS: Handle Spatial Events
This patch enables the handling of spatialEvents from SwiftUI. Since
these events do not have ObjectiveC structs, for now we serialize them
to JSON and pass them to Qt for usage later in Spatial applications.

These events just cover the built-in gestures like pinch "clicking"
etc.

Change-Id: I8368683259eb64277083cf345ca3a5ed9af32ecf
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-05-27 16:38:36 +00:00
Tor Arne Vestbø 73a11c9d6a Emit QPrintDialog::accepted(QPrinter*) before QDialog::finished
As part of d8bbb5ee0e the order of
QDialog::accepted/rejected and QDialog::finished was changed so
that the latter came last. This has been the behavior now for
the entire Qt 6 series.

QPrintDialog didn't pick up on this new behavior, and was emitting
the QPrintDialog::accepted(QPrinter*) signal after calling the
dialog's done() method, which resulted in emitting finished before
the QPrintDialog printer-specific accepted signal. Clients such as
the textedit example, who would "clean up" in finished() would then
crash when processing the accepted signal.

We now emit QPrintDialog::accepted(QPrinter*) at the same time as
the dialog's accepted signal. The natural place to do this would be
the QPrintDialog constructor, but that's spread out and duplicated
between all the platform specific print dialog implementations, so
we do it via a single shot connect instead in QPrintDialog::done.

[ChangeLog[Print support] QPrintDialog::accepted(QPrinter*) is now
emitted before QDialog::finished, in line with QDialog::accepted.

Pick-to: 6.7 6.5
Change-Id: Idade32b667bdf7b81845025b8d83f08a551d32bb
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-05-27 18:38:36 +02:00
Timothée Keller 8a5fed6da4 Windows QPA: Prevent restoreGeometry from showing hidden windows
When we use GetWindowPlacement, the showCmd parameter will NOT be
SW_HIDE, even if the window is hidden. To prevent showing a hidden window
with SetWindowPlacement, change showCmd if the window is currently hidden.

Amends 21e4116874

Fixes: QTBUG-120415
Pick-to: 6.7
Change-Id: Ib7de369a6d1a530fdeb5ff930097ae06e25761f3
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Zhao Yuhang <yuhangzhao@deepin.org>
2024-05-27 15:22:41 +00:00
Ivan Solovev 88702cc87c QDate: fix C++20 builds with MSVC
Commit c4f7dba81e reworked the C++20
QDate constructors and introduced a helper stdSysDaysToJulianDay()
method. However, the QT_POST_CXX17_API_IN_EXPORTED_CLASS was not used
on this new helper function.
As a result, an application which is built with C++20 but uses a
pre-built QtCore that is built with C++17 cannot call QDate constructors
with the new std::chorono types.

An obvious fix is to add the missing macro to the function.
However, we cannot do it directly, because the function is exported
in C++20 builds, and adding the macro will unexport it.

Use QT6_{DECL,CALL}_NEW_OVERLOAD_TAIL macros to add a new overload of
the stdSysDaysToJulianDay() function and mark it as
QT_POST_CXX17_API_IN_EXPORTED_CLASS.

Keep the old function under the QT_VERSION < Qt 7 check to keep BC.

Amends c4f7dba81e.

Fixes: QTBUG-125610
Pick-to: 6.7
Change-Id: I999354da51ee58c3691dbc1c0351be15a18a268b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-05-27 16:14:35 +02:00
Viktor Arvidsson 5b7422f74d QWindowsMime: Fix loading of CF_DIB (non-v5)
Drag-dropping and image from for example photoshop didn't work in Qt6
due to a (probably?) copy paste error in the commit
8fa91c75ad

Pick-to: 6.7 6.5
Change-Id: I18dedc09596fe590e915e3aa526131f2d6957d8b
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2024-05-27 16:14:35 +02:00
Assam Boudjelthia 4438aa5338 Android: use double quotes with androiddeployqt docs
... to avoid coloring mismatch in the generated doc page
of the tool.

Change-Id: I4334d49632c5f119a874e9112d4f13cd4d60e27a
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-05-27 17:14:34 +03:00
Assam Boudjelthia 89937077da Android: rectify class visibility and cleanup for child windows support
* Make classes that don't need to be public as package private
* Remove dead code that serves no purpose now.
* Use lambdas when needed.
* Use @UsedFromNativeCode for methods called from native code.

Change-Id: Ie34eec079366fb3ef048e0f49e03f507cdf90e97
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2024-05-27 13:53:21 +00:00
Mårten Nordheim 9f2dc6d17f Fixup (u)int128 to latin support
MSVC compilers that could use both branches ended up
using one branch for some things and another branch for
other things, which didn't mix and caused build failures.

And in the header the #include was inside the Qt namespace
and caused internal build errors during parse.

Amends 9d693dbfb1

Change-Id: I1a77abe1fefd21ea3256f5b2d5a55998257762e5
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2024-05-27 13:40:30 +02:00
Tim Blechmann 4656fabd8a Widgets: silence clang's -Wimplicit-fallthrough
clang's fallthrough detection is a little stricter than gcc.

Pick-to: 6.7
Change-Id: If1052275f035a8e8a496cc5a40a21137d18712e3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-05-27 08:55:58 +08:00
Giuseppe D'Angelo 274f7bfbf5 PDF: fix typo
This work has been kindly sponsored by the QGIS project
(https://qgis.org/).

Change-Id: I9e1c26749579d645699a180dac88a00e8653ed65
Reviewed-by: Tobias Koenig <tobias.koenig@kdab.com>
Reviewed-by: Albert Astals Cid <aacid@kde.org>
2024-05-26 14:56:15 +02:00
Christian Ehrlicher 373ae6cbd2 SQL/IBase: add partial support for SQL_INT128 datatype
Implement partial support for SQL_INT128 datatype which is used for
DECIMAL/NUMERIC columns with a precision > 18. This support is only
available when QT_SUPPORTS_INT128 is defined and for MSVC.
Binding values to columns which need SQL_INT128 is supported but
numbers given as QString will be converted to doubles even if
QSql::HighPrecision is set.

[ChangeLog][SQL][IBASE] Added support for SQL_INT128 datatype.

Task-number: QTBUG-124575
Change-Id: If3fb1eb0f19dc60f000d163f3bf45da7acb08c87
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Andreas Bacher <andi.bacher@outlook.com>
2024-05-25 22:25:12 +02:00
Christian Ehrlicher e9c6adb992 SQL/IBase: factor out setting numeric values
Factor out setting numeric values for better readability.

Change-Id: I8980c63e87934e3bc3777897e9cd42aef17caf51
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-05-25 22:25:10 +02:00
Christian Ehrlicher 9d693dbfb1 QLocale tools: add q(u)int128toBasicLatin()
Add q(u)int128toBasicLatin() as helper functions until QString::number()
natively supports q(u)int128.

Change-Id: I920dff145eaa4e849d1f340ca5d5491d2da2821a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-05-25 20:25:08 +00:00
Ahmad Samir 28fd273080 QDirListing: begin() should start iteration from square 0
The old behavior was that calling begin() calls
QDirListingPrivate::advance(), if you call begin() again, it would call
advance() a second time. Not the most intuitive of APIs, but it wasn't
any worse/different from QDirIterator Java-style hasNext()/next() (if
you call next() twice, you advance twice).

Now (c)begin() always starts iterating from the very beginning.

Amends c39a0d1e89

pushDirectory(initialEntryInfo) is now called from beginIterating(), so
don't call it in init().

Not using a std::stack because beginIterating() needs to clear the
iterator containers; for some reason on INTEGRITY something like this
won't work (std::stack doesn't have clear()), complaining about the
constructor being explicit:
nativeIterators = {};

The above works just fine on Linux, so instead of having to spell out
the type... just use std::vector directly (back(), pop_back() and
clear()); this is private API so we have full constrol on how the
vectors are used.

Change-Id: Iaaa849f989b2724bf070730f6273263289dd4d9c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-05-25 21:41:31 +03:00
Thiago Macieira 56568fdee6 QByteArray::setNum: use assign() instead of clear()+append()
clear() will shed any stored capacity, so that's a waste for the few
people who actually use setNum(). The majority use it from number(), in
which case the clear() is superfluous anyway.

And append() does an extra strlen() check, which we don't need.

This considerably reduces the size of both QByteArray::setNum() in a GCC
LTO build (though the compiler chose to not inline assign()). Moreover,
it now does inline setNum() in the number() functions and in a lot more
places (searching for "qulltoa2" in the disassembly finds it in
QFileSystemEngine::id, for example).

Change-Id: If3345151ddf84c43a4f1fffd17d28f2fc79aa072
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-05-25 15:14:20 +00:00
Thiago Macieira 6c7738a7d6 QByteArray: use qulltoString_helper() to make strings
Mårten made this code ready for QByteArray in commits
e5e8e4f59b and
5d0542a356, but never actually made
QByteArray use it.

The simplest change of moving qulltoa2() is sufficient, instead of
moving the template to the header and using it in qbytearray.cpp.
qulltoa2() is called in three places and we don't want the compiler to
inline the function there, so having the function in a separate TU
accomplishes that for us. GCC won't inline it in LTO builds either.

Change-Id: If3345151ddf84c43a4f1fffd17d28682445fbdaa
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-05-25 12:14:17 -03:00
Ilya Fedin 297cdf16d0 xcb: move QXcbXSettings initialization to QXcbVirtualDesktop constructor
This prevents e.g. gtk3 platformtheme from hanging.

Pick-to: 6.7
Change-Id: I68593ad54fa5530366d590309c10621e5a48bd22
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-05-25 02:19:08 +00:00
Thiago Macieira e32009fc0d QFileSystemEngine::canonicalName: don't use malloc()'ing realpath()
It is available in POSIX.1-2008 but is not worth it. The Linux man page
says it only works up to PATH_MAX anyway and the POSIX documentation
says it's UB if PATH_MAX isn't defined.

This cleans up the source code out of these messy #if and should be
faster, because we avoid a heap allocation (stack is always faster).

Instead, we only relegate the heap version to the case where PATH_MAX
isn't defined (i.e., GNU HURD), because in that case the realpath()
function can't be used with a stack allocation.

Pick-to: 6.7
Change-Id: Ie30a3caf09ef4176bb36fffd17cde1ed5c5dad59
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2024-05-24 21:34:27 +00:00
Mårten Nordheim 48aad482a8 Http: Add support for full localsocket paths
[ChangeLog][QtNetwork][QNetworkAccessManager] QNetworkAccessManager now
supports using full local server name, as in, named pipes on Windows or path to
socket objects on Unix.

Task-number: QTBUG-102855
Change-Id: Ifc743f5025b3d8d0b558ecffff437881897915d9
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2024-05-24 22:36:59 +02:00
Ivan Solovev 72b8c7d59c Docs: fix include header for Qt::*_ordering types
As the classes do not use the common naming pattern, qdoc suggested
some weird non-existend includes when generating the docs for these
classes.
Explicitly use the \inheaderfile qdoc command to point to a proper
include.

Amends bdd41f491c.

Pick-to: 6.7
Change-Id: Ia721658df38f1006fdc2fa1de1fab7eb381ceb0b
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2024-05-24 22:17:46 +02:00
Ivan Solovev 81214dabc3 Document Qt::totally_ordered_wrapper
Change-Id: I9249ee6473b68c5e3a9c328ae4d61b7cd83cb505
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-05-24 22:17:46 +02:00
Marc Mutz cbda958352 Port QPersistentModelIndex to new comparison helper macros
Decided to keep the strong_ordering semantics, as user code is very
much guaranteed to rely on it.

Update the docs.

[ChangeLog][Potentially Source-Incompatible Changes] Made several
operators (relational, QDebug streaming, etc) hidden friends. This may
break code that calls these operators a) with types that require
implicit conversion on the arguments, or b) using member-function
syntax (lhs.operator<(rhs)). The backwards-compatible fix for (a) is
to make at least one of the argument's implicit conversions
explicit. For (b), use infix notation (lhs < rhs).

[ChangeLog][EDITORIAL] Replace all "Potentially Source-Incompatible
Changes" items that mention making operators hidden friends with the
catch-all one from the QPersistentModelIndex change.

Fixes: QTBUG-117660
Change-Id: I8175af5e2cb3c77e7486e972630b9410b3a0896c
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-05-24 22:17:46 +02:00
Marc Mutz ece36a7394 Port QModelIndex to new comparison helper macros
Use Milian's asTuple() trick and compareThreeWayMulti().

The pointer variable presents a challenge, because, like op<, op<=>
cannot order unrelated pointer values. Trying to is UB; one is
supposed to use std::less and std::compare_three_way instead, but, you
guessed it, less<tuple<T*>> uses op< to compare the tuples, which, in
turn uses op< on the T* member, causing UB.

[ChangeLog][QtCore][QtCompare] Added a Qt::totally_ordered_wrapper
class whose relational operators use the std ordering types. Use
it to wrap the pointers when doing the comparison to avoid UB.

This allows a smooth migration once we depend on C++20 and class
authors start using lhs.asTuple() <=> rhs.asTuple() or even start
to =default op<=>. The wrapper type is robust against all these
transformations.

Update QModelIndex comparison documentation part.

Task-number: QTBUG-117660
Change-Id: I126b2ebff458800134ed6e774a389d85d76a395f
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-05-24 20:17:46 +00:00
Giuseppe D'Angelo 5fe166ab41 PDF: add a comment to what otherwise looks like an unused method
I'm not 100% sure we still support WebKit, still leave a note.

This work has been kindly sponsored by the QGIS project
(https://qgis.org/).

Change-Id: I45d4351fd4a106763f26685a5510ed630d752745
Reviewed-by: Tobias Koenig <tobias.koenig@kdab.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-05-24 20:10:59 +02:00
Tatiana Borisova e011c3c4b0 Remove CHECK macro from quuid.h file
- CHECK name is too common, it turns out webengine uses it
widely

Amends ef964c254c.

Fixes: QTBUG-125627
Change-Id: I53d90621c09c0f50b7bea910875192bc49095987
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-05-24 10:34:19 +00:00
Nicholas Bennett 480940f0aa Docs: update the QAndroidApplication::context() documentation
The word "main" here is confusing. use "most recently started" instead.

Fixes: QTBUG-86203
Pick-to: 6.2 6.5 6.7
Change-Id: I3fd4e49204fac8a2f97cdfc57d5f7901fa7b96a6
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2024-05-24 11:02:54 +03:00
Marc Mutz 0076999031 QRegion: re-add rects() and port setRects() to QSpan
In Qt 5, we had QVector<QRect> QRegion::rects(), but it was
deprecated, because just iterating over the QRegion as a container of
QRects was more efficient (QRegion has a SSO for the case of one
rectangle). With QSpan, we can now bring it back with the same
efficiency as iteration, supporting Qt 5 code that never made the move
away from rects() and new code that wishes to make the conversion into
rectangles more explicit. Re-add the Qt 5 tests, which show that the
function is nearly a drop-in replacement for the Qt 5 rects() (QSpan,
at the time of this commit, doesn't have relational operators, yet).

Also add a QSpan overload of setRects(). The old (ptr, n) function
(now obsoleted, but not deprecated) allowed nullptr + n != 0, which
QSpan doesn't accept, so print a warning in that case. Also, QSpan can
hold more than INT_MAX elements on 64-bit platforms, but QRegion's API
was never ported from int to qsizetype, so we need to catch oversized
spans used as inputs, too.

[ChangeLog][QtGui][QRegion] Added QSpan overload of setRects();
re-added Qt5's rects(), but returning QSpan instead of QVector now.

Fixes: QTBUG-124712
Change-Id: I24570c886cbf77abd8d1f4a3f42ae53c892cd9ff
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2024-05-24 04:38:21 +00:00
Rami Potinkara f22e9795d9 Android: Update Gradle to 8.7 and Android Gradle Plug-in (AGP) to 8.4.0
Updated Gradle to 8.7
Updated AGP to 8.4.0
Updated same versions in examples and docs macros

Task-number: QTBUG-113383
Change-Id: Ib2e841f2e57e576c5d689a208a275ce5e9e4b80f
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2024-05-24 06:37:13 +03:00
Volker Hilsheimer f9cf13d23e QPalette: clarify documentation of resolve a bit
Explain where the colors come from for unset roles, and add a see-also
for isBrushSet.

Pick-to: 6.7 6.5
Change-Id: I35e58e6b0f3ff9e57d9df95879859dd10424dc92
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2024-05-24 01:23:42 +02:00
Tor Arne Vestbø 668914649c QFrame: Disable implicit inclusion of safe area margins in contents rect
The QFrame::frameRect property is implemented in terms of the QWidget's
contentsMargins, and when the QFrame is resized it recalculates the new
frame rect by reading the contents rect and then setting the widget's
content margins based on the new value.

This conflicts with the implicit inclusion of safe area margins in the
widget's contents rect, as those implicit margins are then persisted as
user-set contents margins. If the safe area margins later change (to 0),
the frame will still reflect the old safe area margins.

We may find a way to untangle this for QFrame, but in the meantime let's
set Qt::WA_ContentsMarginsRespectsSafeArea to false. This avoids the
issue above, and also informs child widgets of the QFrame that they
themselves need to potentially take the safe area margins into account.

Disabling Qt::WA_ContentsMarginsRespectsSafeArea in this manner should
not cause any major behavior changes, as a QFrame is typically part of
a parent widget that does respect the contents margins, and so the frame
will not need to apply any margins of its own once the layout settles
down.

Task-number: QTBUG-125345
Pick-to: 6.7
Change-Id: I936ff5ec9056d05676560cc7659ba31105fdc224
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2024-05-23 18:55:47 +02:00
Tor Arne Vestbø bc1f983781 rhi: Don't fall back to OpenGL backingstore if Metal is not available
We were reusing the QRhiMetalInitParams when falling back to OpenGL,
which caused crashes at runtime.

We remove the fallback altogether, as tests or clients that rely on
a specific RHI backingstore backend should do feature-testing before
requesting the specific backend.

Pick-to: 6.7
Change-Id: Iee38348ae06ea118aafcada33a8956ae07bb2228
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2024-05-23 18:55:08 +02:00
Christian Ehrlicher e337f14707 SQL/models: use qsizetype/range-base for loops where possible
Replace some 'native' for loops with range-base for loops or use
qsiztype instead int, mark some helper functions as const.

Change-Id: Ib3f368d6c07bc170ab4ed7cbf28181a226dbeac5
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-05-23 16:52:20 +02:00