Commit Graph

50123 Commits (9f331f89ea3af80dbac8fe4295cefd8fc2d45d80)

Author SHA1 Message Date
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