Compare commits

...

1070 Commits
dev ... 6.8.0

Author SHA1 Message Date
Liang Qi
b839e9b36d Revert "xcb: handle XI2 input button and motion events from slave devices"
This reverts commit b71be292780b858f2c55ce92601452e2ea946de2, which causes a regression when using mouse wheel and moving cursor together
on scroll bar for some qt applications, like qutebrowser and
qbittorrent.

Fixes: QTBUG-129509
Fixes: QTBUG-129514
Task-number: QTBUG-110841
Change-Id: I703158874413a1306ea99217bced4ba38382f543
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 5875da6d70303468eab85030a80f54c268f80b79)
2024-10-02 05:31:19 +00:00
Inho Lee
063783b144 widgets: Send Window{AboutToChange}Internal when top level used RHI
When calling setParent for a top-level widget that used RHI it's
not enough to check if the widget's parent used RHI, as that's
always going to be false.

Missing this results in not sending textureChildren events for the
reparented widget.

Amends eb4cb719257d3b57cd801273d4011579d8c81714

Fixes: QTBUG-129299
Change-Id: I632d8d63ec56243cd6da2b196ad9651c28128f0b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-10-01 09:57:38 +00:00
Edward Welbourne
e9778e6026 QDateTimeParser: drop an invalid and largely pointless "optimization"
Now that the maximum and minimum might not be in local time, the day
might not be the same as the local time day. In any case, the "saving"
of checking for being past the end of that day is negligible compared
to all the other wanton costs of the date-time parser.

This is a follow-up to commit b6a11a4ee5319366f14c11c7cf3a4f1dbf33cfd5;
thanks to Tor Arne for reporting the resulting assertion failures.

Fixes: QTBUG-129347
Change-Id: I1ba443df9340fa63b8765c25004b51467ca5244d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 070ab9e85208c467d2f59f7fdfc7afe627dc37e1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit c7c64e7d0a5260913e2afe61ef306520a19cf609)
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2024-10-01 06:22:41 +00:00
Kai Köhne
f3fc7b210f Revert "QTranslator: fix loading order when loading from locale"
This reverts commit 9a11273b745a30cebb5cd648c89eb224e9704492.

Reason for revert: The fix tried to find a sensible order if
the same language is listed multiple times in QLocale::uiLanguages().
Anyhow, it breaks for lists where entirely different languages are listed. This needs more thought.

Fixes: QTBUG-129434
Reopens: QTBUG-124898
Pick-to: 6.5 6.7 6.8 dev
Change-Id: I8c074cbf1ddc2ddf223ec09aef38dfc1ef7fc85f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-10-01 06:22:27 +00:00
Axel Spoerl
6f48162478 Send events as spontaneous in QWindowPrivate::forwardToPopup()
QWindowPrivate::forwardToPopup() sends key events with
QCoreApplication::sendEvent(), which sets QEvent::m_spont to false.
That makes key and pointer events sent to popups appear synthetic,
while they are sponaneous if sent to other widgets.

The method has been newly implemented in the course of moving
popup handling from QApplication to QGuiApplication.

Make current behavior consistent to the behavior prior to
e4ef0f03e6f1fddc397980fd7fbf6f6b829f16d9.
Since events are always spontaneous, use
QCoreApplication::sendSpontaneousEvent() instead.

Add a test function to tst_QComboBox to Verify, that key events
- are sent directly to the popup
- not seen by the window
- appear as spontaneous.

This amends e4ef0f03e6f1fddc397980fd7fbf6f6b829f16d9.

Fixes: QTBUG-129258
Change-Id: Iff61b98b290f6483948007b5f12b19393759d9db
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 3fbae61ea245291cb4c34e9126562c307741a600)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit c20a382023dde5e2627f3b7ecfcd22e02afc26b4)
2024-09-26 05:01:16 +00:00
Alexei Cazacov
d39c9d37ad Docs: Broken layout on landing page (offline style)
This commit fixes the broken layout. Wrapping the divs of
col-1 (content) and col-2(sidebar) classes with a container with
`display:flex` does the job.

Fixes: QTBUG-129178
Pick-to: dev 6.8
Change-Id: I6867b178e5a1acf6a4fbd5302a857e5f3ca0a62f
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2024-09-26 08:01:13 +03:00
Soheil Armin
505ee95fda Android: Fix QtAbstractItemModel proxy threading problem
This change sets the thread affinity of the
QAndroidItemModelProxy instance to the Qt main thread,
enabling its APIs to be called from both the Qt main thread
and Android threads. Synchronization between threads is
ensured by using the newly introduced
QAndroidItemModelProxy::safeCall(), which utilizes
QMetaObject::invokeMethod() with the appropriate
connection type based on the calling thread.

For void functions, Qt::AutoConnection can be used.
Functions returning values will either use a
Qt::DirectConnection if invoked from the same thread as
the QAndroidItemModelProxy instance, or a
Qt::BlockingQueuedConnection if called from a different
thread.

Fixes: QTBUG-127701
Change-Id: I214bc43d20d8bdf301fc97920493415d503d26d8
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 6c30a60a42800dd5d732d2c7018d87e8f3a9c6a0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 1f0cf1e6e5625587caec3951c9a439ac0b3e3cfb)
2024-09-23 11:40:44 +00:00
Eirik Aavitsland
72c6fcafdd Update bundled libjpeg-turbo to version 3.0.4
[ChangeLog][Third-Party Code] libjpeg-turbo was updated to version 3.0.4

Change-Id: Ifa437bfc9b99f386d792a045b0963f3690e322d9
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit c1ee64834a04f03587d0a95d63365620951e072e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit d2b98a11470d85c8afb360631541732e49b50bc2)
2024-09-23 11:40:33 +00:00
Paul Wicking
d6955069f2 Doc: Drop parentheses and fifth macro argument in offline '\grid'
The parenthesis ends up without content, and that looks confusing and
broken in e.g. Qt Assistant.

Fixes: QTBUG-129151
Change-Id: Ib616741bc0463e8bece481c2a37cd7c3992921ab
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit 2c9968bee56373f36e6ceb616befdf2657f24859)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 0d58653758547595aad8485f42473bed9d15c46c)
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2024-09-23 11:40:19 +00:00
David Faure
f70e4a49c9 QTableView: fix moving rows by drag-n-drop
If we don't set dropEventMoved to true, then QAbstractItemView::startDrag
will delete the rows after the move (after QDrag::exec() returns).

Fixes: QTBUG-129128
Change-Id: I85e7903a12b13c4b73e34fa1fcac56e50f421191
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit d2384783477e88190fb87287bb9af8ea9a46343e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 7f35844ed0beb48ed6ebdab9d56cd832c188cb90)
2024-09-23 11:40:11 +00:00
Thiago Macieira
e8122a0a9c QUrl/QDir: revert all recent changes to path normalization
This amends commit c023016ffdda9e2a27c2257ca85a8ffd384e8c08 to revert
all of the following commits:
214fbc658bc78ad39e0fb33daf2a3a3fa621b02b
492c646735faa2cad6d0459066dfd723b7ee99b0
804b0996746daae9cf3c901ce353261e1edd7728
e4576684681df8fe6d65a2f72379968c187db108
a1610c6c68ca2c9a3855a4e5e947033e6410d7c9

The reason for this is that they introduce a behavior change in QUrl,
causing the normalization/resolution of file:// directory paths not to
end in "/" and this behavior change revealed buggy code in QML that
concatenated strings expecting the slash to be there. Commit
c023016ffdda9e2 attempted to do that too, but it left QUrl in a state
that introduced a regression from 6.7.

Discussion on whether we will accept this behavior change (and require
fixes to buggy code) or keep the old behavior to avoid breakages will
happen for 6.8.x.

This commit reintroduces bug QTBUG-120396 to 6.8.0.

Task-number: QTBUG-120396
Fixes: QTBUG-128940
Change-Id: Id78899df1cea4321d9e1fffdcc0f406bbfd534b8
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2024-09-19 01:23:39 -07:00
Ulf Hermann
c023016ffd Revert "QUrl::resolved: switch to using qt_normalizePathSegments"
This reverts commit e7bcf41c0b23d83cfb31f966454945c705589a99.

Reason for revert: Causes Qt.resolvedUrl() to misbehave in QML.

Task-number: QTBUG-128940
Change-Id: I698338d4789ffef5c5a0f08391372b428d4fffb0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-09-18 11:51:16 +02:00
Paul Wicking
50933122a2 Doc: Specify correct target_link_libraries item for QRhi
Use the new `\qtcmaketargetitem` QDoc command to specify the correct
`target_link_libraries` item for items that belong to the new module.

Fixes: QTBUG-121855
Fixes: QTBUG-125994
Change-Id: I76a6ab749fdb349cc014f40bc7e548a0344bc50d
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit 9a9f5009006e03849242211d831a900e30c39fc8)
2024-09-17 14:53:54 +00:00
Piotr Wierciński
0d6b204573 wasm: Fix missing header files
Pick-to: 6.8
Change-Id: I4d64053df4b7b183b223b5ec71444fb949834f45
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
(cherry picked from commit a8765d76c3875d7e9256d73bf9c29baf0f8fc3d0)
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2024-09-17 14:53:45 +00:00
Eirik Aavitsland
339feefc5c Update bundled libpng to version 1.6.44
[ChangeLog][Third-Party Code] libpng was updated to version 1.6.44

Change-Id: Ib208635687645101cd2d7fb4e5bf069088c24f86
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit 685a6c2e3d8e3b970640d7e31945272a6803ae61)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit c36b24b08737955c0a059b871ebfe26ec541a2e2)
2024-09-16 04:36:47 +00:00
Thiago Macieira
214fbc658b QUrl::resolved: switch to using qt_normalizePathSegments
Commit 4b1547adc9b195e6acc90471fc48dec7ee0c429d rewrote
mergePathSegments() but got one thing wrong: that ".." on a "//" should
only remove one slash, not all of them. That behavior was introduced by
commit eaf4438b3511c8380b9b691b656a87a60e342e2 to match what browsers
do.

QUrl will use the local file behavior if the URL scheme is "file",
unlike the browsers.

Task-number: QTBUG-120396
Change-Id: I8a96935cf6c742259c9dfffd17e8fd3cfde46e25
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit e7bcf41c0b23d83cfb31f966454945c705589a99)
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 2ce3153b83615f9fad7e87bfcf548f9167f5d54c)
2024-09-15 21:36:34 -07:00
Thiago Macieira
e4b298316d QUrl::toString: fix using of NormalizePathSegments and RemoveFilename
We were overwriting the normalization if RemoveFilename was used.

[ChangeLog][QtCore][QUrl] Fixed a bug that caused QUrl::toString(),
QUrl::toEncoded() and QUrl::adjusted() to ignore
QUrl::NormalizePathSegments if QUrl::RemoveFilename was set.

Fixes: QTBUG-127711
Change-Id: I8a96935cf6c742259c9dfffd17e8e1f7fec44cb6
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit c9ff625865c355fb57c824b13f3cb4b26e53fbe7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit fee6283b85de8a06be10aee180b37ec3e479c9b7)
2024-09-15 21:36:31 -07:00
Thiago Macieira
492c646735 Replace qt_normalizePathSegments algorithm with QUrl's removeDotsFromPath
Commit 4b1547adc9b195e6acc90471fc48dec7ee0c429d rewrote the latter for
simplicity and performance, so copy it over with intent to merging the
two together. In this copy, however, we keep the behavior introduced by
commit eaf4438b3511c8380b9b691b656a87a60e342e2, which made the
normalization match the behavior found in browsers, but didn't apply to
QUrl::resolved (that's the next commit)

Task-number: QTBUG-120396
Change-Id: I2670423f6c6a5339771ffffdf15ebad46fd25cb4
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 78e2d24752d8b6652aac89d1e79f245bc88281c6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 7359d63209f56c8cb7c747307c0726d70e592927)
2024-09-16 04:36:28 +00:00
Thiago Macieira
804b099674 QUrl::resolved: remove the lambda in removeDotsFromPath()
I had made this change but didn't push it. Amends commit
09055d7211b1f8ba9fdec141a1e919faee1c1676

Change-Id: I8a96935cf6c742259c9dfffd17e8fc87d41dd891
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 01fbb883ad8832808110e74a0c4b2724f1e38d6c)
(cherry picked from commit 5eafba18e0fc8c7d46af29510e8bdc6c88d14913)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-16 04:36:26 +00:00
Thiago Macieira
e457668468 QUrl::resolved: avoid detaching from paths that don't have dot segments
This can happen in any number of cases where neither the base URI nor
the relative one had a "." or ".." segment. In particular, we want to
avoid detaching in the case where the new path is the same as either of
the base or relative URI's, which can happen when the other was empty
(and mergePaths() didn't have to prepend a slash).

Change-Id: Iac1ff680887641888e00fffd17e14f3927e828ae
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 09055d7211b1f8ba9fdec141a1e919faee1c1676)
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 7b45dc49bb77d2b9ffdf9a3ac420e59aa89550db)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-16 04:36:23 +00:00
Toni Saario
8fcfd1a835 Coin: Fix Windows aarch64 cross compile conditions
Match to Windows target OS and different target arch, which tells that
it is a cross-compilation.

Change-Id: Iba2d087cda501cd2622a1bd8a8732100b920956b
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit b8521b89dfa36519afe8a7c8f02b982d760fc0f6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit ae4a48deccf9cb9ab6f37225f7a05c600ad5e367)
Reviewed-by: Simo Fält <simo.falt@qt.io>
2024-09-12 07:18:38 +00:00
Eskil Abrahamsen Blomfeldt
bc59c88186 Update to Harfbuzz 9.0.0
This includes a compilation fix for Integrity which is also
stored as a patch file under harfbuzz-ng/patches.

[ChangeLog][Third-Party Code] Updated Harfbuzz to 9.0.0.

Fixes: QTBUG-128763
Change-Id: I84156d38cf131e78e4f0d0d1716aa4e79a8c3a45
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 0d83d8bbb15e3f481b1d8abed4cd29a08499c37f)
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2024-09-12 07:18:18 +00:00
Tor Arne Vestbø
4e66be84be Android: Return QAndroidApplication instance via nativeInterface() getter
The QAndroidApplication native interface wrongly uses static methods
instead of virtual functions, which has lead to client call sites not
using the preferred QCoreApplication::nativeInterface() API to resolve
the interface, and a lack of an implementation in QCoreApplication
for the resolveInterface function.

We now implement resolveInterface for Android, so that the interface
can be resolved via QCoreApplication::nativeInterface(), even if the
interface itself (for now) is based on static methods.

Task-number: QTBUG-128796
Change-Id: Id4d8b9a6fcc7d0e2cc76de07dc0742dc5917f3ca
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 60f07671e1770c4f6fd71bbad7cf88ca35ab4de0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-10 18:45:04 +00:00
Michael Weghorn
8f5b06f977 a11y: Use desktop file name as app's accessible ID
As the QGuiApplication::desktopFileName doc [1] says:

> This is the file name, without the full path or the
> trailing ".desktop" extension of the desktop entry that
> represents this application according to the freedesktop
> desktop entry specification.

Since the desktop entry represents the application, also
use the desktop file name for the accessible ID of the
application object.

This e.g. makes Okular's application object report an
accessible ID of "org.kde.okular" instead of just "QApplication"
as the AT-SPI2 AccessibleId property on Linux.

[1] https://doc.qt.io/qt-6/qguiapplication.html#desktopFileName-prop

Change-Id: I554da7baaf817866db9044128f73a9ea634cddbf
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 13b4075093866a497e620bdd388afaf8aa0bc962)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-10 04:31:21 +00:00
Assam Boudjelthia
6a9ee6eb68 Android: bump AGP to 8.6.0 which supports Android 15
AGP 8.5.2 still throws a warning about not being tested
with Android 15 builds, now 8.6.0 is released and doesn't
have the warning.

Amends b5d8552f2baab56457d3f39f6b2915c72447b702.

Fixes: QTBUG-128648
Task-number: QTBUG-126061
Change-Id: I3d7a4c9c184e1a81f0ebb9431a6e3ca9706d19e9
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit 8436455e2740000a817e0b8154e13f47e6abb68c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-09 23:48:01 +00:00
Richard Moe Gustavsen
893dc6d772 Revert "QGuiApplication: don't send pointer events to windows other than the active popup"
This reverts commit 2e711e47e0fedd636af2116c56622cc7be958808.

After closer investigation, it turns out that menus in Quick before 6.8
does infact forward pointer events outside the popup to the item under
the mouse. Only if the popup is modal will this be blocked. So blocking
this from QGuiApplication will cause a difference between Popup.Item and
Popup.Window, and needs more investigation.

Change-Id: I7d21258cb8fafd7380786fed0d6370e0a9090188
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-09-09 14:10:57 +00:00
Tatiana Borisova
10680554db qtbase build should't fail with -DFEATURE_process=OFF option
- Added #if QT_CONFIG(process) to the qt code that uses a QProcess

Change-Id: I79b39392bd2f75384256e5564203a8c875169916
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit f6dab97455f866243132ed38a070ebb3879a0c82)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-09 07:45:17 +00:00
Christian Ehrlicher
2987e96a6c Examples/Sql/Masterdetail: Fix deleting rows
Completely deleting a row in a QSqlTableModel needs a call to select()
afterwards, otherwise a blank column will stay according the
documentation of QSqlTableModel::removeRows()
Also add albumdetails.xml to the resource file to make sure it's found
during runtime.

Task-number: QTBUG-128434
Change-Id: Ie5cc38edfa27984d186467e3372b05987f78d14c
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 5a28fe86af30bd3293f49ad09ee9c044e06ccbe3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-08 10:08:28 +00:00
Christian Ehrlicher
05c0ce01fb QSqlRelationalTableModel: properly clear relational dictionary
When the relationModel is updated (e.g. a new row is added or removed),
the internal relation cache needs a refresh to reflect those changes.

Fixes: QTBUG-128434
Change-Id: Ie388c01d545564ad7b1424d70267166ac1e4bfd6
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 48753a03de7c9c394fbf4cf69e2c2f3d1048c85f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-08 10:08:26 +00:00
Johannes Grunenberg
2f4680d143 Disable q(u)int128 for Clang with MSVC's STL
Clang supports q(u)int128, however, MSVC's STL doesn't have support for
it in <type_traits> and <limits>. MSVC's STL is used by Clangd on
Windows.

Fixes: QTBUG-128675
Change-Id: Ic0be6b9d2659477829c7b369385ef885dee8d355
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 1f9a660eb2d5c6e3cb9c80dc292f3ec355296515)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-08 10:08:25 +00:00
Thiago Macieira
81e6ede3a8 Don't mark Q{Explicitly.}SharedDataPointer as Qt_6_PRIVATE_API
The QT_DECLARE_Q{,E}SDP_SPECIALIZATION_DTOR_WITH_EXPORT macros make the
destrcutor of the particular instantiations be out-of-line and exported
from the library in question. In many cases, the class name that is
being instantiated can found in a _p.h and this causes syncqt to mark
any use of this class as private API, including this constructor that is
meant to be used from inline (user) code.

This patch marks all such instantiations to be "public" API. That will
include some uses that shouldn't be so marked, but this is easier than
having to do it piecemeal.

The ELF version was changed for thsee Symbols changed in QtGui (for example):
 QExplicitlySharedDataPointer<QPlatformPixmap>::~QExplicitlySharedDataPointer()
 QExplicitlySharedDataPointer<QColorSpacePrivate>::~QExplicitlySharedDataPointer()
 QExplicitlySharedDataPointer<QPageRangesPrivate>::~QExplicitlySharedDataPointer()
 QExplicitlySharedDataPointer<QColorTransformPrivate>::~QExplicitlySharedDataPointer()
 QExplicitlySharedDataPointer<QPdfOutputIntentPrivate>::~QExplicitlySharedDataPointer()@@Qt_6
 QExplicitlySharedDataPointer<QEventPointPrivate>::~QExplicitlySharedDataPointer()
 QExplicitlySharedDataPointer<QPageRangesPrivate>::~QExplicitlySharedDataPointer()
 QExplicitlySharedDataPointer<QColorTransformPrivate>::~QExplicitlySharedDataPointer()
 QExplicitlySharedDataPointer<QPenPrivate>::~QExplicitlySharedDataPointer()
 QExplicitlySharedDataPointer<QFontVariableAxisPrivate>::~QExplicitlySharedDataPointer()@@Qt_6
 QExplicitlySharedDataPointer<QPlatformPixmap>::~QExplicitlySharedDataPointer()
 QExplicitlySharedDataPointer<QColorSpacePrivate>::~QExplicitlySharedDataPointer()
 QExplicitlySharedDataPointer<QEventPointPrivate>::~QExplicitlySharedDataPointer()
 QExplicitlySharedDataPointer<QPenPrivate>::~QExplicitlySharedDataPointer()

Task-number: QTBUG-128656
Task-number: QTBUG-117514
Change-Id: I1f25f1e61bb98159f9d3fffd63acbe04098cfef6
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 33707235841981133edfdfcd88cc6e234aa4fc45)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-08 10:08:23 +00:00
Allan Sandfeld Jensen
998bffecc2 Fix warning/crash for MSVC ARM64 mode
Initialize the variables outside the loop to avoid repeating it on every
iteration.

Fixes: QTBUG-128667
Change-Id: I8e2ed0e40bdc4d687060df72f1d45e940e56df98
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 0819f128c5206d5712acce2e86e9eb5d9ba13182)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-08 10:08:22 +00:00
Morten Sørvig
10397e5351 macOS: send DPR change on BackingPropertiesChange
AppKit sends the viewDidChangeBackingProperties message
to the view when the backing store scale changes.
Propagate to QtGui via handleWindowDevicePixelRatioChanged.

Pick-to: 6.7 6.6
Fixes: QTBUG-118794
Change-Id: Ia675e84f74dd3c64d6466adc753accbbb650325b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 97c12e3f2dc1e2114aeb8abaff4d551b112887ef)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-07 13:48:31 +00:00
Jarek Kobus
5fa620173e AssetDownloader: Sync TaskTree sources
Change-Id: Ib3727dbca7b27e796b6fab084cbaaa9890b78118
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit f4db5ce8a8e6994b4dce407977f4e936dcd7f48e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-07 13:47:55 +00:00
Mårten Nordheim
d62a2decaf Network: includemocs
IIRC they were Q_GADGET'ed

Change-Id: Ia80e506587fb583591ea4b89e648cb9cdfd98dfa
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 1b592e18b2f3f20d6941fe1a761d680f3dbdb61a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-06 19:25:28 +00:00
Ahmad Samir
567eae56e7 docs: promote QBasicTimer usage by making it more visible
Deduplicate some API docs.

Mention that it's a RAII class, to make it more appealing to users.
Copied the "RAII" note and link from QSemaphoreReleaser's API docs.

Change-Id: I53ced6eb7c2ab55ffc04e70c250b5f5639406911
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit e1fdfe9da8ccdeed9af602897232a513884b0515)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-06 19:25:26 +00:00
Marc Mutz
799f6bf43f Q(Multi)Hash: Fix underconstrained heterogenous operator[]
If the key doesn't exist yet in the map, we need to be able to create an
actual Key object. Consequently, we require that the type is actually
convertible.
This doesn't fix any broken code, but avoids compilation errors in QHash
internals bubbling up.
Note that the existence of a comomn_reference does not imply
convertibility (so the concept version wasn't strict enough either).

Done-with: Fabian Kosmale <fabian.kosmale@qt.io>
Change-Id: I4ed46f343817932063084642093cac193fd9554f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit a338f67dceed61009375a4a90a7fe32a06b443a0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-06 15:55:13 +00:00
Marc Mutz
3dc6b37bae QVersionNumber: make iterator comparison non-noexcept again
When these iterators were originally added¹, their relational
operators, following the Lakos Rule, were not marked as noexcept
because they have preconditions (lhs and rhs must come from the same
QVersionNumber object).

d292648d0bbac50388dae035dc34782accb3807f then added the noexcept,
disregarding the Lakos Rule. Until the ongoing discussion regarding
the Lakos Rule on the project mailing-list² is concluded, don't add
noexcept. We can always add it in later, but we can't remove it once
released.

Requires manually working around the missing
Q_DECLARE_STRONGLY_ORDERED_LITERAL_TYPE_NON_NOEXCEPT macro that we
don't want to add if there's no other user.

¹ 2188ca2c5df6f21a953c002edbe5b2d2cc2c2d2c
² thread starting at
  https://lists.qt-project.org/pipermail/development/2024-August/045544.html

Change-Id: Ie88326519673166afe8cb44267c23944b27c68d2
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit a84b79df0fb8a92b17a39bbf706714e93de9d6fc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-06 15:55:11 +00:00
Mate Barany
92d9a741c0 Use NSDMI for all the members of the QNtlmPhaseBlock classes
After the base and derived classes have been merged we can uniformize
the initialization as well.

Task-number: QTBUG-127539
Change-Id: I3828dc973fd7b3ccd06272e2e26eaae4edab8768
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit c3093b3d8f27fa3df14e04245dea9ed1e781f61e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-06 15:55:09 +00:00
Fabian Kosmale
722c7edf03 QHash: Unconceptify heterogeneous search code
That allows the code to run in C++17 mode - at the expense of
significantly worse compile time error messages, potentially worse
compilation speed and harder to read code.

Adjust the test type to actually model
detail::is_equality_comparable_with (which requires all four
relational operators even in C++17).

As a drive-by, fix the return value of remove() from auto to bool.

Done-with: Marc Mutz <marc.mutz@qt.io>
Fixes: QTBUG-128470
Change-Id: I68df26db579c60812a18e09b76dd5712e73ccaa2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 7fe3cee36352c74cbaaff52e863bd0da1170affa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-06 15:55:07 +00:00
Mårten Nordheim
16ed1fe089 tst_qnetworkreply: Speed up moreActivitySignals
Going from 40 seconds to 1.
The issue is that wait() doesn't care if there was
a signal emitted already, it will just wait 5 seconds for a new
one. But we don't care, we just want to know that there was 1.

Pick-to: 6.7 6.5
Change-Id: I96f1f00bc6171ccc6e5b2f033fa407de5cf0c0c3
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 65494fbd3dff16d4476b5ac8c04df830d9fd61e6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-06 14:38:30 +00:00
Tor Arne Vestbø
5ed9b165bd Restore support for iOS 16 for Qt 6.8
Our general strategy is to support the latest two iOS releases,
as most people upgrade their iOS devices quite aggressively.

But given that iOS 18 is not out yet, and that people still
spend some time upgrading once it's out, we don't want to be
in a situation where we effectively only support iOS 17.

Fixes: QTBUG-128678
Change-Id: I959794944807e5b6b5e56f22d3c57977bc4f2aee
Reviewed-by: Doris Verria <doris.verria@qt.io>
(cherry picked from commit e2c4a1669e5b6496d52e2f55a94bd7d4f4469b98)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-06 14:38:26 +00:00
Tor Arne Vestbø
f30fb442af macOS: Return invalid QColor if qt_mac_toQColor is called with a nil NSColor
Call sites of qt_mac_toQColor may not necessarily check the NSColor
for nil before passing it to qt_mac_toQColor, as seen for example
in the QCocoaColorPicker implementation.

Without an explicit nil check we ended up returning a valid QColor
with all color components set to 0.

Pick-to: 6.7
Change-Id: I0cc36049fca05a6b668c0c610bc40eedbc72df3a
Reviewed-by: Doris Verria <doris.verria@qt.io>
(cherry picked from commit 271bfe4a5405309dc8d48807d6f28d174efb2cc2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-06 14:38:25 +00:00
Mårten Nordheim
6e98673846 tst_qnetworkreply: localhost may resolve to ipv4 and 6
On some platforms, localhost resolves to both ipv4 and ipv6 addresses.
In that case we might get multiple emissions of the
socketStartedConnecting signal, for Happy Eyeballs.

Pick-to: 6.7 6.5
Change-Id: Ib39a167bdde2089106c89a3e297cbb0ad2f357d9
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 13a0f294b5ef2ec8a2057d72365f989ddf6290de)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-06 14:38:22 +00:00
Mårten Nordheim
7eea3acac9 Tests: suppress has_denorm deprecation
Deprecated in C++23:
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2614r2.pdf

Pick-to: 6.7 6.5
Task-number: QTBUG-128584
Change-Id: I43fb045dfa78b1f0ba5bd52886ca1bf89869d91d
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit e54ee29862bd97749d547330a739416768088986)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-06 14:38:21 +00:00
Marc Mutz
bd9e40b14c Fix compilation with QT_ENABLE_QEXPLICITLYSHAREDDATAPOINTER_STATICCAST
You cannot direct-initialize a pointer variable with a comma
expression. Need to wrap it in an extra set of (). Instead of that,
wrap with {} on the outside, to make it look less like Lisp.

Amends 0ed039fd134fb8025236847295681f13f1775847. On dev, a follow-up
change has already removed the code in question, leaving only 6.8
affected.

Change-Id: I8d03093849d0bd7b868703218b48b5cb9d2a18f4
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-09-06 13:05:16 +02:00
Soheil Armin
c28225e469 Android: Add Void conversion support to QAndroidTypeConverter
Now the caller of toJavaObject() is be able to get
an object of Void type when the input parameter is QVariant<void*>.

Fixes: QTBUG-128586
Change-Id: I6eea670788461e4eb0d8f38a4a872c2c4759bdd8
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
(cherry picked from commit e02813eeb5e3f3475541b50ba8d21a7bc724e698)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-06 10:19:22 +00:00
Marc Mutz
b972361ec4 QtPrivate: add "defined in" comment to findByteArray/lastIndexOf(~~~, char)
It's customary to add such a comment when an inline function is not
defined in the same header it is declared.

As a drive-by, remove the pure attribute from lastIndexOf().
Q_DECL_PURE/CONST_FUNCTIONS are only useful for out-of-line functions.
For inline functions, the compiler sees the body and can determine
that they're pure or const (in the __attribute__((const)) sense)
itself.

Found in API-review.

Change-Id: I27aa5cfaf21b1015a6c8b9e4773a1c2c5134a226
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit 3b812f0409c50c6a3fd1d66a9c18bc323e0a0ca3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-05 18:24:12 +00:00
Marc Mutz
1e86694501 QLatin1StringMatcher: use specialization instead of an is_same chain
Same result, but less templates to instantiate, so should be faster to
compile.

Found in API-review.

Change-Id: I43ebb94c73c6b4462441a7ae85a67909f6894ba3
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit 13d2d55957c52c4f2270248be57dc18bea507236)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-05 18:24:05 +00:00
Ahmad Samir
e960afffc9 QDirListing: flesh out API docs
- Let qdoc generate docs for const_iterator/sentinel
- Document pre- and post-increment operators
- Document const_iterators typedefs
- DRY API docs

Change-Id: Ia559541118586ca0314cd5f618acda3f7c820659
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 68a06e99a8577d08e8b885f0b417b1c9f90a7459)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-05 18:24:03 +00:00
Richard Moe Gustavsen
f0c6354a38 QGuiApplication: don't send pointer events to windows other than the active popup
If a popup is visible, we're not supposed to send pointer events
to other windows than the popup. It doesn't matter if the popup
doesn't want it. But currently we end up doing so anyway, which
mean that we would trigger items elsewhere in the UI.

This patch will instead make sure that always return from
processMouseEvent() after sending, or forwarding, it to the
active popup.

Note: some styles in Controls (e.g macOS) has a menu window that
is actually substantially bigger than what it appears like on
screen (to make room for a drop-shadow). This means that a mouse
press can happen outside the visual borders of the menu, but still
inside the popup window that contains it. And this is also a
reason why some bugs related to forwarding of mouse events only
surfaced on some platforms (Ubuntu), but not on others (macOS).

E.g for a Menu in a MenuBar, the menu window on macOS would actually
be placed on top of the MenuBar and block pointer events from reaching
it (because of the menu shadow). While on Ubuntu, since the menu has no
shadow, the press would instead trigger the MenuItem in the MenuBar.
But by never forwarding pointer events to windows other than the
active popup, such differences will never happen.

Note: we should actually forward pointer events to the window under
the mouse if QPlatformIntegration::ReplayMousePressOutsidePopup is
set (and WA_NoMouseReplay is not set). But this API is currently not
reimplemented after QGuiApplication was refactored to support popup
windows also in Qt Quick. And ReplayMousePressOutsidePopup seems to
be false on all platforms other than Windows.

Change-Id: I55692cf2cae4c8f9e46976b105660bca96bd65e6
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
(cherry picked from commit fc9af570507bf067a182ab3f1c2f51a29f59e38c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-05 18:24:02 +00:00
Ahmad Samir
28161ab42e QTimer: QChronoTimer isn't necessarily going to supersede QTimer
... since no consensus has been reached about what to do in Qt7 (whether
to fold QChronoTimer back into QTimer or let QTimer be as-is to not
break any existing code and use QChronoTimer in new code).

Task-number: QTBUG-128426
Change-Id: I7d09b803b4f0df3ea7f48a5d900d0ae4be721d7b
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 87030778969165a285af2d919d6d7293e8078b6a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-05 18:24:02 +00:00
Marc Mutz
c92b1f294e QLocale: mark equals() noexcept
It effectively was, relational operators should be, and
comparesEqual(), which calls equals(), actually already was marked as
noexcept, so also mark the out-of-line function.

Found in API review.

Change-Id: I3fce2277f328284e098afeee40c319a7ba85fefe
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit e358f3158cc2d5c248b5626f15e556414fc0cd6a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-05 15:50:25 +00:00
Mate Barany
3758321282 Merge the block and blockbase classes in qauthenticator.cpp
The inheritance is probably unnecessary.

As a drive-by, initialize all the members to silence the original
Axivion warning.

Task-number: QTBUG-127539
Change-Id: Iba9d8f2cba246616dbb6e8e9b7b21e8589af84d9
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit de3dd3878c2305be81d539e768788e2713c81423)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-05 15:28:34 +00:00
Mårten Nordheim
91730ecf3b Containers: correct documentation for QMulti(Map|Hash)
They're no longer just convenience subclasses.

Pick-to: 6.7 6.5
Change-Id: I80b52eeac4a68f6b546b635c792a17e975d3d7e7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 1666ce930b980ec73f01b038eb8d1a2a7b180ea4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-05 15:28:32 +00:00
Joerg Bornemann
21cca5bb93 Simplify the console detection for QT_WIN_DEBUG_CONSOLE
Instead of reading the PE header we can try to retrieve the stdout
handle, and if it's present, we have a console, or redirected output.

This amends commit 639437cf34783573e14d35ceb68ee8d9de495d7b.

Pick-to: 6.7
Task-number: QTBUG-127732
Change-Id: Ib6dd1a37552519fd867e7c39e588a085513f97e0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Zhao Yuhang <yuhangzhao@deepin.org>
(cherry picked from commit dfa52e3ae63432c1bfbb70b258ba96f7bfa5d3b6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-05 15:28:31 +00:00
Marc Mutz
a5752f4cb4 QUtf8StringView: fix missing inline keywords
This probably wasn't triggering anything, because the class happens to
be a template, but don't let the poor guy that will de-templatize this
come Qt 7 run into this.

Also add the customary "defined in qstring.h" comment.

Found in API-review.

Amends 3d0eaf863edeed9095b35026974a54cc7d418962,
9b945b381a78b56b14d46ec314f0f69264ac0602,
4c931155043af6bbd9c36475fa8d3cb14e65f644 and
b977ae371a753a82e1d0bb32c5b62099da663721.

Change-Id: I45b2a808dca5ea335a1771df9cfeb4e67bd185f3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
(cherry picked from commit 183a775f80a029136416c75a66f74e4c099e0d32)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-05 12:34:55 +00:00
Łukasz Matysiak
a87db277ce Prevent linker error in tst_qfloat16::ordering on VxWorks
tst_qfloat16::ordering tests that qfloat16 can be compared with a long
double. When on x86_64, conversion from qfloat16 to long double leads to
a linker error due to undefined reference to __extendhfxf2.  This is a
bug in the VxWorks' toolchain. It has been acknowledged by WindRiver and
it's being tracked in ticket 00154117.

Since
- this is a platform problem and Qt has no control over it,
- the conversion won't work for any client code anyway, so not testing it
  is not hiding any issues,
mitigate the problem for now by not compiling the problematic test code
on VxWorks.

Task-number: QTBUG-115777
Change-Id: Icf81da405d1392ae3bcacc61745a54d68b849b89
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 6ef631c7992cc81ead158c5c5801f689b21fc378)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-05 12:29:51 +00:00
Thiago Macieira
02510e11a9 tst_QPluginLoader: use qCpuHasFeature instead of __builtin_cpu_supports
Fixes a build problem on VxWorks because their runtime library isn't
libgcc.a and is thus missing the symbols that the Clang emits into the
test code when the intrinsic is used. This also better aligns the CPU
check with what QtCore does.

Drive-by add a comment explaining what this is and why Darwin is
excluded.

Drive-by clean up of the CMakeLists.txt, especially the no-ops.

Task-number: QTBUG-115777
Change-Id: Ib15e33ce157f7e6d99d0530076de6a1024733ed6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 5f522947878690bf7b99ff4b39a6cbaa259b74b1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-05 12:29:51 +00:00
Milian Wolff
ba6ffd99e2 Don't increase the refcount if qobject_cast failed
Follow the dynamicCast/dynamic_pointer_cast implementation for
objectCast/object_pointer_cast since a qobject_cast can fail
just like a dynamic dast.
Also see: https://eel.is/c++draft/util.smartptr.shared.cast#6.2

See commit this commit from 2013 for more historical context:
a094bf5a893c3cccffff10c1420bfbe3a3c02a7c

Pick-to: 6.7 6.5
Change-Id: I9a54af55a7a1cf106cace52e9cf3bc103ae0bd42
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 7a65abb50eb638de445e24c2746d7f90c1b89f06)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-05 12:29:51 +00:00
David Faure
9da25cc13c Doc: remove wrong \since for QDateTime::from[M]SecsSinceEpoch(qint64)
QDateTime::fromMSecsSinceEpoch(qint64) exists since Qt 4.7,

and Qt 5 had a fromSecsSinceEpoch(qint64 sec, Qt::TimeSpec spe = Qt::LocalTime, int offsetFromUtc = 0);
so writing fromSecsSinceEpoch(qint64) is backward compatible, "since 6.5" is confusing.

commit f46c18c6273897edfd13d68121741ff8fe8f434f erroneously added
\since 6.5 to these overload.

Change-Id: I91027dcc2e4f20bfc7af643c349131a7f53d8367
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 780d5a089c0fe1db8dc59d4c61d5bb86a4d97b5a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-05 10:18:24 +00:00
Paul Olav Tvete
fa254beb64 QWindowContainer: Respect WA_DontCreateNativeAncestors
QWindowContainer forces a native window if it has a scroll area or an
MDI area as an ancestor. This breaks if WA_DontCreateNativeAncestors is
set, because the window container logic assumes that either there are no
native widgets in the parent chain, or all of them are native.

To avoid this problem, don't turn the window container native if it has
the WA_DontCreateNativeAncestors attribute set.

Task-number: QTBUG-128029
Change-Id: Ifca50c9abd7175a0af5b62b196a86a463a11be31
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: David Edmundson <davidedmundson@kde.org>
(cherry picked from commit 14481614439a2fcb1f7f3d7820334f5af50be732)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-04 14:28:53 +00:00
Ivan Solovev
0aed515878 Do not export QDnsTlsAssociationRecord wholesale
This is a non-polymorphic class, so explicitly export only the
out-of-line methods.

Amends 4503dabfbd11c084c2781a679c9af12d5fb8f763.

Found in 6.8 API review.

Change-Id: I600d355a3b3abd321841dfc33030de9e5707c38a
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 81bcff5c78954eab091856d28eca69784c0889c4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-04 14:00:45 +00:00
Mate Barany
e11a957678 Pass PrefixTable and PrefixTableEntry by value
Small, trivially copyable and trivially destructible types should be
passed by value.

Found by an Axivion Scan.

Task-number: QTBUG-125026
Pick-to: 6.7 6.5
Change-Id: I870b276a22dca55eac9afac8713cc81bf8ddcf32
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit f6e964d0f67b0f1324986fb63a23cbbac78dc503)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-04 14:00:45 +00:00
Joerg Bornemann
1b22ef4a35 configure: Add example how to pass CMake variables
Be more precise in how to pass CMake variables to configure.

Task-number: QTBUG-128424
Change-Id: I0f3e7d049fa861631587a4fb79e93be54319bbee
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
(cherry picked from commit 0a4d023e5fd2bd166503a27591c456991f680823)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-04 14:00:45 +00:00
Mate Barany
19b710951f Pass CodeEntry by value
It is a small and trivially copyable type.

Found by an Axivion scan.

Task-number: QTBUG-125026
Pick-to: 6.7 6.5
Change-Id: If8efe667f8b7a40038d904386ef2fed15cd8f94d
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit 9e0c3e85b5d102442ad519a3454d7c63fddf920d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-04 14:00:44 +00:00
Wladimir Leuschner
d6f33a70c8 QWindows11Style:Increase QDateTimeEdit width for layouted QDateTimeEdits
Fixes: QTBUG-124235
Pick-to: 6.7
Change-Id: I252dd59a716e4897baf96988307a335671bb141b
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 5a1ea842c9259f4b0cddd5b2166d9736516af257)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-04 14:00:44 +00:00
Jøger Hansegård
f2a5284d94 Update tika-mimetypes.xml from upstream
This patch updates the tika-mimetypes.xml MIME types definition file to
version 5101bc7fb090ed7deffe56837d7633c9485a1e5d, which is currently the
latest on upstream main.

The reason for the change is to include audio/flac as an alias for the
nonstandard audio/x-flac MIME type, which enables QtMultimedia to
automatically determine a suitable file-extension for FLAC audio files.

[ChangeLog][Third-Party Code] Updated TIKA MIME types definition file to
add the audio/flac MIME type as an alias for audio/x-flac MIME type.

Pick-to: 6.7 6.5
Change-Id: Id2596f5aea55041a1cbbdcbfbd7500b652444bad
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 265187518d13571ff2b991a00ec0011df61f7ae5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-04 14:00:44 +00:00
Laszlo Agocs
30981cf522 rhi docs: Correct inmodule and inheaderfile for all types
For QRhi this has been done not so long ago, but it seems the individual
classes, for example, QRhiTexture suffer from the same: the genereated
docs list the forwarding header, that does not exist.

Fixes: QTBUG-128548
Change-Id: I6a58caf45fa9bbfdb5b91311d7484c0954ad63e1
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 35791751a21f709d00726fb495bebc707f90a166)
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2024-09-04 11:00:21 +00:00
Laszlo Agocs
80012d4df3 rhi: d3d11: Do not ignore firstInstance>0 when instanceCount==1
Pick-to: 6.7 6.6 6.5
Change-Id: I145c2080b914712d8629cd29eb7d228050884cbf
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit e0f9cf13f238f0b2132bb87660e9b5ba25e7b847)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-04 11:00:21 +00:00
Nodir Temirkhodjaev
631a4285b4 Windows: Fix qAbort() definition for MSVC with unity build
src\corelib\global\qglobal_p.h(57): error C2381: 'qAbort': redefinition; 'noreturn' differs
src/corelib/global/qassert.cpp(24): note: see declaration of 'qAbort'

The error started after 1ef5f50e, when unity build source files changed.

Change-Id: Id90ee20976423b9ae6ec691ee15602256f7c1fe9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 23877db5639deca70dc8cc1a7299b2cee629c7d8)
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2024-09-04 10:37:48 +02:00
Morten Sørvig
9e7eef5def wasm: simplify QWasmWindow constructor
The code implements parts of the event handling as lambdas in
the constructor. This makes it hard to see what the constructor
code itself does.

Instead, move the initial handling of the emscripten::val
event to event handler functions, which then call the existing
process event functions.

Change-Id: I3abc5be47b080c772c699c21f2fe1cc555ff8192
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
(cherry picked from commit 3117d88cdf2324a7833cdf9ceecc4cba30e1e090)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-04 08:37:48 +00:00
Ivan Solovev
e2198f7580 QNetworkReply::setWellKnownHeaders: use QByteArrayView
The private implementation already uses QByteArrayView, so the fix is
trivial.

Amends c6438054b91b7017b95706677e0194ed4f1e9e7d.

Found in 6.8 API review.

Change-Id: I41a62557ca82d31a814ceb3f5079a60ca8c437c4
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 525bbfb5dfd1a5f3a6e4a5bc0126714232e20f9d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-04 08:37:48 +00:00
Ivan Solovev
ea1a6d3ae0 QLocale: add (in)equality operators with QLocale::Language
We do have an implicit constructor which allows construction of a
QLocale from the QLocale::Language enum values. It will be used when
doing the comparison.
However, do not rely on the implicit conversions, and provide the
operators that explicitly do the right thing. This also allows us to
save an extra allocation of QLocalePrivate.

Found in Qt 6.8 API review.

Amends 71bbc35a3774ba7411970ff74068f5211b73e425.

As a drive-by: fix the order of the test slots in the unit test.

Change-Id: I37f8f5881469b7734705e06e471746814dd2ddf0
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 403b1abcad5f437c51dfabd7095b814e99e197a1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-04 08:37:48 +00:00
Ivan Solovev
5c5bedd2a6 QLocaleData: make static methods noexcept
QLocaleData::c() simply returns a pointer to a static constexpr array,
so it can be noexcept. The Q_ASSERT there simply checks internal data
consistency.

QLocaleData::findLocaleIndex() uses a QVarLengthArray, but the size
is hardcoded at compile time, and the implementation does not add
more elements, so it will never allocate. The static
findLocaleIndexById() helper can be made noexcept, because we
already made most of the QLocaleId methods noexcept. This allows us to
make QLocaleData::findLocaleIndex() noexcept as well.

Resulted from 6.8 API review, so picking to 6.8.

Change-Id: Iaa9ccaa127f2ba13235b9c0f91a72048067266f5
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 205c64bd112e074920557f34bef8a3807350f7e9)
2024-09-04 08:37:48 +00:00
Ivan Solovev
759065adff QLocaleId: make most of the methods noexcept
All inline methods simply operate on ushort members, so they can be
noexcept.
The withLikelySubtagsAdded() method operates on static constexpr
array of locales. It does not allocate and cannot throw. The asserts
are there to check the internal consistency. So, it can also be made
noexcept.
Consequently, withLikelySubtagsRemoved() can be made noexcept, because
it only calls withLikelySubtagsAdded(), and does some trivial checks.

The only two methods that cannot be made noexept are:
* QLocaleId::name(), which obviously allocates a QByteArray
* QLocaleId::fromName(), because it end up calling a static
  isScript() helper, which allocates a QString.

The isScript() helper possibly can be rewritten to avoid allocations,
but that's an exercise for another patch.

Resulted from 6.8 API review, so picking to 6.8.

Change-Id: I9e98df31f9c13171bc005250024aa4ffb0faedb8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 2485aae3ff3fa56833009f4766e53068667a7435)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-04 08:37:47 +00:00
Tor Arne Vestbø
046cc59aee XCB/Windows: Decouple foreign window from QWindow parent on destroy
Qt's foreign windows do not take (full) ownership of the native handle,
so our platform window implementations take care to not fully destroy
the native handle in their destructors.

But if the foreign window had a QWindow parent at the time of
destruction, and we fail to decouple the native handle from its
native handle parent, the destruction of the QWindow parent may
bring down the foreign window native handle as well, as part of
deleting the parent QWindow's native handle.

We take care to selectively do this decoupling on macOS, iOS, and
Android, but were failing to do so on XCB and Windows. This has now
been corrected, which allows us to remove the workaround in QWindow,
which was also in the wrong place (before setVisible(false) on the
foreign window child).

Note that we do not unconditionally reparent the foreign window, as
it might be a foreign window used for containing other QWindows, in
which case we don't want to mess with the native view hierarchy.

Change-Id: Ic526ca63fbf72dae5013ae9e44cb5cddf61c944b
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit 8f8ce8d7a7e029e62a4f9b5b209dcc37f61410cb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-04 08:37:47 +00:00
Laszlo Agocs
fb6cfadc38 rhi: gl: Make QQuickWidget and QRhiWidget work on eglfs
Strictly speaking, the problem has nothing to do with QRhi. What is
special with the eglfs' backingstore is that it creates a QRhiTexture
and then pulls out the OpenGL texture ID via nativeTexture() right
afterwards.

In this setup there is nothing that would ensure glTexParameteri is
called to override the silly default of OpenGL. Normally this cannot
happen because once the QRhiTexture is used for sampling purposes
together with a QRhiSampler, all necessary state gets updated.

Starting from Qt 6.4, with the QRhi-based backingstore composition
changes, the special case where we create QRhiTextures just to get the
underlying OpenGL texture got introduced.

Ideally the eglfs side should provide its in MIN/MAG filter state, but
in the meantime, to be more robust, always set a MIN filter already in
QRhiTexture::create(). For most textures this will get changed
afterwards.

Change-Id: I305cdbb5576b977887b85a15b72455bb3ae430c4
Pick-to: 6.7 6.6 6.5
Fixes: QTBUG-123551
Reviewed-by: Karim Pinter <karim.pinter@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 88aa5250d58900653192c45e41f182ec88474e38)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-04 06:27:09 +00:00
Christian Ehrlicher
5b4842c992 Itemviews/doc: add not about ownership for setItemWidget()
QListWidget/QTreeWidget::setItemWidget() take ownership of the widget.
This was documented for QTreeWidget but not for QListWidget. Unify the
wording with QAbstractItemView::setIndexWidget() (which gets called by
setItemWidget()).

Pick-to: 6.7 6.5
Change-Id: I272a20b7e7be13df1ddd9f2ba552dd9da68e2a3b
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 53c6c73c57d36796577a13fd4dd82a04ee9647ab)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-03 22:12:50 +00:00
Marc Mutz
892012e5d9 QDirListing: Extract Method next() from const_iterator::op++()
Having the actual const_iterator::operator++() as an out-of-line
member function means that the implicit this pointer forces the object
onto the stack (registers don't have addresses that could be
passed). Since const_iterator is now merely a thinly-disguised
pointer, that would cause terrible codegen.

So, apply a technique originally developed for QStringView and make
the operator an inline function that re-sets the member dirEntry using
a call to a QDirListing static function that takes and returns by
value. Passing by value enables passing in registers, which means the
iterator object can now be a register value and doesn't require
spilling to the stack to call the function.

Found in API-review.

Change-Id: I9f4d5be5b72249b368ef3dea9d857178ca7e16aa
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit aec8398d71d351e956683a695af51317fe65097e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-03 18:06:59 +00:00
Marc Mutz
46ec49894d QDirListing: make const_iterator move-only
The std::input_iterator concept does not require copyable, only
movable. This makes handling input_iterators safer, because copies of
input iterators since advanced zap into partially-formed state without
changing their bit pattern. If the iterator is, however, only movable,
no such zapping copies can exist.

Take advantage of this and make QDirListing::const_iterator
move-only. Its iterators are anyway no longer compatible with
classical STL algorithms, so we're not restricting their use further.

Found in API review.

Task-number: QTBUG-125512
Change-Id: Ic1dee22881893fdbf159bbfd335c10505eaffa9f
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 29dfcc240b3e29d5d6149c2996cfdb9d71b776bb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-03 18:06:54 +00:00
Marc Mutz
a1d4c64715 Make QDirListing::const_iterator post-increment return void
std::weakly_incrementable doesn't require a std::input_iterator's
post-increment operator to return anything¹, so don't.

¹ https://eel.is/c++draft/iterator.concepts#iterator.concept.winc-14

The return value of post-increment on objects that model
input_iterator is partially-formed (as a copy of an iterator since
advanced), so any attempts to use it, apart from assigning a new
iterator or destroying it, are undefined, anyway.

Found in API-review.

Change-Id: If0c07250cec4e48c6e5176cd23864651e8ec3d27
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit fd89fc8c27460e2c11d9e3decc38cf61c186f984)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-03 18:06:45 +00:00
Marc Mutz
5cb51e4afe QDirListing: simplify const_iterator
There's no need to carry the same QDirListingPrivate* around
twice. Remove const_iterator's direct QDirListingPrivate* member and
re-use the one from its DirEntry member.

Requires adding a private const_iterator::atEnd() helper function,
because while const_iterator and its member functions are implicit
friends of DirEntry, friend functions of const_iterator are
not. Improves readability, too.

Found in API-review.

Change-Id: I82b9273950e174d7598ee531fbd5dfb472911b71
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 0ede7f541dfc6cba163e1452aee7239818a42c1b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-03 18:06:39 +00:00
Marc Mutz
089263fd4f QDirListing: make end() return a sentinel
This simplifies the implementation, and is more secure, because you no
longer can compare const_iterator with const_iterator and get a
non-sensical result (unequal, even though copies of each other).

Requires the STL algorithm test to be ported to C++20 ranges, because
classical STL algorithms can't deal with decltype(first) !=
decltype(last).

Found in API-review.

As a drive-by, make the reversed and inverted operators conditional on
!__cpp_impl_three_way_comparison.

Change-Id: Icd0e4dac277bd3b053f7b648f8c3f9d9f3753299
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 2569ca0f34fe15a2e5c828b708f1406be8d53836)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-03 18:06:32 +00:00
Alexandru Croitor
e9a95ae4b8 CMake: Add the Qt-specific CPE to 3rd party entity types in SBOM
Some vendored 3rd party sources or libraries may not have a CPE
because the upstream disappeared, we don't know where the files
originally originated from, or no CPE was ever issued.

Given that the 3rd party files are shipped with Qt, they can
be considered as part of the "Qt" CPE for vulnerability tracking
reasons.

In such cases, we should add the Qt-specific CPE to the SBOM to ensure
that the SBOM is as complete as possible when tooling analyzes the
third party packages.

Task-number: QTBUG-122899
Change-Id: I32a70e24742a860198f3a6b12bdb4a06057f1ab3
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 3cadd4b1f62479cce88c99cd8c95729ac10a6126)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-03 16:59:19 +00:00
Alexandru Croitor
efc3a9972d CMake: Add a function to detect qt 3rd party entity types for SBOM
Removes some condition duplication.

Task-number: QTBUG-122899
Change-Id: Ib245a96b5f8c78b2744cb4fd09a392b2924bf45c
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit ce7a01f0ec411643d8436c23a0d465b5746ac6be)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-03 16:59:17 +00:00
Ahmad Samir
0773176fc2 QTimer: fix calculation error in API docs
The range guaranteed by std¹ for nanosecond resolution is ±292 years,
not ±292 million.

¹ https://eel.is/c++draft/time.syn,
  https://en.cppreference.com/w/cpp/chrono/duration#Helper_types,
  std::cout << chrono::floor<years>(nanoseconds::max()) << '\n';

Since, in general, there is no integer type with ≥ 45 bits, but < 64
bits, the practical limit for milliseconds remains, indeed, ±292
million, so the QDateTime docs don't need fixing.

Change-Id: I5ae7f9706f147c6f490ba17b10cebe96426bbba2
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 051488c5faf5410e938978d4c1609c7a85074c57)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-03 16:52:24 +00:00
Vladimir Belyavsky
400426c388 QCocoaScreen: Account for platform window deletion during deliverUpdateRequest
Platform window may be destroyed during update request delivery.
For instance, in Qt Quick a user may close a window using some
animation with QML ScriptAction.

To handle such a situation and prevent a crash due to a dangling
pointer, we can simply protect the platformWindow pointer using
QPointer.

Fixes: QTBUG-128516
Pick-to: 6.7 6.5
Change-Id: I49ecec09d62e184f5df17794b303f147b705e2e3
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 2ef1a338a91659871675514921f9a7dc8d1c8805)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-03 16:34:51 +00:00
Morten Sørvig
98c1a46a7d wams: disable delayed onload/first frame features
requestUpdateHold was not getting enabled properly in some
cases, in particular when using a custom html file to load
the application.

The assert on g_mainThreadEnvetDispatcher is also asserting,
with a following dereference of a null pointer.

Change-Id: Ibf77d90b84f8319a894e2df34a134d2e4265fe05
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
(cherry picked from commit 10afdc339e08ce1e6a8173df97a3f2edeb27cb57)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-03 10:57:33 +00:00
Marc Mutz
0ae162e2a9 QPdfWriter: pass QUuid by value
QUuid is a) trivially copyable, b) ≤ 16 bytes, so as per [1] should be
passed by value. Clazy, indeed, complains, so fix it.

Found in API-review.

Amends 2fbece8a73cb2d2692c78c38e1576c0c9c62fce7.

[1] https://www.macieira.org/blog/2012/02/the-value-of-passing-by-value/

Change-Id: I321ebd650dac8e58c173d957259c3700b1f59ace
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 7550f0e2c1a4ca10a0e4604e2d429b98481d4e2d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-03 07:47:43 +00:00
Ville Voutilainen
69d5d78ce9 Typo fix for doc of QJniObject::callMethod()
Change-Id: Ia13fe108526eb08b4fb1eefcc0f23aaa6f102793
Pick-to: 6.7 6.5
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 77f1dbabb7b6a72ee5af19a0e7f0a0dc31a0afb5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-03 06:24:48 +00:00
Wang Yu
29b141d88f QWindowPrivate: Guard against not having any QScreens when updating DPR
On some platforms (Windows and macOS) it has been observed that the
platform layer removes all screens, without providing a dummy screen.
This results in QGuiApplication::screens() being empty. As updating
the cached DPR for a window is part of the window moving to a new
screen, we have to guard for the case where the window moves to
a nullptr screen (because QGuiApplication::primaryScreen() is now
null).

We use the QGuiApplication::devicePixelRatio() fallback path, which
returns 1.0 if there are no screens.

Fixes: QTBUG-128390
Pick-to: 6.7
Change-Id: I3ba20590047f1ef49c8d3ac5b7556b814a105ce4
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit fbf957de5feded9cbbd60feacaa08c9902815c38)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-03 06:24:46 +00:00
Tatiana Borisova
e5d96ae7d4 Revert "Convert a Qt ordering type to the weaker std ordering type"
This reverts commit 521e091bca1764d53ac06bb60707475d1032f5d5.

Reason for revert: The fix doesn't work with MSVC2022 compiler and block windows-11_23H2-msvc2022-developer-build integration. Need time to find proper solution.

Task-number: QTBUG-128498
Change-Id: Id938fa2119c7e4c053398b2a3693f3128e53f734
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 1017a0eaf1f9fd9cc37189f73840d85bf4a5664c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-02 18:10:39 +00:00
Joerg Bornemann
ba30932cdf configure: Add note how to set CMake variable to help output
It seemed to be common, yet undocumented knowledge how to pass CMake
variables to configure / qt-configure-module.

Task-number: QTBUG-128424
Change-Id: I10e896402aa0a9e1add8746765bfcea955417ee1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 13e096b49ecd7d77ba8b43ee8ff58f7db05d9f6e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-02 18:10:39 +00:00
Marc Mutz
e5ecbb846f qhttpheaders.h: don't include <qmetaobject.h>
Despite the name, it doesn't contain the definition of QMetaObject
(that's in qobjectdefs.h), only of QMetaMethod, QMetaEnum, etc.

Replace the include with qobjectdefs.h.

Found in API-review.

Amends fa456ad5501dc74446329222d12ba0fa2ecd0457.

Change-Id: Ic7fb83c07a866ca981b100e68cc0529bd13e929f
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 248a1ce4bdb2b211a812db4783354f7fbc2ff662)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-02 18:10:38 +00:00
Laszlo Agocs
7d64c858b5 rhi: Make res. update batch buffer op list more bounded
Make the behavior more bounded, by disallowing keeping large sets of
buffer data for reuse.

The idea being that once I uploaded say the Sponza model (e.g. 10 MB of
vertex data merged into one blob), it is not beneficial to keep that
huge allocation since the total size of the data from per-frame buffer
changes will be in a whole different (smaller) league typically, and the
chance of another (single) buffer update that utilizes the whole 10 MB
on its own is rather small.

Have a simple (and cheap to execute) rule that no batch keeps more than
1 MB of QRhiBufferData (in total, regardless how many buffer operations
it contained/contains). If the limit is exceeded, we clear().

The catch is that even without doing the 1 MB check, there is a high
chance that the Sponza model data will be gone in a few frames
eventually, due to implicit sharing and how the QRhi backends and Qt
Quick(3D) work and shuffle their resource update batch requests and
submissions. So for many applications this is expected to change nothing
when it comes to their memory consumption profile.

Expand the comments further.

Change-Id: I93061d073b43e747a0772a3119ebdb89bed02ae0
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit bc2c09a182c2bc80c307e7e71e0f12c1c31edc3d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-02 18:10:38 +00:00
Laszlo Agocs
e4bd5c631a rhi: Add a way to get an insight to res.update batch data
Instead of speculating about resource update batch pools, have a
toggleable debug message that shows exactly what one needs to know. Set
qt.rhi.rub to true to enable. Note that it is not a qCDebug since we do
not want isEnabled() checks no matter how cheap on hot code paths.
Rather, the state of the category is checked just once on
QRhi::create(). As we want some output from QRhiBufferData too, this is
static (setting the bool flag may not be entirely thread safe
technically but we can live with it).

In addition, harden size() and constData() in QRhiBufferData, although
these d != null checks are a waste of time with the current
implementation, but be safe.

Remove the unused QT_RHI_MINIMIZE_POOLS environment variable. This is
forgotten completely by now and serves no practical purpose. Those who
want a proper release of all pools should call releaseCachedResources()
(i.e. QQuickWindow::releaseResources()).

Expand the comments as well.

Change-Id: I4942cf7c3f2ecff47991e42e14c61b432f232170
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit cbab56fdcbff6965d2aafd0c00eebacb7809ceba)
2024-09-02 20:10:38 +02:00
Volker Hilsheimer
d05438454f JNI: Add test coverage for a jobjectArray in a native function
Make sure this works as it should. The bug report/support request wants
to have a String[] parameter on the Java side, but then the C++ side can
not use jobjectArray (as that has "[Ljava/lang/Object;" as signature),
so use Object[] instead (which is one solution; the other is to use
QList<jstring> or (in 6.8) QStringList on the C++ side.

What's easy to miss is that the jobjectArray that we get is a local ref,
so we have to extend its lifetime by creating a QJniObject holding it as
a global reference. We can then create a QJniArray from that QJniObject
(without any type safety).

Task-number: QTBUG-128456
Change-Id: I1e03b811165f9bc5106324d39fb58114ee8cf398
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
(cherry picked from commit f9fd5870f7379103005839bc03543bb8f6da94c3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-02 18:10:38 +00:00
Ahmad Samir
fbf052132e QObject: fix API docs
Should be just "timer" instead of QChronoTimer.

Change-Id: I76cb9ae712cfe9a9713a85888022e54300d308d3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit a5f1cec8bf22f19bbf7ffe058c407d5045e4126a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-02 18:10:38 +00:00
Christian Ehrlicher
da87068f7f SQL/Doc: improve documentation on building and debugging a sql driver
Add some notes on the prerequisites when building a sql driver from
source and also add some more notes in the troubleshooting section.

Pick-to: 6.7 6.5
Change-Id: I8ffbcf4182c2ad2c7b9f86209e0ce332fd27d73c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 1f31c5f3cd722f06e4f41457ec1322365d78c018)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-02 15:18:44 +00:00
Ahmad Samir
c9fe636dfc QBasicTimer: port to Qt::TimerId
[ChangeLog][QtCore][QBasicTimer] Added id() method returning
Qt::TimerId.

Fixes: QTBUG-128144
Change-Id: Idbe29311cca3befb771dbf1ef976a42e65e59ce9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 751cbbd6b13d9899e31c19d9db80d1c64a72a8bd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-01 10:51:01 +00:00
Ahmad Samir
0945ca9a01 QObject: code snippets cleanup
Use chrono literals; remove comment about C++14.

Change-Id: I1594780946dd3e646b5a4f68dad4996f0572f317
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 81e3d10ca5913a79f5e53043bfd33d03f25253f5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-01 10:50:55 +00:00
Ahmad Samir
91ed5ddff5 QObject: use Qt::TimerId in the code snippets and API docs
Mention QTimerEvent::id(), which returns Qt::TimerId, instead of
QTimerEvent::timerId() which returns int in the API docs.

Task-number: QTBUG-128144
Change-Id: Id19aebd044fbd734872e5580efcb3842eb42b2b0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 7595c21be86f247dd419d08d7d26327fe2d7a736)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-01 10:50:50 +00:00
Ahmad Samir
0bd6bbedea QOperatingSystemVersion: add trailing comma to last member in enum
Task-number: QTBUG-125859
Change-Id: I374d7e676765cc00788224d980a29c16a6330648
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 8c2dcfc79aaa812ae671304c39d006ed6782cb74)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-01 10:50:45 +00:00
Christian Ehrlicher
3b208bcfa5 QGenericUnixServices: properly disconnect signals in dtor
Since QGenericUnixServices does not derive from QObject, the connection
to QDBusPendingCallWatcher made in the ctor might outlive the lifetime
of QGenericUnixServices.
Fix it by explicitly disconnecting it in the dtor.

Fixes: QTBUG-125239
Pick-to: 6.7 6.5
Change-Id: I5fac4fd5831b2dde16b3d7b479a8ee616bfb7e3a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit de609d84b9cee4a481d1718c00b09105d8c2ae69)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-31 08:57:09 +00:00
Marc Mutz
0396def8ad Make Container::max_size() non-static member functions
... as is required by the standard.

We have already found that QAnyStringView::max_size() can also not be
static (because the size depends on the charset of the contained
data), so we have a second reason (besides STL compatibility) to
change the current static into non-static max_size() member functions:
Qt consistency.

Found in API-Review.

Amends 7ce6920aacfcba485cd8017e01c6aeb324292e75.

Fixes: QTBUG-128450
Change-Id: Id5ee3fec82bc557bd83b6843838ccdd753442cd0
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 6d5e39f4756945b8ada74d745bd949856c1b17f9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-31 08:56:46 +00:00
Edward Welbourne
bcd33276d1 Include relevant Unicode Inc. copyright line in generated data files
This amends commit 880d1aef99a6826c8dd690b13e1ca6ea5574f403 and
extends it to cover the testlocales program under util/.

Pick-to: 6.7 6.5
Task-number: QTBUG-121653
Change-Id: I3efadc69ce08810876f8e20aa4636c7624728153
Reviewed-by: Lucie Gerard <lucie.gerard@qt.io>
(cherry picked from commit 00644f4b6d69d82a8d27f3b0619de88c0e4fdd6f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-31 08:56:42 +00:00
Ahmad Samir
e97da8bc9d QChronoTimer: compare timer IDs to Qt::TimerId::Invalid consistently
Always `if (id != Qt::TimerId::Invalid)`.

Change-Id: If16e1cb54d3e7b4325019eb292263c25cd7d3805
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 637fcc69c87352c21658fea1083e93786f64fc37)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-31 08:56:39 +00:00
Thiago Macieira
cb35f1e858 Containers: add a static constexpr maxSize()
max_size() will be made non-static to strictly follow the C++ Standard
Library concept, but it makes no sense for the Qt containers to have
allocations limited per instance, as they are not allocator-aware. This
commit adds a Qt-style camelCase() function to the STL-style
snake_case() with the semantics we want.

Task-number: QTBUG-128450
Change-Id: I2e4aa228c71c821c01bafc0f37956d29fe652ef1
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 6306ebe749e083126a39b9dd13d7060aa7bdacc2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-31 08:56:34 +00:00
Thiago Macieira
6978951d5e Fix users of static max_size()
Container::max_size() is a _non-static_ member function in the STL, so
we can't call it as C::max_size(). Instead, use the newly-added,
Qt-style camel-case maxSize(), which we will keep static constexpr.

Task-number: QTBUG-128450
Change-Id: I839df90a91cced85f000c7d2744ba547f629ed98
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 6c15f99853c4cecd9285e189a441392a397b0f82)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-31 08:56:31 +00:00
Edward Welbourne
1d725c0094 Mention GMT-offset form of short-names for timezones
This fixes the documentation side of an issue with QTZ::displayName()
not doing what's documented. (The MS-eccentricities have been fixed by
earlier work.)

Fixes: QTBUG-84297
Change-Id: I3ec522aa81741fbf2d3dd247786310304e14f304
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit b3a00a38af1226ebd6617638872d540f1ecd76df)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-31 08:56:29 +00:00
Ivan Solovev
f5a2d34da8 Add max_size() and maxSize() to view types
That requires including qcontainerfwd.h to the headers, so that
we could get access to QtPrivate::MaxAllocSize.

The max_size() methods are added for compatibility with stl.
The logic for most of the views is similar. The only exception is
QAnyStringView, because its character size may vary, depending on the
contained data.

The maxSize() methods are the static equivalents of max_size().
QASV does not have it for the reasons mentioned above.

[ChangeLog][QtCore] Added max_size() to all string-view types.

Amends 7ce6920aacfcba485cd8017e01c6aeb324292e75.

Found in 6.8 API review.

Change-Id: I467c7d64ec3d92eb424eb5b94a39ec3d45d63d1f
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 2382bfb5b03f6f03a31981dc416121cf556b962a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-31 08:56:26 +00:00
Ahmad Samir
60ed64e1d6 QTimerEvent: port to Qt::TimerId
[ChangeLog][QtCore][QTimerEvent] Added constructor taking a Qt::TimerId.
Also added a getter for Qt::TimerId.

[ChangeLog][Potentially Source-Incompatible Changes] The protected
(and undocumented) QTimerEvent::id member variable has been renamed to
m_id to allow for the addition of an id() getter that returns a
Qt::TimerId.

Task-number: QTBUG-128144
Change-Id: Ia156f11e9e9347b6bf61b36e40da3ad551d23407
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 29b98eabf07b9e9d223039ec58b989acbaba844c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-31 08:56:23 +00:00
David Faure
cd528d81f7 QWidgetWindow: fix enter/leave events not sent due to fractional scaling
If widget A starts at y=0 and widget B starts at y=19, when the mouse
moves from y=15 to y=18.6667, the code was doing childAt(p) with a
rounded QPoint y=19 and finding B, but then the relative coord for B
was set to -0.33333 so B wasn't under the mouse and didn't get an enter
event (and since it's now the "last receiver", it doesn't get one later
either when y is bigger).

Add QWidget::childAt(QPointF) to fix this.

Fixes: QTBUG-128391
Change-Id: I76d4b711a8297648780bdd079eb67405ab12be14
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 40bde8a572bd8ed039d3f5a5ab99b281de7410bd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-31 08:56:20 +00:00
Christian Ehrlicher
5ebab802cc SQL/Interbase: Add and document Interbase_ROOT
Instead specifying Interbase_INCLUDE_DIR and Interbase_LIBRARY allow to
use Interbase_ROOT instead. Use this new option in the sql driver
documentation.
Additionally add 'fbclient_ms' as possible library name so we don't need
to distinguish between Interbase and Firebird anymore.

Change-Id: I472f95f82ebb93888002deccdf5028a1827a4745
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 89dd15e359228a57351bddc2429db4d57863bc8f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-31 08:56:17 +00:00
Mate Barany
6065ed9948 Pass QSslError::SslError by value
It is a small and trivially copyable type.

As a drive-by, make the operator a hidden friend.

Found by an Axivion scan.

[ChangeLog][Potentially Source-Incompatible Changes][QtNetwork] Made
the QSslError::SslError QDebug operator<< a hidden friend of QSslError.
This means the operator is no longer a match for arguments implicitly
converting to SslError, only for SslError itself. A backwards-compatible
fix is to make the conversion explicit: debug << QSslError::SslError(arg).

Task-number: QTBUG-125026
Change-Id: I9b6673397b6a26d508783304240c91fa058139bc
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit f02402044e552f2940d4677039f3d02c41eb27ee)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-30 23:16:27 +00:00
Fabian Kosmale
df6d88ea2c QHash: fix constness for heterogenous lookup functions
Change-Id: I161237fc243ebcf48e1318dae045f2e812796786
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 205edd15070720ce94ef5ba7d7e32b0b715abcf9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-30 13:47:33 +00:00
Ivan Solovev
48c8eef930 serialization: remove incorrect noexcept on comparison operators [2/2]
This patch is about removing noexcept on functions that use
Q_ASSERT. The argument is that in these cases Q_ASSERTs act as
precondition checks, so we should probably follow the Lakos rule.

Although, technically the change is fine, because the current
implementation of Q_ASSERT is marked as noexcept(true), there are
some ideas of changing that in future, so we should not be setting
in stone something we can't change later.

Found in 6.8 API review.

Change-Id: I1d4aa228c713821c0ebbfc0f3b956d29fe652ed8
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 5ac15093dcbaf92ac166961f5e8bfe9418cc15c0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-30 13:47:33 +00:00
Lucie Gérard
820f00693c Correct license for module and plugin file
According to QUIP-18 [1], all module and
plugin files should be
LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
or
LicenseRef-Qt-Commercial OR GPL-3.0-only

Also, LGPL and non LGPL should not be mixed in a given directory

[1]: https://contribute.qt-project.org/quips/18

Task-number: QTBUG-121787
Change-Id: I3384e5a4e40547d61118064fa1052b3d87a4e42b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit bdee35195126d230f6229b5f22d4d4a7bb15d4d1)
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-08-30 13:47:33 +00:00
Ivan Solovev
665aaf9f6a QDate: rework stdSysDaysToJulianDay()
Use !QT_CORE_REMOVED_SINCE(6, 7) to make the function a template
in new C++20 code. The removed_api.cpp will still compile the
exported version, keeping BC.

This simplifies the ifdef'ery around the functions and saves the
need for the QT6_{DECL,CALL}_NEW_OVERLOAD trick.

Picking this change down to 6.7, because the original patch was
also picked to 6.7.

Tested it on MSVC in C++20 mode, and verified that the symbol
is still there. Also tested the case from the linked bugreport,
and verified that it does not give linker errors.

Amends 88702cc87cf830b145c8bff5174748e3719364f9
and effectively reverts 91f48cc4b77b1cfb5a4490c3bed3eb97edd2f85a.

Task-number: QTBUG-125610
Pick-to: 6.7
Change-Id: Idf49fd142cdc78ff8964a36f8c1e326357e1028e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit d23764c5a12e0d6d26dd54ee5613f7e5b1f9c8af)
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2024-08-30 09:19:08 +00:00
Christian Ehrlicher
7fb7972021 Widgets/fusion style: remove check for _q_isComboBoxPopupItem property
The fusion style was the only style which checked for an undocumented
property '_q_isComboBoxPopupItem' to determine if a CE_MenuItem should
ignore the drawing of a checkmark. Remove it to be in sync with all
other styles.

Task-number: QTBUG-127536
Change-Id: I6f0af2219a2da1d8d1920cb95c233fb3e32a21ab
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit a3568a19eaba98697854db50af5546c09464ca73)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-30 06:38:49 +00:00
Christian Ehrlicher
cd34e5c7ba Widget/StylesheetStyle: don't draw checkmarks for combobox dropdown
The combobox dropdown items are drawn as CE_MenuItem elements. Those
elements may have a checkmarks but not when we draw them within a
QComboMenuDelegate. Therefore add the same check as for fusion style to
avoid drawing a checkmark in a QComboBox dropdown menu.

Fixes: QTBUG-127536
Change-Id: Ib22046b018fdf36eb26518899d2427d40b0110b8
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit c2d56961394cea799b0caa241c3517ed88aa6c66)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-30 06:38:48 +00:00
David Faure
2622b7f602 QListView/QTableView: attempt to move each row even after a failure
Change-Id: I039917c9fa82d356291e75abc7233b3b220a1931
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit bac5b6188fb18b0c41625d42809dd318abfc6c39)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 22:13:33 +00:00
Thiago Macieira
eb2a072f91 CMake/macOS: don't conclude x86_64h is a cross-compilation on x86_64
Change-Id: I60f6907e58e98e54c000fffd840dcce413b569b6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 081394894bfecd1fb9df1da90b91fbee06150358)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 21:29:05 +00:00
Marc Mutz
88e7b7e99c [docs] Separate two paragraphs in max_size() docs
Formatting indicates that this was how it should be rendered, but qdoc
won't paragraph-break unless there's an empty line.

Add it.

Amends 7ce6920aacfcba485cd8017e01c6aeb324292e75.

Change-Id: Idfd3cbc9f075b5f206c2042dc7b22508735dcb38
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 02b436f2c5d7368827794e7ec1224419dca39e7f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 20:41:57 +00:00
Marc Mutz
f8b3c1f0a7 QChronoTimer: remove static singleShot() functions
They match what QTimer already provides these days, and we want to
minimize porting for users come Qt 7, so we don't want users to first
write QChronoTimer::singleShot() (because it exists) and then back to
QTimer::singleShot(); we want them to continue to use QTimer.

The only reason QChronoTimer is a separate class from QTimer is that
the latter has an int interval property and we can't just port it to
milli- or nanoseconds chrono types if we want users to actually access
the extra range or precision afforded by the chrono types. But that's
not an issue for the singleShot() static methods, as they never return
an object that could be asked for its timeout.

(No ChangeLog needed, as QChronoTimer is new in 6.8)

Found in API-review.

Fixes: QTBUG-128426
Change-Id: Ief8b7c8d25380c0e9e9c5c36c90ce34c147557ae
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 6e5eb082c934cb94c45f3e13b3f7c2deb2e7b2e6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 20:41:50 +00:00
Marc Mutz
2fb422828e QTimer: make singleShot() have nanoseconds resolution [2/2]: new-style
Port the new-style singleShot() static methods from milliseconds to
nanoseconds resolution.

This matches what QChronoTimer provides, but we want to minimize
porting for users come Qt 7, so we don't want users to first have to
port to QChronoTimer::singleShot() and then back to
QTimer::singleShot(); we want them to continue to use QTimer.

The only reason QChronoTimer is a separate class from QTimer is that
the latter has an int interval property and we can't just port it to
milli- or nanoseconds chrono types if we want users to actually access
the extra range or precision afforded by the chrono types. But that's
not an issue for the singleShot() static methods, as they never return
an object that could be asked for its timeout.

The old-style static methods were already ported in the first step,
which also contain the ChangeLog common to both patches.

Task-number: QTBUG-128426
Change-Id: I1899465c3b852ab546983a0bf35853fdd3f91ef3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 6991e848e3a0470e301d006a799b1351909884ca)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 20:41:43 +00:00
Marc Mutz
054270c717 QDirListing: make move SMFs noexcept and inline
This requires giving up unique_ptr for a raw d-pointer:
https://stackoverflow.com/questions/9417477/where-does-the-destructor-hide-in-this-code

That isn't much of an issue, because the class is move-only.

Also add a swap() member function.

Found in API review.

Change-Id: I2478bb5d05ff7bae0111ba97e788c88f7b4dded1
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 71167b7982be4d7a9090aa6b0e0846d5e9bf303b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 20:41:38 +00:00
Marc Mutz
e6ab7847a7 QTimer: make singleShot() have nanoseconds resolution [1/2]: old-style
Port the string-based singleShot() static methods from milliseconds to
nanoseconds resolution.

This matches what QChronoTimer provides, but we want to minimize
porting for users come Qt 7, so we don't want users to first have to
port to QChronoTimer::singleShot() and then back to
QTimer::singleShot(); we want them to continue to use QTimer.

The only reason QChronoTimer is a separate class from QTimer is that
the latter has an int interval property and we can't just port it to
milli- or nanoseconds chrono types if we want users to actually access
the extra range or precision afforded by the chrono types. But that's
not an issue for the singleShot() static methods, as they never return
an object that could be asked for its timeout.

The new-style static methods will be ported in a second step.

[ChangeLog][QtCore][QTimer] The singleShot() static methods now
operate with nanoseconds resolution, like QChronoTimer. The rest of
QTimer remains milliseconds; use QChronoTimer if you need a QTimer
with nanoseconds resolution of more than INT_MAX milliseconds
range. Beware overflow that may occur when passing large milliseconds
objects that may overflow nanoseconds::rep when converted.

Task-number: QTBUG-128426
Change-Id: I11e1ad8529c67b4018f6325ac408686799475823
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 4e911bda295b53bc74cf1af26008b3e60181668d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 20:41:37 +00:00
Ivan Solovev
d4d2636e5e QDirListing: extend unit tests
Add the tests for the (move-)constructors and move-assignment.

Change-Id: I795a314a0e6d1795006fe152397eb6d9eeb3c712
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit b6466275c27f9ec4ec8b09641e203f7afef3f7e5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 20:41:36 +00:00
Ivan Solovev
cb6a3fe53e QArgumentType: remove the incorrect noexcept from comparison operators
The QArgumentType::name() getter evaluates the name lazily, which also
involves constructing a QMetaType. It's not entirely clear if adding
noexcept there is a good idea, so drop it.

Amends 5a0faa9198c6ae6e21a550159c4284d1a9c5792e.

Change-Id: I73042f22df9615f570823a7745f04e9731c097fe
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit e39eb34bc6585c5ec367727e86f70ce67c2d176a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 20:41:33 +00:00
Edward Welbourne
d12b85ae0b Document the potential widening effect of upper-casing
In QChar we don't return the upper-case from when it's not
representable as a single QChar; for strings, the uppercase string may
be longer than the original.

Pick-to: 6.7 6.5 6.2 5.15
Change-Id: I57bb1412d79d579a9cc4dc6bdbb839e56f9ea0a8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 65eb1c5579ec56d15583b4af45b50fddd3c799a6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 18:21:38 +00:00
Oliver Eftevaag
6a2c2488a1 Close popups on window deactivation and orientation changes in qGuiApp
With the introduction of QQuickPopupWindow in 6.8, much of our popup
management had to be moved from QApplication to QGuiApplication.
Most of this was done in e4ef0f03e6f1fddc397980fd7fbf6f6b829f16d9, but
closing popups on window deactivation and orientation changes, were
left in QApplication. This code path was used to close popups when the
user clicks outside of a window, on platforms suchs as wayland, were
QWindow::setMouseGrabEnabled(true) doesn't work properly.

As it turns out QApplication::notify() never calls
QGuiapplication::notify(), which is why I'm duplicating the code from
QApplication into QGuiApplication, instead of simply moving it.

Task-number: QTBUG-121363
Change-Id: I36bebd029a2f8e3ec0cdbab40971682cf948d438
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
(cherry picked from commit 914c2ef4fb926c16e8874c9c3691401f7e22ae22)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 18:21:37 +00:00
Edward Welbourne
0b89eb6c6f Remove spurious and unused QUtcTZP::init() with too few arguments
QUtcTimeZonePrivate accommodates the custom time-zone API and, as
such, needs to know all of its details when constructed. The
constructor as a plain UTC-offset constructs the details to match a
custom zone, so that it also has those details initialized. As a
result, this backend never initialized a zone from only its IANA ID,
as all the others do, so does not need an init() with that signature
(which did not adequately initialize the instance anyway).

Change-Id: I462f537c9d48e09f05f91aae0ff6c7a317b421c1
Reviewed-by: Mate Barany <mate.barany@qt.io>
Reviewed-by: Magdalena Stojek <magdalena.stojek@qt.io>
(cherry picked from commit 70b680502997678b7c9964acef6569b18b6a65bf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 18:21:35 +00:00
Łukasz Matysiak
d563ec3fba Introduce QT_COMPILER_SUPPORTS_INT128 in qsystemdetection
c661dbd42d87f151e0c6f9e50fb21a137dad850c injected `QT_NO_INT128` into
every TU when compiling for VxWorks.
VxWorks uses a custom stdlib implementation that does not support 128bit ints
and at the same time they use an off the shelf Clang that defines
`__SIZEOF_INT128__` which is used to detect if 128b ints are available.
This resulted in Qt falsely assuming that 128b ints are available.

Detect if 128bit are available instead of injecting `QT_NO_INT128` and
define `QT_COMPILER_SUPPORTS_INT128`, use it instead of directly
checking `__SIZEOF_INT128__`.

Task-number: QTBUG-115777
Change-Id: I7531ebe780b4bdd78b42daf8dae0e522a316a88e
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 5a10744bb4afc0c95b1b7bbba8848cf14b0bad00)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 18:21:34 +00:00
Alexandru Croitor
bbca3a8e02 CMake: Handle multi-value PURLs and CPEs in attribution files
Qt attribution json files might want to specify more than one PURL or
CPE for a given entry. Change the build system code to detect whether
a JSON PURL or CPE key contains an array of values, and if so, convert
it to a cmake list and use that for further SBOM handling.

As a result, the PURL_QT_VALUE, PURL_3RDPARTY_UPSTREAM_VALUE, and
PURL_MIRROR_VALUE getting an 'S' at the end, aka they are renamed to
PURL_QT_VALUES, PURL_3RDPARTY_UPSTREAM_VALUES, and PURL_MIRROR_VALUES.

Also the attribution key is now called just PURL instead of
UpstreamPURL.

The CPE json attribution key and option name stay the same.

Amends 47fd38be4bce0958fcfce8080d1580c4e3c2a15b
Amends 95b7fe49900904d19fca21876c84f97c2a6ae03d
Amends f7e1123620b623be0c321b54eaba7a1d618a7ce1

Task-number: QTBUG-122899
Change-Id: Ieec919901c3b44df80bc196536f68632a9761d92
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 797ce76ee946245898f9d11fa7e3ffb889e117d7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 18:21:31 +00:00
Edward Welbourne
e5c551a5cf QtXml: be systematic about feature dom
All the actual code of the module was subject to #ifndef QT_NO_DOM,
aside from the *_p.h that were only included subject to such #if-ery,
so there's nothing left of the module if the feature is ever disabled,
but be consistent with the module defining a feature that allows that.
Convert #ifndef QT_NO_DOM to #if QT_CONFIG(dom) (and move to outside
the namespace, where nothing was inside without the define), require
feature dom in the *_p.h and test, change CMake config to skip the
test when the feature is disabled (and add a missing SPDX comment),
condition including sources on the feature.

Pick-to: 6.7 6.5
Task-number: QTBUG-122619
Change-Id: Ie2167b6c56d96c7804785e225f3fe02dbc78984c
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit a4c85a5cf19d8919797aba41077bfa8796427f54)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 18:21:29 +00:00
Ivan Solovev
790a52b7e0 Register Qt::TimerId with the meta-object system
By using Q_ENUM_NS macro.

Amends 4bc0834bc182335984431c6a1525782efc34368c.

Found in 6.8 API review.

Task-number: QTBUG-128144
Change-Id: Icb3b4e76e0c36066d480b1f756c5a9c8aa5cb43f
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 6e2705bbc891d5ddd4924815a641830d2a0ccf4b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 17:57:27 +00:00
Julian Greilich
b2706531e9 Android: Exclude the QtWindow itself from Accessibilty
Since the QtWindow and its QtEditText are focusable only to hand
over events to other components, the QtWindow itself should not be
focusable by TalkBack, since this leads to an unnecessary nameless A11y-Element
in the A11y tree.

Task-number: QTBUG-126672
Change-Id: I532b9d3e252fbe01da7c953446242b045c57eebe
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
(cherry picked from commit 46cb9027f1ed6c61faec5364b5537ae7ab9e57c1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 17:24:19 +00:00
Ivan Solovev
571a4a3efb QDirListing: unexport the class
This is a non-polymorphic class, so we should export only individual
out-of-line methods.
Same for the nested DirEntry class.

Amends c39a0d1e8956e042139ce3065681e4c5d07412f3.

Found in 6.8 API review.

Change-Id: Ifde785d9ece1641351501159963d8cc065d8e140
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 7394f7151404e0649eb59d8fa84eb7061635ee70)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 17:24:15 +00:00
Marc Mutz
6dfb013b62 DRY QT_FOR_EACH_STATIC_CORE_TEMPLATE()
Use the same technique used elsewhere in qmetatype.h to deal with
missing features: define a new macro to either contain the types
controlled by the feature or be empty, and then call that macro from
the larger-scale one.

DRYs the list of types to not repeat QByteArrayList and QStringList.

Amends cdbc76360ae4c12b25923a7cb392355a6485fc70.

Change-Id: I767452aa33c1a2404315a0c3cd02f7102b9d6653
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit fbc80ee163f16baafcc236b533ea7ccc3376fa2f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 17:24:14 +00:00
David Faure
a9e464119a QTableView: implement moving rows by drag-n-drop
This is only available when calling setDragDropOverwriteMode(false)
so this makes no difference in most applications (see implementation
of QAbstractItemView::position).

QTableWidget::dropEvent() was assuming we were dropping onto items
without checking that this was the case, this is fixed here,
and QTableView::dropEvent() is added to handle moving rows,
with very similar code to QListView::dropEvent().

Task-number: QTBUG-13873
Task-number: QTBUG-101475
Change-Id: I96e75da2c0abf6f568edba461735905dee5cb84f
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 8e63cf282cb248ddd7fbc908766091659b3a0b22)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 04:16:55 +00:00
Ahmad Samir
679ae93507 QDirListing: fix typo in header guard
Was missing an `R`.

Change-Id: Iefdb373c152c31baf3e6769a5e2814c0d9800e60
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 61a3ca6f635c86b91fe3a2ac481e7de138447523)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 04:16:53 +00:00
Marc Mutz
514e244913 qFuzzy(Compare|IsNull)(): mark as noexcept
These all cannot fail, so can and should be noexcept. Most were
already.

Found in API-review.

[ChangeLog][QtCore/QtGui] All qFuzzyCompare() and qFuzzyIsNull()
overloads are now noexcept.

Change-Id: I67a2981ea4af9be0370becf84103822fd766ab5e
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 6a3a28236c6a0c34d37a614ca4e68ccd136d90e2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 04:16:52 +00:00
Tor Arne Vestbø
b86a0cb720 xcb: Sync XCB connection after reparenting window
This is important for the reparenting to take effect even if there
are no other state changes to the window, such as changing its
geometry.

Pick-to: 6.7 6.5 6.2 5.15
Change-Id: I9b39b56d163faf7a9b472cefbb19efdb944cb304
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit 92619ce2ec8381aa01647337665e626b84063f59)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 04:16:51 +00:00
David Faure
d5109e4a88 Implement QTableModel::moveRows
Implemented the virtual method moveRows to allow row movement.
Used it for the case of sorted insertion.

Heavily based on QListModel::moveRows and its unittest.

[ChangeLog][QtWidgets][QTableWidget] Implemented moveRows in model.
When sorting is enabled, setItem() now moves the row to its
sorted position, emitting rowsMoved rather than layoutChanged.

Task-number: QTBUG-69807
Change-Id: I62a150cca4e5b7d982f2359a6d8c248494528cac
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit f951c11586081efea108ea5b6a7028c672e12c2a)
2024-08-29 04:16:49 +00:00
Christian Ehrlicher
517d11d0c5 SQL/PostgreSQL: use PostgreSQL_ROOT in documentation
Instead specifying CMAKE_INCLUDE_PATH/CMAKE_LIBRARY_PATH use
PostgreSQL_ROOT which is suits much better for the usecase.

Change-Id: Iac239d88d4c9c11d5482acacb2bbb1bb034c4365
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
(cherry picked from commit a664a6e225abdd4a62aac57df10e3507fcd2b561)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 04:16:48 +00:00
Alexey Edelev
8e0d08d0c6 Add the missing dependency between _copy_fw_sync_headers and _sync_headers
The dependency is specified for the Ninja generator, but is missing for
others, which leads to the invalid order when building with Unix Makefiles
generator for MacOS platform.

Amends 103eca1070a75bfa97d0b72b94e0c759ef0bcd1c

Pick-to: 6.7 6.5
Fixes: QTBUG-127987
Change-Id: I78927ee3fa7b0926f03b0e5eab67983c4d0d3e67
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 2d87bb7d2eb9827899546cca3e59e8174ce04b8c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 04:16:46 +00:00
Christian Ehrlicher
60590c1a2b SQL/Oracle: use Oracle_ROOT in documentation
Instead specifying Oracle_INCLUDE_DIR/ORACLE_LIBRARY use Oracle_ROOT
which is suits much better for the usecase.

Change-Id: I8a0858b3ae491212a79ad982eb8e067e6f1b750f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
(cherry picked from commit 5e478ebbcc42471b4c70c10bb513e7343c05933e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 04:16:42 +00:00
Marc Mutz
99f8efd0ef QStringTokenizer: clean up Q_STRINGTOKENIZER_USE_SENTINEL
The macro was unconditionally defined since
44a74127954dce2416842a6644cbdff4c513b6fb and, despite being named like
a public Qt macro, never documented, so just remove it.

Also means we can remove the ODR protection from end() and cend() now.

[ChangeLog][Potentially Source-Incompatible Changes] The undocumented
Q_STRINGTOKENIZER_USE_SENTINEL macro was removed. It was
unconditionally defined since Qt 6.0.

Change-Id: I8ba2aeddea79ad89cef8912e9cf34098f2793f1b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 799e16149ce9d34419da9ea35f790412202ce7a8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 04:16:40 +00:00
Marc Mutz
f85f5b35bb qhashfunctions.h: unindent <concepts> include
Qt will at some point require C++20 and then the indented include will
have to be un-indented, anyway, so might was well do it now to have
less work later.

Also sort the <concepts> header in with the other C++ headers.

Amends 52abff8cc1741412c3fa2c9f6d5185cf48f9ef13.

Found in API-review.

Change-Id: Ic092d3c0d47e9ecab0492d533b6a10c2a8227e88
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 3ac48281d9971998882612a43cbcf923104ee592)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 04:16:37 +00:00
Jøger Hansegård
2f7d52a9ba Update tika-mimetypes.xml from upstream
This patch updates the tika-mimetypes.xml MIME types definition file to
version 5ea8bbf1644a593ed22ee5c7608ba33aff949d5d, which is currently the
latest on main.

The reason for the change is to include audio/aac as an alias for the
deprecated audio/x-aac MIME type, which is useful in QtMultimedia to
determine the file extension for AAC media files.

In addition, the update adds the application/x-java-keystore MIME type,
similar to the one in the old freedesktop.org.xml MIME type definition.

[ChangeLog][Third-Party Code] Updated TIKA MIME types definition file to
add the audio/aac and application/x-java-keystore MIME types.

Pick-to: 6.7 6.5
Change-Id: I14fa331c5c57e4fae8f8b31880dc66d6ca559f62
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 5774aa2560b65a67e72f98cf2f776325b6760950)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 04:16:36 +00:00
Marc Mutz
abcee9eb99 QStringTokenizer: update docs for a world in which C++17 is required
Remove mentions of pre-C++17 behavior.

Don't recommend against qTokenize() any longer (it's shorter than
"QStringTokenizer") and mention it in the QStringTokenizer class
documentation, too.

Pick-to: 6.7 6.5 6.2
Change-Id: I8cf3310fc9de80db0a89aecfdf695a49d390da47
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit c1fc85df109a4dff57d7615a353bfcc7e172b0c9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 04:16:34 +00:00
Christian Ehrlicher
20429da06a SQL/MySQL: use MySQL_ROOT in documentation
Instead specifying CMAKE_INCLUDE_PATH/CMAKE_LIBRARY_PATH use
MySQL_ROOT which is suits much better for the usecase.

Change-Id: Ieb75f80a6eb3a3e7913a7c04ca6511a014fa7e4e
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 0c0b5cbb0d0b43f6be4e54caea89d5764511e94f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 04:16:32 +00:00
Marc Mutz
5a9e93630e QXmlStream: actually make the (in)equality operators noexcept
Do not use the getters, as they are not noexcept. While they could
probably be made noexcept, we're too close to release to make a hasty
change there. Directly access the data members instead.

Found in API-review.

Amends cd5dd8b95bbda1e9531af52c251ea926f125c8ea.

Change-Id: Ic3a6b0f933956d57d2c3b4ebdd5ad40ec4736fb0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 23784ec9d6eca9b138cd2528389e8150ebc66667)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-28 23:03:33 +00:00
Marc Mutz
1f129d1589 QXmlString: add a few missing operations
... namely isNull() and op==/!=().

These will be needed for porting comparesEqual() from public getters
to direct data member access, in order to make them earn their
noexcept tagging.

Change-Id: Id8677d39dc581d03adfd3d0d420907ff60c0423a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit e0ae91bd5880d1f8ab36d42cff428bb8246f73c2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-28 23:03:27 +00:00
Marc Mutz
92597843d6 Make from_msecs a QTimer class-static again
It will need to be called from removed_api.cpp once we widen
QTimer::singleShot() from ms to ns.

Don't use the QAbstractEventDispatcher::Duration typedef in qtimer.h
to avoid including the resp. header. Keep the typedef as the return
value on the definition of from_msecs(), though, as a static assertion
that they're identical.

Task-number: QTBUG-128426
Change-Id: Ib59895f4441e92813fe39778bb3836b039fdfbf0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 65a249715941bf6b6ecc980d3f865f367f66522d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-28 23:03:22 +00:00
Marc Mutz
79dec148a9 QXmlString: add noexcept to size() and operator QStringView()
size() is obviously noexcept. QStringView ctors have an implied
precondition that the (ptr, n) range passed represent a valid
range. Since this is a member function QXmlString, we can assume that
the class variants hold and m_string itself represents valid (or null)
data, so this operation is also noexcept.

As a drive-by, remove pointless inline keywords.

Change-Id: Ia7637e77005062b6515ceac4b62efaf14a2eb486
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 792bea9be3760f58de4d1c30fbecab0071fe311e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-28 23:03:20 +00:00
Marc Mutz
ee6b101adf QTimer: port defaultTypeFor() helper from ms to ns resolution
This doesn't change a thing for QTimer, but is a building block for
making its singleShot() have nanosecond resolution, and allows
QChronoTimer to reuse the function.

Task-number: QTBUG-128426
Change-Id: I3d7e79972f236ca63b216a1a5a871edf5025e1b8
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 25b8d3743455bd2a4a327e1068fc83acb2f1c481)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-28 23:03:16 +00:00
Marc Mutz
3b7f21996e QXmlString: fix ADL swap
The classical Q_DECLARE_SHARED assumes it's placed right next to the
class in the same namespace as its argument type. If that is not the
case, then the free swap() function might not be found using ADL,
since it was defined in  an outer namespace. Since 6.8, we have
NS-aware Q_DECLARE_SHARED versions, so use that.

Change-Id: I2969c641b501b07b4ebb9fce46d2544bf788fc9b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 877fe0e7b3aada3f99bbf0415cba9daf97b067db)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-28 23:03:13 +00:00
Marc Mutz
5d23f03860 Fix position of qtimer.h in removed_api.cpp
The include for INLINE_SINCE(6, 8) QTimer API was in the 6.7
block. Move it to the 6.8 block.

Amends a4a679ee796a476048ddee3f88025035cca3631a.

Change-Id: I503428bcb73138af5eaed8f1d1523a448e1bf67c
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 0dd5b2de4c59e2f0175aba3cf720a47998108330)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-28 17:40:06 +00:00
Marc Mutz
52f471e23e QNetworkRequest: document the new saturation behavior of transferTimeout()
Change-Id: I1b8b57c76f41e36ad14fff9c52f0c346f83426ed
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 4403b6561b91c7435186116265b6e59e81c7ce03)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-28 17:40:06 +00:00
Marc Mutz
b2df824e02 QLocale: mark c_locale Q_CONSTINIT and c_private() noexcept
Add Q_CONSTINIT to the c_locale variable to statically assert that
it cannot fail (no runtime initialization = no failure). The
QLocalePrivate ctor is already constexpr, so Q_CONSTINIT works out
of the box here.

Because c_locale construction is now known not to fail, c_private()
cannot fail, either, and can and should be noexcept.

Change-Id: Ibe94cb4bcd990fbd0b440dd98509eb39447a94b7
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit c745b59e36b421039e71779fd9e5db8c619163f2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-28 17:40:06 +00:00
Mårten Nordheim
1714af1721 QNetworkRequest::transferTimeout: saturate int return value
So the value is at least sufficiently large even if int could not
fully represent it.

From the API review.

[ChangeLog][QtNetwork][QNetworkRequest] The transferTimeout() function
now returns INT_MIN or INT_MAX when transferTimeoutAsDuration().count()
cannot be represented in an int.

Change-Id: Ic37ad5bc19ea7da4041c989acd3b989923d48cef
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 7fb3a18282281023bd8e47e9dae79dbab3660848)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-28 17:40:06 +00:00
Tinja Paavoseppä
951864d72a QtActivityBase: Don't finish after library loading fails
Since we show an alert dialog for the user to let them know the loading
failed, and accepting the dialog will finish the Activity, there is no
need to call finish() right after showing the dialog.

Change-Id: I954ba1d0b77591665baf2f1e0eb94567768902db
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 55fe33f794c1961f2c691b91fe58525dd1a203e0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-28 17:40:05 +00:00
Ahmad Samir
e1f4f2ef47 String Views: add slice() methods
Methods with preconditions can't be noexcept (from Marc in code
review).

[ChangeLog][QtCore][String Views] Added slice() methods to
Q{String,ByteArray,Latin1String,Utf8String,AnyString}View which work
like sliced() but modify the view they are called on.

Found in API review.

Task-number: QTBUG-99218
Change-Id: Ic8ef3085f7cfac86b8404fb28d491ca38ad121eb
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 8f68bd9e6353a42d3b71d893b27fec6bedced501)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-28 17:40:05 +00:00
Tor Arne Vestbø
c97e58bb61 Reset QWindow positionPolicy on destroy
If a window is positioned with setFramePosition, we reflect that to
the platform window via QPlatformWindow::setGeometry(), but with the
QWindowPrivate::positionPolicy set to WindowFrameInclusive. On the
platform side the position policy is read from QWindowPrivate to
determine how to interpret the incoming geometry.

When the resulting geometry is applied to the native window,
it's reflected through QPlatformWindow::geometry() and reported
back via QWSI::handleGeometryChange() as client geometry, ie.
without the frame margins.

If the platform layer later interprets this geometry in
combination with the window's positionPolicy, it will incorrectly
position the frame top left at the point of the client geometry's
top left.

It would make sense to reset the window's positionPolicy at
the point of QGuiApplicationPrivate::processGeometryChangeEvent,
but doing so might break situations where there's another in
flight geometry request.

What we can do as a first step is reset the positionPolicy when
the platform window is destroyed. This ensures that the next
time the platform window is created it will be placed at the
same position, even if the initial position was requested via
the setFramePosition() API.

Change-Id: Ic555f19884ccd68c46421d0fe666717170ba7638
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 11a09a9bd0a7e899a918b078a94c6c3b82240dee)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-28 17:40:05 +00:00
Ivan Solovev
fe88ab0f5d QtJniTypes::JObject: fix comparison operators
The comparesEqual() helper method cannot be noexcept, because the
comparison operators of the underlying QJniObject are not, and
cannot readily be made noexcept, because they end up calling JNI
stuff like jniEnv()->IsSameObject().

Also, the *_LITERAL_TYPE helper macro should be used only if the
operators are constexpr, which is also not correct in this case.

Remove the noexcept specifier from the helper method and use the
*_NON_NOEXCEPT version of the comparison helper macro.

This change is picked to 6.8 and 6.7, because the API is marked as
tech preview.
The 6.7 cherry-pick would require a manual fix, because the
*_NON_NOEXCEPT version of the macro didn't exist back then.

Amends a5d14a9f5cfe41784960fe825609d91b9a18c17e.

Pick-to: 6.7
Change-Id: Ic01c0b09f94b94677a9771d1763518697aafc3ef
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 405cee34297f3cf2a822658ba14922dfaaa8429d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-28 17:40:05 +00:00
Ivan Solovev
d6e8fa64e8 QStorageInfo: actually make the (in)equality operators noexcept
Do not use the getters, as they are not noexcept. Directly access
the members of the d_ptr instead.

Amends d292648d0bbac50388dae035dc34782accb3807f.

Found in 6.8 API review.

Change-Id: I69eee9db2274d1e99a4f56e841cfaea223341ced
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 495a06a22aef2aa62dd993217e4f4ec099ad4e94)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-28 17:40:05 +00:00
Ivan Solovev
9f06e0b1f8 QEasingCurve: remove incorrect noexcept
The comparison operators cannot really be noexcept, because they
call other non-noexcept getters, like QEasingCurve::amplitude(),
QEasingCurve::period(), and QEasingCurve::overshoot().

Amends a4341827ac17c14541ea69c67c76aaae5a09ddcc.

Found in 6.8 API reivew.

Change-Id: I77c01792adbf7d9a7e36d7efec6defbea866b7d2
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 3cf7eff6265b4321e216f830b2ecf1ee4118fad4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-28 17:40:05 +00:00
Ivan Solovev
f2bcf582dd serialization: remove incorrect noexcept on comparison operators [1/2]
QJsonValue comparison cannot be noexcept, because it might allocate,
for example when calling QCborValue::toString(). As a result, all
the QJsonValue(Const)Ref comparison operators also cannot be
noexcept, because they convert to QJsonValue to do the comparison.

QJsonObject comparison cannot be noexcept, because it might call
QCborValue::makeValue(), which might allocate.

QJsonArray comparison cannot be noexcept, because it might also
call QCborValue::makeValue(), which might allocate.
  
Found in 6.8 API review.

Change-Id: I775746b2a76765bca26b87d5af396a8dfdfca7f9
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 7f01b62969d1734832ead0547904902ae0f1b5dd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-28 13:07:38 +00:00
Ivan Solovev
67ce24cf30 QtPrivate::ResultIteratorBase: remove incorrect noexcept
The (in)equality operators cannot be noexcept, because the
QMap::const_iterator comparison is not noexcept.
QMap::const_iterator basically uses std::map::const_iterator comparison
operators, and I could not find any proof that it is noexcept.

Amends ed71387d1cc06afff42ac844a3887778685ce793.

Found in 6.8 API review.

Change-Id: I9014052588a7864b729a7b8ac703f5145675f860
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit a942a373051ddab40742f213e36fa5851c97b384)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-28 13:07:36 +00:00
Paul Wicking
4cef74fe76 Doc: Remove usage of defunct QDoc command
The QDoc command `\tableofcontents` was rendered useless by a change
more than a decade ago. Remove the use of `\tableofcontents` as it
serves no purpose, and ensure that the surrounding context still makes
sense for the reader, by removing preceding text that refers to a
non-existing table of contents, such as `Contents:`.

Task-number: QTBUG-128173
Change-Id: Ibb5a6af0e80f70fa487cdf6a7e38009a9ef60cbf
Reviewed-by: Safiyyah Moosa <safiyyah.moosa@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
(cherry picked from commit cd8244131e2d6fe2c2453ae40213e7f12bff893d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-28 11:39:51 +00:00
Ivan Solovev
567dc5c84e QMetaType: remove the incorrect noexcept from comparison operators
The implementation calls QMetaType::id(), which may call
registerHelper() to register a custom type, and that surely allocates.

Amends 5a0faa9198c6ae6e21a550159c4284d1a9c5792e.

Found in 6.8 API Review.

Change-Id: I26979379b8fd12c3d52f6489fb25145ac2fa95ed
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 31d3e57342161a9a8edaebacb968950e6a16d67e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-28 01:13:30 +00:00
Christian Ehrlicher
e86c5bf71c QFileDialog: return correct name filter with HideNameFilterDetails set
When QFileDialog::HideNameFilterDetails is set, the combobox does not
show the complete filter but only the filter name. Therefore we can't
use the value from QComboBox::currentText() when returning the current
selectedNameFilter()

Fixes: QTBUG-127924
Change-Id: I8feb894e5336f2899b42d798558a3c9380669938
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 92e650832d425944037ad6ad3c1d46667f62f454)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-28 01:13:29 +00:00
Tian Shilin
5ca2e0e48e fix: Redundant condition in abstractitemcontainer
The check to see if m_itemView is empty is already
included in the first condition, and the re-check in
the second condition is unnecessary.
eg: A | | (!A && B) is equivalent to A | | B.

Change-Id: I1a9f003bacea076fc1e72765c196a327a21c33b2
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 063dad967fbea9649683aa02f457c839e1ab56cb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-28 01:13:29 +00:00
Tian Shilin
9de69c4a99 fix: Redundant condition in isValidBasicType
When isValid is true, it must be true; when isValidis false,
whether the conditional judgment is true ornot only depends
on whether !result is true(eg: A | | (!A && B) is equivalent to A | | B.),
so you can optimize the judgment condition to improve thereadability
of the code.

Change-Id: I0231b83e0b50586dff2820b8d0dfc35edec36f70
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 03c547f1010868a0ef2f236c6980094efab7e12f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-28 01:13:29 +00:00
Christian Ehrlicher
225e235cf9 XML/QDom: speedup encodeText()
The code copied the whole string, then replaced parts inline, at
the cost of relocating everything beyond, at each replacement.
Instead, copy character by character (in chunks where possible)
and append replacements as we skip what they replace.

Task-number: QTBUG-127549
Change-Id: I368482859ed0c4127f1eec2919183711b5488ada
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 2ce08e3671b8d18b0284447e5908ce15e6e8f80f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-28 01:13:29 +00:00
Tian Shilin
e0b2258b03 fix: Redundant condition in tst_qdbustype
When isValid is true, it must be true; when isValid
is false, whether the conditional judgment is true or
not only depends on whether !result is true
(eg: A | | (!A && B) is equivalent to A | | B.),
so you can optimize the judgment condition to improve the
readability of the code.

Change-Id: Iab621d3d2948d249f6d8a2425bca3f5404c2e1a1
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 3819ad4ea42b707e7b786b3a8b942d1214533ba6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-28 01:13:29 +00:00
Wladimir Leuschner
b3a25e845a QWindows11Style: Increase QSpinBox width for layouted QSpinboxes
QSpinboxes used the sizeFromContents from QWindowsVistaStyle, which
produced a too small contentRect for the newly horizontal layouted
buttons on QSpinBox. This patch sets a minimum width for the content
rect, when QWindows11Style is used.

Fixes: QTBUG-124118
Pick-to: 6.7
Change-Id: Ibf58c8da360242587e55f8096fa3157459041ba6
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit bfe8ac4ebff7a1e8114068f2f46e73c588735690)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-28 01:13:28 +00:00
Mårten Nordheim
d2e9a03ee3 Http2: flip some checks for PUSH_PROMISE around
It was correctly following the RFC, but we overlooked that the
RFC is talking about restrictions on _sending_, while we are
verifying on the _receiving_ end. So, some things has to be flipped.

And the dataSize offset was incorrect and could read out-of-bounds.

Amends d17d260948e16549d82f1fdd4dec98d246b0622e

Pick-to: 6.7
Change-Id: Idb7e00637398dff190fc4e5b9776a8649a04f391
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 02d1d638545fd8600fac9707a8f9af03f99197ec)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-28 01:13:28 +00:00
Tor Arne Vestbø
cf0b87c7c2 wasm: Ifdef out unused function systemHasStderr
Change-Id: Ifae799d62668382c93ef85826b397f4a9d3e4199
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 09681d46f4cd17b2e78c93ff7da9e030f0ce6e0e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-28 01:13:28 +00:00
Mårten Nordheim
28abd01732 Speed up setup for QSet unite benchmark
Pick-to: 6.7 6.5
Change-Id: I38a56ae2c9f3dcbcb851cf63ae692cd7f9497989
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit ccbf2cd43c1748259410cddbf4f359b6b88df987)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-28 01:13:28 +00:00
Edward Welbourne
690cc978ea Rename new QTZ::aliasMatches to hasAlternativeName
Raised in 6.8 API change review. The use of "matches" in a name suggests
pattern-matching, which isn't what happens here.

Task-number: QTBUG-125859
Change-Id: I8aa05b117807b9d1b9b737cd63d44fb4a30f6fa5
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 6b36e5de7656e1d9e23364c596cc82f8068d4452)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-27 16:38:19 +00:00
Wladimir Leuschner
ac74885507 QWindows11Style: Use float coordinates for ticks in QSlider
Fixes: QTBUG-127788
Pick-to: 6.7
Change-Id: If7620aade30c45c409cb442a7ed6e4a8aea7551e
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 47ba48e0245e6f57ae0c76db626eb63ce6924cfd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-27 16:01:20 +00:00
Assam Boudjelthia
9c06169a08 Android: move AppStateDetailsListener from QtActivityBase to Delegate
Implementing QtNative.AppStateDetailsListener under QtActivityBase
exposes the methods as public API to users, where the class
AppStateDetailsListener itself is not public API, so move the
impelementation to the QtActivityDelegate.

Task-number: QTBUG-125859
Change-Id: I9b358a5e9cd9970a2ead11df77b3761a8e7e6c07
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
(cherry picked from commit 6e2b92c1b1d229aae56fff9ae4487ce41ca50680)
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
2024-08-27 16:01:16 +00:00
Alexey Edelev
8f09ff24c2 Filter the Android SDK build tools directories
Avoid using non-version like directories from the android build-tools
directory.

Fixes: QTBUG-94956
Pick-to: 6.7 6.5 6.2
Change-Id: Ib201c43db2c5ee4a67bea90027ae5363a8d06709
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 58542f9c367efe5198172dfc7aaabf1e8c2c90bc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-27 16:01:11 +00:00
Michał Łoś
456037a4d3 Enable keyboard handling on VxWorks
Provide VxWorks-specific code to handle keyboard. Note that there is no
support for changing keyboard leds on VxWorks.

This is preparatory change as there is no Qt evdev support for VxWorks.

Task-number: QTBUG-115777
Change-Id: I314f8f1b42501b601d39e65080f2bea4002cc693
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2024-08-27 18:01:04 +02:00
Michał Łoś
af2cf8a67b Enable compilation of evdev touch handlers on VxWorks
In order to provide support for device detection using evdev on VxWorks,
we need to exclude not compiling parts of code for touch handling for
this platform. For now, provide necessary headers and defines, remove
incompatible code for evdev tablet and touch handlers.

Note that this is a preparatory change, as no touch device is being
detected for VxWorks yet, nor evdev is enabled for this OS.

Task-number: QTBUG-115777
Change-Id: I042d2fd464bbe23516646c02ae10354aefe82403
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2024-08-27 18:01:00 +02:00
Michał Łoś
c4dfb8030c Enable device discovery using evdev on VxWorks
Provide VxWorks-specific implementation of keyboard and mouse device
discovery, and enable usage of evdev on this platform.

Task-number: QTBUG-115777
Change-Id: I9370ac085aa58c72e2d39731b78ebd854f5aad9a
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2024-08-27 18:00:49 +02:00
Christian Ehrlicher
61b9195fc2 QIcon::pixmap() add a note about the changed behavior
With Qt6.8 QIcon::pixmap() no longer scales the size by the devicePixelRatio passed to QIconEngine::scaledPixmap(). This means that external icon engines now must be adjusted to honor this change.

[ChangeLog][Important Behavior Change] QIcon::pixmap() is fixed to no longer scale the size, passed to QIconEngine::scaledPixmap(), by the devicePixelRatio.

Change-Id: Ic93e10a81cd58fba4580c3f1522cc27e2b05cea5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit ecc13e3d41af89bd195e6f173b2c96d2295f407e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-27 16:00:42 +00:00
Christian Ehrlicher
108162274b SQL/plugins: Fix configure options '-sql-<foo>'
The configure options '-sql-<foo>' and '-no-sql-<foo>' did not work as
expected because they were overridden by some ancient
'plugin-sql-<foo>' option. It looks like an ancient relict from Qt4
times where you could specify if a sql driver could be built as plugin
or as built-in module which is not supported anymore since Qt5.8.

Pick-to: 6.7 6.5
Fixes: QTBUG-128337
Change-Id: I7f0a0cf4b1dd11af32c48b50ceacf0f26eafffcf
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 8a0c86651f1e5091c4fb5ef8cbbcef53a9e336eb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-27 16:00:30 +00:00
Edward Welbourne
16abff0f85 Cache UTC versions of QDTP::getM(in,ax)imum()
The static min and max moments of QDateTimeParser are local times.
Now that baseDate() needs to check whether the start of the two-year
century falls between these, and parsing of simply a date or simply a
time (not a date-time) uses UTC, to comparisons involve mapping the
local time to UTC, with the usual associated expense. Do that
expensive operation once on creation of the min and max local times,
so that it'll be cached for use by the comparisons.

This shall also help with other comparisons to max and min, so is of
use even before the introduction of baseDate(), for all that that
change brought the issue to light.

Thanks to Jøger Hansegård for analysis of the profiler data that
revealed the root cause of a significant slow-down.

Pick-to: 6.7 6.5
Fixes: QTBUG-124465
Change-Id: I539c8ae782717635fb722c4573d85bc63073958a
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit b6a11a4ee5319366f14c11c7cf3a4f1dbf33cfd5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-27 15:58:15 +00:00
Edward Welbourne
29934f62ef QDateTimeParser: Move magic section indices out of section type enum
They never belonged there and their presence implied cases for them in
switches on type that make no sense. Presumably it was just a handy
enum in which to declare some constants, but we can do that with
constexpr class members these days, without compilers grumbling about
unchecked members of an enum in a switch. One of them wasn't even
referenced anywhere, so dropped it entirely.

Pick-to: 6.7 6.5
Change-Id: I304cdb07cd86e8d7e926c316729d68fc7770afc5
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit c7e75b2b8da79d736e9d01d81959fec66c4c90e9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-27 15:57:57 +00:00
Marc Mutz
b819709c3a QHash: re-SCARY-fy value() and key() methods
This reverts commit ba24125cbfdbe78b48e8000ee6030f0d81a86491.

The funImpl() functions were specifically designed to be sharable
between the fun(key) and fun(key, def) overloads. Making the return
statement a template argument turns one function into two, duplicating
the executable code. It doesn't even improve readability much, so
revert to returning pointers as a poor-man's optional<>.

This re-SCARY-fies the functions, also adapting the code of the
heterogeneous lookup additions that were introduced later.

An alternative would have been to use qxp::function_ref, but that
produces a lot of code itself, as the recent removal of it from QtTest
has shown, and it's not required, either. KISS applies: the old
return-by-pointer was the most simple implementation possible. There
is no need for a type-erasing function wrapper here.

Change-Id: I8570ce5acd6d6e98321e4003919651cd97cad83e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit cdc04b96dd8a69d0310e1474008b48128d050450)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-27 06:01:30 +00:00
Marc Mutz
9ebc45c754 Give some TLC to FunctorCallBase::call_internal()
The function takes `fn` by universal reference, so it should be
`std::forward`ing `fn` before calling it. This includes the
unevaluated contexts, so use `std::is_nothrow_invocable_v` and
`std::invoke_result_t` instead of `noexcept(fn())` and
`decltype(fn())`. The std traits take the value category into account
automatically. Linters like to warn about universal/forwarding
references without std::forward(), so this should be fixed even without
and actual overloaded op() &/op() && present.

The function passed as `fn` may also be marked as `[[nodiscard]]`, so
make sure that we never ignore the return value (unless it's void) to
avoid throwing warnings.

As a drive-by, replace Q_UNUSED with [[maybe_unused]] and inline the
SlotRet type alias into its only user.

Amends f894f04c9d03878116de61c11d4591da67c10378.

Change-Id: I5e045fc735f461a82244d7e80f81c2a9b1e69046
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 832e47ca44d3af1b7a3f722bad2a1d0c6fd56b5f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-27 06:01:25 +00:00
Marc Mutz
ac05ee3746 QAbstractEventDispatcherV2: clean up override keywords
Virtual functions should have exactly one of 'virtual', 'override' or
'final', because 'final' implies 'override' and 'override' implies
'virtual' (CppCoreGuidelines C.128;
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rh-override).

So add 'override' to the dtor and remove 'virtual override' from the
final functions.

Amends af6afad3b390c0ed7de6d3c4314cc394d8f8e2c2.

Change-Id: I65711c4ca87d522fc0d3afc994f8812914eab7d3
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit e6dab10c32b2d57e8f47e5c16827a3c1560f2e27)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-27 06:01:19 +00:00
Thiago Macieira
fbfec48c42 tst_QByteArrayView: remove use of std::char_traits
Complements ab05e05f60253b9be615c09aa340ee75f2e5bcaf:
    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 dc2ae08e02730ab795445bc047221aa56914f723.

which is:

    QStringView: stop instantiating std::char_traits<QChar> and <uchar>

    It's deprecated and will be removed with LLVM 19.

    Amends b1ee49b46533d39f7fabda68d0bd08a1ab130a27.

Fixes: QTBUG-128325
Task-number: QTBUG-126214
Task-number: QTBUG-122753
Pick-to: 6.7
Change-Id: I2c7fbe3c0f557e98e7edfffdb00b4cc71a6612ca
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
(cherry picked from commit b387537d3e9c35d9f112d4aa32ad71df5e5e9028)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-27 05:22:58 +00:00
Christian Ehrlicher
0b328b6b00 SQL/OCI: misc cleanup
Do some cleanup:
 - use qsizetype instead int
 - use default member init instead in ctor
 - remove unneeded functions
 - make a getter const

This is a follow-up of 7005630a9b735f2e59e3345fee0305e0277c0208-

Change-Id: Ibb02bd93a130c5d60bf431608666a5ad1fe71ead
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 4bf7cc2440bb09578d95e8eea51ebfbddd2897e4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-26 04:19:38 +00:00
Dongmei Wang
65b6de2a20 xcb: handle XI2 input button and motion events from slave devices
On Ubuntu 24.04, when the SuperKey is pressed, Qt only receives XI2
input events sent from the slave pointer devices on a mouse click or
a mouse move, but does not handle those XI2 input events.

Fixing this by allowing Qt to handle such an XI2 event and generate
a QMouseEvent for it if it is not handled previously.

Upon receipt of an aforementioned event, check if the event
is a duplicate XI2 event. A duplicate XI2 event means that
the XI2 event was sent from another device previously.

- If it is not a duplicate event, the XI2 event is passed to
  QXcbWindow to be handled. Eventually, a QMouseEvent is
  generated and sent from the GUI for the XI2 event.
- If it is a duplicate event, ignore it.

Note, part of commit:3bc0f1724ae49c2fd7e6d7bcb650350d20d12246
is re-done with the fix.

Fixes: QTBUG-110841
Pick-to: 6.7 6.5 6.2 5.15
Change-Id: I93beddef7261c37ddbe8bfdb6ae08c95f8f155c5
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit b71be292780b858f2c55ce92601452e2ea946de2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-26 04:18:39 +00:00
Christian Ehrlicher
432b7187e1 Widgets/doc remove all \since 4.x comments in widgets/dialogs
Remove all \since 4.x comments in widgets/dialogs - this is no longer
of interest.

Change-Id: I4835be8c16363b13615ffc921454e2b5ade295eb
Reviewed-by: Safiyyah Moosa <safiyyah.moosa@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit b5bb8897d0809bae4e414c74420440255fc5b08d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-26 04:18:34 +00:00
Christian Ehrlicher
c211b1dbbe SQL/Doc: remove paragraph about CMAKE_INCLUDE/LIBRARY_PATH
Using CMAKE_INCLUDE_PATH/CMAKE_LIBRARY_PATH to find the correct database
includes and libraries does work but is nothing which should be
documented here - it's a common way to specify common paths for cmake.
Documenting this here just confuses the user (which already has hard
times to compile the plugins by itself).

Change-Id: I0cb051f06f3c71f005290700e3b6c32da9a0b2b5
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit e279dd8c20794810292047c8c84f309e8aed004b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-26 04:18:31 +00:00
Ahmad Samir
f1e15832dd String Views: optimize the QByteArray/QString constructors
By using {QString,QByteArray}::begin() instead of data() (for const
objectst); both begin() methods, respectively [1], return nullptr for a
const null {QString,QByteArray}. Whereas data() returns &_empty if
QT5_NULL_STRINGS is defined.

[1] QByteArray::begin() since a116b2ddfc9e91736b1ec4edda6500e9c8f5f301
QString::begin() since 287ace562ee5ddff22f7dbf4e49ae5f0520f2308

[ChangeLog][QtCore][QLatin1StringView] Creation of QLatin1StringView
from QByteArray or QByteArrayView now preserves the origin's isNull()
status. This matches the behavior of creating a QUtf8StringView from
those types.

Change-Id: Icbdfe282e315c08ca6a17201bcd32c1a3bba8bf5
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 221d8fdfb14c16472267320f859105f1a3834952)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-26 04:18:29 +00:00
Alexandru Croitor
e43f4a7142 CMake: Automatically detect single arch macOS cross-compilation
Implicitly detect macOS cross-compilation in case the value of
CMAKE_OSX_ARCHITECTURES is a single arch that is different from
the real host macOS architecture.

In that case, the build system will implicitly set both
-DCMAKE_SYSTEM_NAME=Darwin and -DCMAKE_CROSSCOMPILING=TRUE.
It will also set those variables in the qt generated toolchain file,
otherwise user projects might not be built with the correct
architecture depending on the arch of the host machine where the user
project is built.

For such a cross-compilation scenario, as usual, a host Qt needs to be
specified during configuration, for usage of its host tools. Which
means that if cross-compiling to x86_64 from arm64, we will not try
to build and use the x86_64 tools via Rosetta.

Fixes: QTBUG-121322
Change-Id: Ib484af445b3fc6eb676b0ee174ac81d63f2f450f
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit fc2fa92de02e8b57472058a8281c24775e97d9eb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-25 17:04:41 +00:00
Tatiana Borisova
eae3d0807a Convert a Qt ordering type to the weaker std ordering type
- Added missing conversion from Qt::strong_ordering to
std::weak_ordering, std::partial_ordering.
- Added missing conversion from Qt::weak_ordering to
std::partial_ordering.

Usage of Q_IMPLICIT specifier in new std::*_ordering conversion functions leads to following ambiguity errors on WIN + MSVC configuration:
C:/Users/qt/work/qt/qtbase/src/corelib/global/qcompare.h(334): error C2440:
'static_cast': cannot convert from 'Qt::weak_ordering' to 'Qt::partial_ordering'
qcompare.h(334): note: 'Qt::partial_ordering::partial_ordering': ambiguous call to overloaded function
qcompare.h(249): note: could be 'Qt::partial_ordering::partial_ordering(Qt::partial_ordering &&)'
qcompare.h(153): note: or 'Qt::partial_ordering::partial_ordering(std::partial_ordering) noexcept'
qcompare.h(334): note: while trying to match the argument list '(Qt::weak_ordering)'

For solving the problem we can exclude the conversion function from the argument list(make it explicit in case of MSVC).
Q_COMPARE_CAST_IMPLICIT is used for setting explicit or implicit specifier depending on the compiler type

[ChangeLog][QtCore][QtCompare] Added missing conversions
from Qt ordering types to std ordering types.

Fixes: QTBUG-127670
Pick-to: 6.7
Change-Id: I32a9a33fa8921c75b0e5a40bd413572f1bd6765a
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 521e091bca1764d53ac06bb60707475d1032f5d5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-25 17:04:38 +00:00
Alexandru Croitor
fdd8924dce CMake: Allow opting out of Qt6HostInfo package lookup in user projects
A developer can cross-compile Qt and force the build of the tools
for the target architecture. In this case, the resulting Qt libraries
and tools can theoretically be used as an SDK on the target platform
without having to rely on host tools or packages.

Examples of this scenario include Boot2Qt, cross-building a Qt SDK for
a raspberry pi on a more powerful machine, or cross-building an arm64
macOS SDK on an x86_64 machine.

To achieve that, the build system needs a way of disabling the
mandatory host path check and the lookup of the Qt6HostInfo package
that are added due to the nature of 'usual' cross-compilation cases.

This was partially addressed in
0f8017efb6d037c4f33f947eb3c56aeafa28313c by offering an opt out via
the QT_REQUIRE_HOST_PATH_CHECK and QT_NO_REQUIRE_HOST_PATH_CHECK
variables.

The change was incomplete though. While it was possible to disable
the _qt_internal_setup_qt_host_path call at user project time, it was
not possible to disable the lookup of the required Qt6HostInfo
package in _qt_internal_find_host_info_package.

Change the code to consider the value of QT_REQUIRE_HOST_PATH_CHECK
also when looking up the Qt6HostInfo package in Qt6Dependencies.cmake
in user projects.

When building additional Qt repos, as opposed to user projects,
where we call _qt_internal_find_host_info_package in
qt_internal_setup_find_host_info_package via the BuildInternals
package, users will still need to pass both QT_REQUIRE_HOST_PATH_CHECK
and QT_NO_REQUIRE_HOST_PATH_CHECK to disable the host path check.
This case is less likely to happen, so no adjustment is made to unify
that behavior.

Additionally make it also possible to use an environment variable
as an opt-out with the same QT_REQUIRE_HOST_PATH_CHECK name.

Amends 0f8017efb6d037c4f33f947eb3c56aeafa28313c

Change-Id: I3b1f35d1540493680323330bddc28c65e88b966f
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 98450a332e317aeafa3381abd6266829e8900758)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-25 17:04:35 +00:00
Giuseppe D'Angelo
27dc042712 Rename qt_saturate to q26::saturate_cast
C++26 adds std::saturate_cast, so follow the established pattern of
other similar "backported" APIs. The old name is left around while
we port other submodules.

While at it, move qt_saturate's tests to the qnumeric test.

Change-Id: I653a2e3d936081378298a9c8e51e7c1a2d438d83
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 7447ad503330ed176cf369792ffb33b7e00a58d3)
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-08-25 17:04:32 +00:00
Juha Vuolle
f2e083156e Fix minor Android manifest documentation issues
Change-Id: I0b7a8a88acd7c6fd30ce67cc140a819c9e72862f
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 1b963f02c102750af807ec08b04ab54986a35e8d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-25 17:04:29 +00:00
Tinja Paavoseppä
e04eca32a0 Android: Move EditPopupMenu to QtWindow
The EditPopupMenu requires a View in its
constructor, making it important that we do
not hold a reference to it after that View
is no longer valid.

In cases where we do not have one, top level View
that will stay valid for the lifetime of the whole
Activity, e.g. when embedding a QtView to non-Qt
Android Activities, making the popups QtWindow based
makes sense, as the lifecycle of the popup and
it's corresponding QtWindow should match.

Task-number: QTBUG-126180
Change-Id: Ibb45513de98f79a293a05eeb317d959ac0328dbe
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 9e167af3f6a4b2ac192aedd83f5066808d719415)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-25 17:04:24 +00:00
Tor Arne Vestbø
8d2f2cc791 Avoid dock widget separators stealing mouse events from expanded toolbar
The way QMainWindow handles dock widget separators is a bit evil. They
are real QWidgets, added as direct children of the QMainWindow, but
painting and mouse interaction is handled by a hook into the QMainWindow
events, via QMainWindowLayoutSeparatorHelper::windowEvent(), which
is called at the start of QMainWindow::event().

For reasons unknown, we also raise() these separator widgets, which
means they are always at the top of the child window stack of the main
window. This is problematic for the situation when a QToolBar has an
expanded overflow-menu, which is also raised(), but where we end up
raising the separators on top of the toolbar again. As a result the
toolbar gets leave events when we hover one of the separators, even
if the toolbar menu is overlaid the dock area, resulting in the menu
closing.

We don't see this visually, as the separators are drawn via the hook
mentioned above, which happens before QMainWindow draws any of its
child widgets, like the toolbar.

Fixing this requires us to selectively place the separators below
any expanded toolbar each time we raise a separator, so that we
respect the request of the toolbar to be on top, while still
ensuring that the separators are above any of the dock widgets.

Unfortunately the QMainWindowLayoutSeparatorHelper hook also
processes mouse move and click events, resulting in the cursor
changing shape when hovering the separator, even if the toolbar
menu is over it.

To fix this we amend the logic of finding a separator widget
based on the mouse event position to also querying the QWidget
childAt() function, and if we are over a tool bar, we bail out
instead of looking for a separator on that position in the dock
area layout.

As the special separator logic in QMainWindow is conditioned on
the style returning 1 for QStyle::PM_DockWidgetSeparatorExtent
the test checks for this, and skips if another style is in use.
So far only the macOS style is affected by this. See the original
change in fba33a6bbc09bb278df75829d8d705863d40a6a3.

Fixes: QTBUG-124733
Pick-to: 6.5 6.2
Change-Id: Ifc741336bd9725ef0fea9f0474e27b7481f3a183
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 3d99f90b50ab22ef5ab4433c57f9ee584a0a7cae)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-25 17:04:20 +00:00
Tinja Paavoseppä
f149f0245f Android: Move CursorHandles to QtEditText
The CursorHandles are the handles visible when trying
to select text from a text edit, or select a position
in the text. As it is not used anywhere outside
a text edit, move it inside QtEditText, making it
easier to handle cases where we have multiple windows,
and multiple QtTextEdits.

Task-number: QTBUG-126180
Change-Id: I765f229050ca33887570c1434bdc0a2aa3659649
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 996e1fba5e83e09a897272b16062a8e4fad291ef)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-25 17:04:16 +00:00
Tinja Paavoseppä
e1b7a0d3ee Android: Remove getQtLayout() method
After refactoring the various keyboard input
related Java classes so that they are more contained
inside their respective windows, this method becomes
unnecessary.

Task-number: QTBUG-126180
Change-Id: I608399e98892752182039b8ece60005670da8224
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 9ed29c73674939c772cc6b407881935e7fa19bcd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-25 17:04:11 +00:00
Axel Spoerl
38e8899249 QCompleter: Forward mouse press/release to virtual keyboard
When the list view of a QCompleter is visible, it receives mouse events.
A mouse press event outside the completer hid it.

If a virtual keyboard was active, it did not receive mouse press/release
events in case the completer's list view was active.

Add a helper to QGuiApplicationPrivate, that detects a virtual keyboard
under a mouse event position, and forwards the event if needed.

Adapt QCompleter::eventFilter() to use the helper.
If a virtual keyboard one exists and a mouse press event occurs inside
it, don't hide the completer and forward the event.
Add handling of mouse release events, and also forward them to the
virtual keyboard, using the helper.

Add logging.

Fixes: QTBUG-126752
Pick-to: 6.7 6.5 6.2
Change-Id: I613523a9c83b319810397770c43b2eb4ae01c31a
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 93ce8f13fc8042eac976a3c911af7d7664e8d5dc)
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2024-08-25 17:04:07 +00:00
Paul Wicking
9c032ad5fe Doc: Specify target_link_libraries item for CorePrivate module
QDoc has a new command, `\qtcmaketargetitem`, that allows for overriding
the content generated for the `target_link_libraries` instructions on
class/namespace pages. The new command must be used on the documentation
for the module, in conjunction with the `\qtcmakepackage` command.

This patch makes use of the new command for a limited number of
Android-related classes that belong to the CorePrivate module. It also
removes the "usage snippet" and drops its inclusion from the few classes
that included said snippet, as that's no longer needed.

Task-number: QTBUG-109214
Task-number: QTBUG-121991
Change-Id: Ic715b6512a26b3b89e24f418295640f9bbda9417
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit 4ed994487484b37ff960144806445f8f9ce42286)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-25 17:04:03 +00:00
Matthias Rauter
1909435b03 Work around compiler bug in QTransform
gcc version 13.2.0 (Ubuntu 13.2.0-23ubuntu4) seems to remove some
code in release builds that is embedded in a macro in qtransfrom.cpp.
This patch changes the macro into a function such that it is not
removed by gcc.

It seems like the switch statement is (wrongly) optimized away if it is
embedded in the QTransform::map(QPolygonF) overload. nx and ny are
always 0 (as initialized by QPolygonF) after the macro (but only within
the QTransform::map(QPolygonF) function.

The bug happens only in a release build. Added debug messages of nx and
ny created no output, adding qDebug() << t, which made the macro work.

It seems that a complex combination of macro and switch statement can
tigger the bug in gcc. So rewriting the macro as a function works around
the bug.

Fixes: QTBUG-127723
Change-Id: I7e0b02cde276e591cf773f4e18dd505134421957
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 11b70b66de627d3bd0ef4193d5cfa624c88ac96a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-25 17:03:57 +00:00
Wladimir Leuschner
11473410c2 QWindows11Style: Make MdiControls darkmode aware
Pick-to: 6.7
Change-Id: I525602c9757a8fed3d5ab6d64fe856adaa75b83d
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 982314aace15109857784b0b6c3b49cc6e13b9b7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-25 17:03:54 +00:00
Tian Shilin
001afe49b4 fix: Redundant condition in qplaintextedit
The redundancy in the conditional judgment exists
because QApplicationPrivate::keypadNavigationEnabled()
appears in both conditional branches. Specifically, the
conditional expression can be simplified because
!A || (A && B) is equivalent to !A || B.

Change-Id: I071e349ea4f67a03f89136e2156eb5918a65214f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 792373595d9d9d45f5c43e6a9e3f90c1b7ad54d8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-25 17:03:51 +00:00
Tim Blechmann
6c8d2e042c Gui/Testlib: fix compilation for FEATURE_qreal
Task-number: QTBUG-118877
Change-Id: I4988f3b8b9ed09d8f01873fe34bf78d8105a25da
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit a74b550e2c38679c329cd40d2119ab440668468e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-25 17:03:41 +00:00
Wang Yu
ee09375bba Fix Windows drag and drop crash
When QGuiApplication::primaryScreen() is empty,
dragging it causes a crash

Change-Id: I6c5e48be44db90acec5126957bee60b8514b10a7
Pick-to: 6.7 6.5
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit f8e7dfe93ab9622f77aade23707cd6f0b9386379)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-25 17:03:37 +00:00
Thiago Macieira
d6bef9a6f9 Switch tools and apps to non-strict C++ builds too
This complements commit 30e04340dac26ebd09f9bc8ceb598e873ab63ba7
("Switch to non-strict C++ builds so QT_SUPPORTS_INT128 is true") and
adds the same modification to tools and apps.

Otherwise qtconnectivity's sdspscanner won't compile, as it needs
quint128.

Task-number: QTBUG-119901
Change-Id: Ib9a6fe573e9420a471fdfffd76a2e43d3c5496d8
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 7e37962cd0d1faf65249e08020619ef7175a280e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-25 17:03:29 +00:00
Ivan Solovev
a2b94167ab Clarify QT_DISABLE_DEPRECATED_UP_TO usage in static builds
Explicitly mention that in static builds Qt itself needs to be built
with the same deprecation version as the user code.

Fixes: QTBUG-125975
Pick-to: 6.7 6.5
Change-Id: I51b1e8b4ecd1731d3ff2320e758a52c5ef2c7cd9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 47ff7d99a06321559d7ab1682869732ea6e08359)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-25 16:40:12 +00:00
Doris Verria
57f0085fec QWindowsTheme: Set correct accent color depending on color scheme
The accent colors retrieved through the UISettings.GetColorValue API
are not theme aware. They will report the same values for both light and
dark mode. We were using the same Accent color value for both color
schemes giving us poor contrast when app is running on dark mode.
The API gives us several shades of accent colors from lightest to
darkest which we need to map to the accent roles in our QPalette
depending on the active color scheme. The following colors and their
mappings are based on the modern WindowsUI3 and its official Figma file:

Light Mode
AccentDefault (default accent color for controls) -> AccentDark1
AccentText/Primary (accent color for links) -> AccentDark2

Dark Mode
AccentDefault -> AccentLight2
AccentText/Primary -> AccentLight3

Fix this for the qwindowstheme so that it affects both the windows11
style and the FluentWinUI3 for Quick.

Pick-to: 6.7
Change-Id: If1c3a909d0a4dc9082e7589eaeaebd05e9f65a29
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit d4a2f01976bbb0f8b357bfd96faf9ec249047c95)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-25 12:54:34 +00:00
Axel Spoerl
0a8a34fbe1 Remove tst_QWidget::render_task252837()
The test function renders a pixmap into a widget that is never shown.
It checks for a crash, without failing or passing.

tst_QWidget::render_graphicsEffect() tests the same code path.

Remove the unneeded test function.

Change-Id: I1b64e0466c5a133deec28d0f74ef5acd9858e1ea
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit dfdcb90ffdec0c3a4f7c1c5c59dfba5c04b8c521)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-25 12:54:34 +00:00
Christian Ehrlicher
d8c7856312 SQL/OCI: Compile with MSVC/64bit
Make the oci driver compilable with MSVC 2022 / 64bit. One more reason
to get those drivers checked within the CI.

Pick-to: 6.7 6.5
Change-Id: Iec07adcd4cafde5e028ea306fb88e635a22e2234
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 2eb66149131b852f687302417cb2f76ef3184dbe)
2024-08-25 12:54:34 +00:00
Ivan Solovev
cabd94bc67 Make QList::max_size() constexpr
Looks like it was just forgotten in the original patch.

Found in Qt 6.8 API review.

Amends 7ce6920aacfcba485cd8017e01c6aeb324292e75.

Change-Id: Ibcc5ec8408b834f1271e632b804efdfb93f9203f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit d585c7c0a3e49ba841712ea0b4b19d307b34f249)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-25 12:54:34 +00:00
Marc Mutz
27c3f90650 QCryptographicHash: copy SHA-3 context outside sha3Finish()
This matches what other algorithms do.

This is in preparation of separating the state copying from the
algorithm finishing, to eventually establish code paths that do not
need to copy (e.g. static hash()/hashInto()).

Pick-to: 6.7 6.5
Change-Id: If674cae6b7b3fc3abd3b72f2162532321decadff
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 37e360a13f14f19ac0d3ea9ca5d18ca222f3b5a7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-25 12:54:34 +00:00
Assam Boudjelthia
b88adc1188 Android: upgrade to Gradle 8.10 and AGP 8.5.2
Bump Gradle version to the latest of 8.10 and Android Gradle Plugin
to 8.5.2 which is used by latest stable Android Studio Koala.

AndroidX core depenedency doesn't need an update as the latest stable
is still 1.13.1.

[*] https://developer.android.com/build/releases/gradle-
plugin#compatibility
[*] https://developer.android.com/build/releases/gradle-plugin#updating-
gradle
[*] https://github.com/gradle/gradle/releases/tag/v8.10.0
[*] https://developer.android.com/jetpack/androidx/releases/core

[ChangeLog][Third-Party Code] Updated Gradle to 8.10 and AGP to 8.5.2.

Pick-to: 6.7
Fixes: QTBUG-126061
Change-Id: I2178915776f7de60a0ca04826b7cee3e120096b3
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit b5d8552f2baab56457d3f39f6b2915c72447b702)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-25 12:54:34 +00:00
Marc Mutz
92284a5c02 QCryptographicHash: enable -Wswitch in methodToName()
Let the compiler alert us to adjust this switch in case we add more
Algorithm enumerators.

Amends 633c1365966eda89fc883c039683a727d0a0813e.

Pick-to: 6.7 6.5
Change-Id: I2ce16ac3045d3eebfe74c4080c3b326dd865cf37
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 0abf0d26a938e9cf7c67d8bf6f6bfdf4e49f1cab)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-25 12:54:34 +00:00
Allan Sandfeld Jensen
5c2796a079 Limit gui thread pool to 8 threads
Avoid having too many threads, since iOS punishes us if we overstep 64,
and we don't really need more than 8 on any platform.

Fixes: QTBUG-128290
Pick-to: 6.7 6.5
Change-Id: I59a233d422e9b1b2097a777e0b1b626e144594d9
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 80f210db3e43c50e252504f41ed3fbd8b2992028)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-25 12:54:34 +00:00
Thiago Macieira
13dbf7542e tst_QStringApiSymmetry: disable for WASM
It's failing to produce output in reasonable time and blocking the CI.
Since this test is basically a syntax checker, it not being present for
WASM is not a great loss.

Task-number: QTBUG-128322
Change-Id: Ic49e7523af63d5819c13fffdd7a752534b77f0ab
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f414505eaac5c222fc6404b9cda24fec25f68a7a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-25 10:21:14 +00:00
Ulf Hermann
874de78012 androiddeployqt: Do not misbehave on QML file and directory imports
Those are generally not in any import path. So far, qmlimportscanner
generates invalid "path" entries for file and directory imports, causing
androiddeployqt to skip them early on. androiddeployqt should rather not
try to read them at all. Then we can fix qmlimportscanner.

Change-Id: Ic87a10bee5845a6b10ee902ba28aed5c060956f0
Task-number: QTBUG-126632
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 67ae983d1e9c75bf31d6fada0b667cfbe2f3fc0a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-25 07:55:17 +00:00
Assam Boudjelthia
6c3e5b08c4 Android: un-TP QT_ANDROID_PACKAGE_NAME and add a snippet
Fixes: QTBUG-126465
Change-Id: I04d95640ba05696879b1ce75902f916e4b03b6b3
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit b30edf6fe3701c5de8d175bab6106922ec312267)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-24 13:55:12 +00:00
Assam Boudjelthia
03bf2cba3f Android: use QT_ANDROID_DEBUGGER_MAIN_THREAD_SLEEP_MS for debugging only
Enable the workaround to sleep and wait for the debugger to attach from
Qt Creator using QT_ANDROID_DEBUGGER_MAIN_THREAD_SLEEP_MS only when
running a debugger and not with all debug apps.

Fixes: QTBUG-128298
Pick-to: 6.7
Change-Id: I0a0866fada27de250fd6946a8ccfd254824d70e0
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
(cherry picked from commit e8a35410c4c699ea588791006b36dd363cc25d9c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-24 13:55:09 +00:00
Sam James
87b21e3ded Fix ODR violation for IsFloatType_v
With recent GCC 15 trunk, I started to see:
```
ld: .../kwalletentry.cc.o:(.rodata+0x0): multiple definition of `QtPrivate::IsFloatType_v<_Float16>';
	src/runtime/kwalletd/backend/CMakeFiles/KF6WalletBackend.dir/cbc.cc.o:(.rodata+0x0): first defined here
```

The issue is that constexpr is only implicitly inline for functions or
static data members [0], so the constexpr IsFloatType_v specialization
here causes an ODR violation.

Explicitly mark the specialization as inline constexpr.

[0] http://eel.is/c++draft/dcl.constexpr#1.sentence-3

Fixes: 4b755bc11a8eadd156c65b7474c11e3ce822c6f1
Pick-to: 6.7
Change-Id: Ie9257138f6d1218ca0a91f5d114aab2483cb275b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit a06f3e823bea0361125a10dd361f6fd50a4041cc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-24 11:14:54 +00:00
Liang Qi
134f23d921 tests: blacklist tst_QTcpServer::qtbug6305() on macos-12 arm
Task-number: QTBUG-127568
Change-Id: I1651f3344c024c5448bf9d04b477b181ff6df97a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit c3abc0446cf792a52221b11132f55e933eba9f89)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-23 20:04:26 +00:00
Axel Spoerl
1329e6faca QWindowsWindow: Work around offset bug in GetWindowPlacement()
GetWindowPlacement() stores wrong positions in the &WINDOWPLACEMENT
argument's ptMaxPosition member on Windows 10.

(1) Each time a fixed height window is maximized, ptMaxPosition moves
- down by the task bar's height, if the task bar is on top
- right by the task bar's width, if the task bar is on the left

(2) The frame margins' left offset (typically -8) is not respected.

On Windows 10, set ptMaxPosition to {0, 0} adjusted by the frame
margins' left offset.

Fixes: QTBUG-123752
Pick-to: 6.7 6.5 6.2
Change-Id: I8bbd63d93a7648921b703ff6f3e09c4cf2999be2
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 33874a9424cd03c21ca9986a39c383b3689f03d2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-22 13:41:20 +00:00
Jøger Hansegård
322e55ff45 Enable transparent windows with embeddedwindows example on Windows
The embeddedwindows example illustrates embedding child windows with
transparency enabled. On Windows, this is implemented using layered
windows with the WS_EX_LAYERED extended window style. To make this work
with child-windows, we need to mark the application as at least Windows
8 aware.

Change-Id: I3a2e4f6018b3d2aee883ab755b63ad75bc8c80e8
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 4e7f5c43a3be609502ccc15861319503dc2c842b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-22 13:41:20 +00:00
Ahmed El Khazari
a96e0eddd9 Android: Support custom FileProvider in openUrl
Previously, qtprovider was set as the default FileProvider, which
causes issues when creating a custom FileProvider on application side or
having multiple FileProviders.
To address this problem, we have implemented a solution that checks for
all available FileProviders and ,in case of multiple FileProviders,
selects first non-default FileProvider.

Fixes: QTBUG-117417
Pick-to: 6.7 6.5
Change-Id: I2a68983403f964036dc3177e13fe7ea4f9b4788b
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit d3508d48c0e4ef73a3a673ea14fb59cd8d930398)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-22 13:41:19 +00:00
Volker Hilsheimer
39524fabc4 Accessibility on macOS: make treeview test more reliable
Add a check that the reference we create the TestAXObject object from is
valid, and assert that it is before calling properties. Verify that the
rows we get all have the correct number of children (the columns) before
trying to read the cell values.

As a drive-by, change the relevant code to use property syntax, and
release objects consistently.

Task-number: QTBUG-122751
Change-Id: I1db3e4446c569235cfc0f3092adc7369ad826368
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit dac1a338d31be82004f0f2666105ad18e557409b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-22 04:40:28 +00:00
Volker Hilsheimer
8633139e25 Accessibility on macOS: clean up reference counting logic
Simplify the "populate" functions to always create a new array, rather
than trying to reuse the existing array. Use (auto)release to free the
old arrays.

When creating place holder cells for a new row (where we know which row
array to add the cell to), shortcut the code to not find the row array.

Don't release cell elements that we got from the cache.

Consistently fix the row array size if it's not matching the table's.

Assert some more invariants and add logging output.

Fixes: QTBUG-122751
Pick-to: 6.7
Change-Id: Ie122a4754f6a3f4c19c5412a7c9e589f2861d4ae
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 1f7e926411d1e0d958c37dc597f24101d410c46b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-22 04:40:24 +00:00
Volker Hilsheimer
c802de110b Accessibility on macOS: add more diagnostic output to test
Emit debug output if we fail to get child, row, or column lists from a
table or row element.

Task-number: QTBUG-122751
Change-Id: Id8e4d2e46db089fab8295b314f66163e8c9a893c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 283ff11d0fd3df07d7500020e9af379725af1e72)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-22 04:40:22 +00:00
David Faure
1925abe174 QComboBox: don't call model->index() with row = -1, during reset
This leads to an assert in QConcatenateTablesProxyModel::index()
for instance.

Change-Id: Icd0ae1497705484b021067034c0d8f39049c04ed
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 1ba3277b4c79b80788e2d600840876856ec6933d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-22 03:37:12 +00:00
Tor Arne Vestbø
7229cc75a4 macOS: Query platform window for size when flushing child windows
Otherwise we will not pick up the effects of the QHighDpiScaling layer
to the QWindow size, such as when setting QT_SCALE_FACTOR explicitly.

Fixes: QTBUG-122967
Pick-to: 6.7 6.5 6.2
Change-Id: I9dc914728c5aff28ef52ea3a502c94bcc91738bd
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 270866923cce6184cd368fc5466e79bf5f845549)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-21 20:06:33 +00:00
Alexey Edelev
589661c0d5 androiddeployqt: Fix the --sign argument handling ordering
Allow using the follow arguments after '--sign' argument in
androiddeployqt. The previous fix had no effect since we should
consider the argument count first and the type of arguments next.

Amends 9c56a77027db2fedfc2b50f96ceaee5003a7d383

Fixes: QTBUG-128254
Task-number: QTBUG-109619
Pick-to: 6.7 6.5
Change-Id: I34eac4def94c1d0c8d304f383d60c1e21b7dc6a2
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit fd2c408af2f300e100d94a386743c7cbe74fadef)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-21 20:06:32 +00:00
Tor Arne Vestbø
7f09ec878b Bump Apple OS deployment targets and minimum/maximum SDK/Xcode versions
As documented in our platform support docs.

Change-Id: Iadcf369facbe5d798827c486e564a6e124f2836c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 1bd70d671247a9b0e709fda2a077a9dbf46c276f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-21 17:02:12 +00:00
Mårten Nordheim
727b71bd2b Http2: speed up window_update for many streams
By keeping a list of blocked streams we can query just those instead of
any and all open streams when we get additional data transfer budget.

In the future we could additionally sort them by priority, if we start
taking priority into account.

Task-number: QTBUG-126772
Change-Id: Ieab250893e157d2c50b0db2fdc10aa2dc3c38048
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
(cherry picked from commit 1e57371695752d4112fa59c89d38e58b977d55bc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-21 17:02:11 +00:00
Mårten Nordheim
5ac0c50cae Http2: Clean out streams as they get deleted
Instead of keeping the empty QPointer in the hash forever
let's try to keep the hash lean as to not punish iteration
over it as the streams are being created and deleted.

Task-number: QTBUG-126772
Change-Id: Id7afa684a19e6a16726e5bda5debdd2f2bbe86ab
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
(cherry picked from commit 94e8bb96304fd2ea2ddfdf2499f4024131a16a8a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-21 17:02:11 +00:00
Tor Arne Vestbø
987b215f08 macOS: Implement NSServicesMenuRequestor protocol for Writing Tools support
The AI based Writing Tools in macOS 15 uses the NSServicesMenuRequestor
protocol to interact with custom NSView.

By implementing the protocol we also gain support for service menu items
such as "Look Up in Dictionary" or "Make New Sticky Note".

Note that we only support plain text for now, which means that a rich text
selection will lose all its styling when fed through a service that changes
the text. To support rich text we need IM plumbing that operates on QMimeData.

The Writing Tools feature itself is only available on macOS 15.1.
To trigger it a native context menu with edit actions has to be shown,
meaning this will not work out of the box for Qt Widgets. For Qt Quick
with popupType set to Popup.Native the menu item is added as expected.

Task-number: QTBUG-126238
Change-Id: I2cd4aa9af8d613c7c67b3c19a70a23660dde2154
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 888429a734bf379ee59519b5d6047561df66c9a5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-21 17:02:11 +00:00
Mårten Nordheim
ece128fc5e Http2: fix some potential constness issues
The function is not const, and the access to the hash was
not const, so it would check if detaching was necessary.

Change-Id: Ie46cb89db20c8d9b227d50b4b6c5053dcb5791eb
Reviewed-by: Mate Barany <mate.barany@qt.io>
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
(cherry picked from commit ca735d8d4113490c54671e6a99a89c2379ea68da)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-21 17:02:11 +00:00
Paul Wicking
3be0f9e4ea Doc: Fix issues in print media type in offline style
When generating HTML output, QDoc references CSS styles that control
the visual appearance. For a standard build of Qt's documentation (a
'local' build, if you will), an "offline" style is the default. This
style sheet is maintained in `qtbase.git`.

This style is not particularly well maintained, as it is not the style
in use for documentation published to `doc.qt.io`. As such, some
issues where found as a side-effect of other work. In particular, an
ill-placed background image in the `@media print` CSS instructions was
found in the print dialogue from locally generated content. While
validating the fix, it became clear that the `toc` CSS class was moved
into an obstructing position in the same media type.

Change the `@media print` definition such that:
- The `toc` class is hidden entirely.

Task-number: QTBUG-124162
Fixes: QTBUG-128205
Change-Id: Ic427036a698d7fc0e07e9190289e5d2c196885d9
Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
(cherry picked from commit dd669c84657c48c27318b246db83b82478d6951a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-21 17:02:10 +00:00
Tian Shilin
6f0b55e292 fix: Redundant condition in cacheSaveDevice
If cacheSaveDevice is false, then if must be true; if
cacheSaveDevice is true, then only need to judge
whether !cacheSaveDevice->isOpen() is true or not, so
the second judgment condition on cacheSaveDevice I think
it is not necessary.eg: '!A || (A && B)' is equivalent to '!A || B'

Change-Id: I5201d54017d2457ba4b92ee99bb968a0961ccbb9
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 3ecbf28aa6ee43fe967ef219f909f3784e5b3d26)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-21 17:02:10 +00:00
Laszlo Agocs
9d26d58eba rhi: manual test: Do not blindly enable qt.rhi.* logging
Now that qt.rhi.general is not the only category, this is
not ideal.

Change-Id: Ied3533327dc310cee5fce75fe5760454167161b7
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit a537703a4df516da9b7f9126c719a1ccb9271647)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-21 17:02:10 +00:00
Tinja Paavoseppä
52f8e8e634 Android: Make QtLoader subclasses singletons
When embedding QML to non-Qt Android apps, it is
possible that the QtView will be recreated, after e.g.
an orientation change. This will lead to a new
QtLoader being created and trying to load the Qt libraries
again, even though they have already been loaded.

Also, once adding support for having more than one
QtView, it doesn't make sense to try and load the
libraries again. Having the loaders be singletons
and checking whether the libraries have
already been loaded avoids this.

Task-number: QTBUG-124114
Change-Id: I2273fc58a8f1268f03d3348b782e74d83759f351
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 092b3a0ff9c24edd0fc60dc436aaefcca2b1939c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-21 17:02:10 +00:00
Tinja Paavoseppä
a0a2d14cc3 Android: Remove unused imports for QtEmbeddedLoader
Change-Id: If5e3caf1df91c41eaf7fe2dddd1e4e94e9116138
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 9e259de282826f14878417978fc7b8201ad76a48)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-21 17:02:10 +00:00
Tinja Paavoseppä
6e813c4072 Android: Track QtLoader success better
QtLoader doesn't really handle failures in a way that's visible outside
the class itself. There is the abstract finish() method subclasses can
implement to handle clean up in the loader itself, but it's not visible
outside, which leads to trying to execute paths of code we know are not
going to work, since if the Qt libraries are not loaded the Qt app is
not going to work.

Make QtLoader throw an exception if invalid arguments are passed to it,
as there is no way for the loader to do its job properly if the passed
Context is not what we expect it to be, so might as well exit early.

Make the loadQtLibraries() method return a boolean, letting the caller
know whether the loading was successful or not.

As a result, the finish() method can be removed, and the caller can
handle failure as appropriate for it.

Task-number: QTBUG-124114
Change-Id: I2dc1a0846eb404112f88e9da365db2ab071f4317
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 2b48614f68cbf98d6597819749b732556c32cb44)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-21 17:02:10 +00:00
Tinja Paavoseppä
984b56d9c9 Android: Remove context member from QtLoader
Both QtActivityLoader and QtServiceLoader already have separate
members for their Activity and Service, respectively, and
the QtEmbeddedLoader should become more like a singleton, so holding
a reference to the Context, which anyway is only used when setting up
the loading, is unnecessary.

Task-number: QTBUG-124114
Change-Id: I412f4dbd45e48add9ea091eb589c7ef9a3942399
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit ae0db7a61de1f0f9b36810a94984c69f5d7e5d1e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-21 17:02:09 +00:00
David Edmundson
6af4e5f604 QWidget: Store initialScreen as QPointer
A Toplevel QWidget can hold a pointer to the screen where it will
eventually show contents, before a QWidgetWindow is created which then
takes precedence.

The screen member of QWindows is always kept up-to-date when a screen is
removed, but not the contents of a toplevel window. If a widget has
setScreen called but is never shown, it has potentially dangling pointer
which can cause issues in the future.

Pick-to: 6.7 6.5
Change-Id: Ia7c80549e8b3c90a75cdde745487e87ecddaca63
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit d67acf94afffde6a71498be6e30447f3acf7558e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-21 13:59:05 +00:00
Kaloyan Chehlarski
5c94c5a4ef QAbstractItemView: Fix shift-select after changing index through model
When setting the current index through the related model's
QItemSelectionModel::setCurrentIndex(), the selection can also change.
However, attempting to shift-select after doing so would produce
an unexpected selection, because the internal variable that keeps
track of the start index of the current selection would still have
its old value.

This change moves where said variable is set: instead of doing that
in QAbstractItemView::setCurrentIndex(), it is now done inside the
currentChanged() slot instead. This slot will get called both when
the selection is modified through the QAbstractItemView class itself,
as well as when it's modified from the outside (e.g. from the model).

Pick-to: 6.7 6.5 6.2
Fixes: QTBUG-127381
Change-Id: I6d38320e656aa5a102ce079604590672c88ecad1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit fb2d64bc57aadf5bf140c72cf7eb2a5f391b7d55)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-21 13:34:23 +00:00
Shyamnath Premnadh
887076220a Documentation: Update API documentation of QAndroidPrivate
- Some references of androidActivity() were replaced by
   QNativeInterface::QAndroidApplication::context()

Pick-to: 6.7 6.5 6.2
Fixes: QTBUG-127926
Change-Id: Ib2fdb3d13ad72121895c5464d8a21cda33bb28b3
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 91f70771a86a5110eff96ac40bba0b5770154708)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-21 07:33:36 +00:00
Christian Ehrlicher
2d6788d6eb Widgets/QMdiSubWindow: fix high-dpi painting of control buttons
The high-dpi painting for the buttons in the QMdiSubWindow was broken
for the windowsvista style because an invalid widget was passed to the
paint routines. This lead to a wrong calculation of the devicePixelRatio
and in the end very blurry icons.

Pick-to: 6.7
Fixes: QTBUG-127288
Change-Id: I0f604ddb4faf66a6e850a1504582076f22418fcd
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
(cherry picked from commit 8b261a2ad7884f8fe7a93a678c9fce5052e42c98)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-20 18:23:52 +00:00
Michał Łoś
a7fc60015d Enable mouse handling on VxWorks
Provide implementation of QEvdevMouseHandler for VxWorks OS.

This is a preparatory change before actually using this handler, as Qt
is not supporting evdev on VxWorks yet.

Task-number: QTBUG-115777
Change-Id: Ie92418c903a54ea1d6683e08762d4cc88c4956ac
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 2003532cd84141434f698d723458f0672766fc0c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-20 18:04:37 +00:00
Orkun Tokdemir
d92264a089 CMake: Remove QT_NO_SHOW_OLD_QT_WRAP_CPP_WARNING
Fixes: QTBUG-128145
Change-Id: Iffa1e6ba05d6cca1323e01861d8028c06b34a656
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit f60237ac93859be11415aa28c097137da23aea60)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-20 18:04:36 +00:00
Petri Virkkunen
b48b0dba63 Android: Clear QtEditText focus after keyboard is hidden
Since QtEditText only needs focus for the virtual keyboard, focus
should then be removed once we're done with the virtual keyboard.

After this, focus will be received back by QtWindow, which will then
handle key inputs properly.

As a drive-by, remove the default focus highlight on QtWindow to stop
the ugly flickering that happens when QtWindow receives focus back from QtEditText.

Pick-to: 6.7
Task-number: QTBUG-126187
Change-Id: I911e3371d9c582b2805dc895ef49b0d4210714f3
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
(cherry picked from commit dc71864d4a358149a2531d324645934e47879dba)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-20 16:08:02 +00:00
Joerg Bornemann
f35cc3a115 CMake: Don't hard-code "libexec" in qt-configure-module
If INSTALL_LIBEXECDIR was set to something != "libexec",
qt-configure-module contained the wrong path to qt-cmake.

Fixes: QTBUG-128137
Pick-to: 6.7 6.5
Change-Id: Ic095ff8cb804bbdd72e238e75ac867b7cc3bd478
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 12b0f73a9e9cef35395d0a1560a51604c1c054ff)
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-08-20 13:50:32 +02:00
Mårten Nordheim
5caa31cb21 QByteArray: fix lastIndexOf for char values with set sign bit
lastIndexOf will convert the `needle` to unsigned char, which is then
'upcast' to int, before we search. But the string itself was searched
using signed char, meaning any values with the signed bit set would
mismatch.

Add tests for indexOf and lastIndexOf.

Amends 4c12ae7e67abc3d9b5847f6b61177ede3ee3203b

Fixes: QTBUG-128199
Change-Id: I0ce7d7d9741f21650ef6f0f012a94e00d84a0f02
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 7b1f3bdc503ea7aceacc9fa8d388d843f1d7b131)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-20 11:40:56 +00:00
Ulf Hermann
833c0040cb moc: Print method index to JSON output
We want to be able to index into the metaobject from code generated by
qmltyperegistrar. And we don't want to rely on some implicit promise
that certain methods are in the "right" order in the output. This is
similar to what we've done with properties.

Change-Id: I8d97b65598338fcff57c6b0866708232066c94cb
Task-number: QTBUG-127442
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 484e72a1074279dca1253ae07515461ad231de3c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-20 08:51:01 +00:00
Alexey Edelev
a29573d136 Check the PROJECT_NAME when attempt to build sql drivers
Check the PROJECT_NAME but not CMAKE_PROJECT_NAME when attempt building
sqldrivers. This should be save since we expect that the project() is
called pre-Qt repo.

Task-number: QTBUG-127953
Change-Id: Ief3f11ba747ded0984ccfe1cfa6b7b47da538137
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 3e1a223318dbda50a010ba851841a9e51c80c42b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-20 01:59:46 +00:00
Giuseppe D'Angelo
1f3e8c3162 QString::replace: fix a performance regression
eb60e940202857dc155f1a0e499364962faad7f6 refactored the QString::replace
helpers as to avoid a full copy of a string (when detaching) only to
then modify it in order to apply replacements into the new copy.

Unfortunately it also introduced a regression: if we are replacing into
a string that does not need detaching (that is: it's non-static and
there are no shallow copies of it), and the string does not have
sufficient capacity, then the code chose to allocate a brand new string
and do piecewise copies/replacements into the new string.

This is suboptimal, as it precludes the possibility that the string gets
reallocated in place (via a realloc() that doesn't actually move the
string data in memory), which is a huge performance win. (It also
precludes the possibility of compacting the string data "to the left" in
case we do have sufficient capacity, but not at the "right end".)

This caused a 3x slowdown when replacing in large strings.

Solve this by removing the capacity check and unconditionally
reserve()ing enough space so that we can then do in-place replacements.

Change-Id: I921e3ea65222eca8125996d8d3ea77e9c09ba205
Pick-to: 6.7
Fixes: QTBUG-127549
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 315210de916d060c044c01e53ff249d676122b1b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-20 01:59:31 +00:00
Alexandru Croitor
6d8bab3073 CMake: Don't forward FRIENDLY_PACKAGE_NAME to sub-attribution targets
Instead, the package name should be determined by the sub-attribution
target name. Otherwise the build system will try to generate multiple
files with the same name, but different content.

Amends 5daabb5a74c4e7c5d087da7f9207d79d2ee05b13

Task-number: QTBUG-122899
Change-Id: I10b4ec2fe8f38d70d13918dc980d1bd1d9145cb6
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit d624592ca40e05033432de72e0c4d9f6570b5544)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-20 01:28:03 +00:00
Alexandru Croitor
fecea19254 CMake: Don't use root attribution file for system libraries
A project's root qt_attribution.json file might be picked up by the
build system when recording system libraries for SBOM processing.
One such case is qtgrpc.

This caused generation errors in qtgrpc with the following message:

CMake Error: Files to be generated by multiple different commands:
 qt_sbom/SPDXRef-Package-qtgrpc-qt-3rdparty-sources-WrapProtobuf.cmake

This started happening since the SBOM options are now implicitly
propagated to auto-created attribution targets, and each attribution
target attempted to generate to the same partial sbom file.

Any qt attribution file in the project root is not intended to be
used for system libraries, so explicitly disable using the
root attribution file for all system libraries.

As a more long-term fix, we should consider making the partial sbom
files be more unique.

Amends 5daabb5a74c4e7c5d087da7f9207d79d2ee05b13

Task-number: QTBUG-122899
Change-Id: I67544c299e630597f26602d270cd1dfd54cccfb6
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 55b399fdcd12bdfc645d4ec7d25b3c881d11a09a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-20 01:28:03 +00:00
Soheil Armin
c90a8a8c35 Android: Rename opt-in CMake flag that generates QML to Java code
The Java QtQmlComponent has been renamed to QtQuickViewContent
as a part of API reviews.
As a result, we also change the opt-in flag
From QT_ANDROID_GENERATE_JAVA_QML_COMPONENTS
To QT_ANDROID_GENERATE_JAVA_QTQUICKVIEW_CONTENTS
that adds an entry to the android-deployment-settings.json.
The flags later will be used by androiddeployqt to enable the
generation of QtQuickViewContent extensions.

Task-number: QTBUG-126976
Task-number: QTBUG-127091
Change-Id: Ie08a9430a5e5a16809f78389144a4a6dfd87ce18
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
(cherry picked from commit be2c03064cdb7bef977d05371e535bedcadb3a0f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-20 01:28:03 +00:00
Soheil Armin
820098c966 Android: Reflect renaming of QtQmlComponent to QtQuickViewContent
Task-number: QTBUG-126976
Task-number: QTBUG-127083
Change-Id: I001a095c2844c725c85113c03c8640f507c8f11e
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
(cherry picked from commit 86e34dfcddf6ffd24780a50b3b4c66b9f6726b70)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-20 01:28:03 +00:00
Soheil Armin
4a3abb02d6 Android: Suppress unchecked cast in QtAIM::roleNames
Change-Id: I46e8358ad51edb3eaf87fd57851037c4c50586eb
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit d6ddda8a5b22a5daafcdb76e2b4a0f5349433546)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-20 01:28:03 +00:00
Soheil Armin
46946d63e6 Android: Add Java QtSignalListener interface
This class is being moved from QtDeclarative to QtCore as a part of
API review resutls.

Task-number: QTBUG-126976
Task-number: QTBUG-127082
Change-Id: I1c7a20daeb0d398bc6faad441ebae6136b4a88ba
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 0acdceed353da61c3c3e1392d0af0d4ecd640821)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-20 01:28:03 +00:00
Soheil Armin
9af91d6eca Android: Add Java QtAbstractItemModel auto test
QtAbstractItemModel used to be a part of QtDeclarative
and is being moved to QtCore based on API reviews.

Task-number: QTBUG-126976
Task-number: QTBUG-127089
Change-Id: I28a921a113ec4f3ad298bf55b40aea334e7721cf
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit baed8a24d07de87da61e9d5e3dbffc8d8ca92918)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-20 01:28:03 +00:00
Soheil Armin
e544ae0abd Android: Add Java QtAbstractItemModel and QtAbstractListModel
These classes used to be a part of QtDeclarative and are being moved
to QtCore based on API reviews.

Task-number: QTBUG-126976
Task-number: QTBUG-126977
Change-Id: Ic269f23ca2292031cda62faf41428667889537d0
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 55fc15ce8272073b9b404762b83e3e7acee0111e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-20 01:28:02 +00:00
Dominik Holland
81a9cbe1db coin: Introduce a COIN_DOC_CMAKE_ARGS env variable
This can be used to configure extra cmake args for the documentation
build in coin.

Change-Id: I11417bee9630aebe0bbc118cd843b1536101da71
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit b956a909c5ff29bf9824c054750966bdec42c6ca)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-20 01:28:02 +00:00
Soheil Armin
75cc149f45 Android: Add Android types and converters
This is a part of API review changed of Qt 6.8. These private
APIs are being moved from QtDeclarative to QtBase.

Task-number: QTBUG-126976
Task-number: QTBUG-127087
Change-Id: I9bfdb7dea12a2fb6a179d87639364ae28c39243b
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 4413c81c483fda125928392eb32e3320068a872b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-20 01:28:02 +00:00
Thiago Macieira
f6d69a7575 QHash: adapt to C++20 ranges not offering operator->()
Iterators no longer provide it, because they may need to return a
temporary in some occasions.

Fixes: QTBUG-128102
Change-Id: Ide0a7a84f612fff73afffffd49889321cb70505f
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit cb40a1fa7f4b06acced1d17e8333742084092f9e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-20 01:28:02 +00:00
Juha Vuolle
6991735367 Darwin: Reset CBCentralManager delegate after processing callbacks
We maintain the CBCentralManager in a retained property, which we
nil when we're done processing the callbacks. But the manager may
still be kept alive by other parts of the system, resulting in
callbacks to our delegate, where we would assert on the check
that the delegate callback manager matched our stored manager.

The conditions for the assert to occur:
- debug build (Q_ASSERT)
- permissions are actually requested
- bluetooth is toggled ON or OFF

This patch fixes this so that the listening delegate is
nil'd and therefore no additional callbacks are received.

Pick-to: 6.7 6.5
Change-Id: I1439881fd55bdfd42bc27ee57f26826fc66c3d85
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit b45d26f59368f530330b7d547846b5a74d80d585)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-20 01:28:02 +00:00
Jøger Hansegård
471debef07 Test QFileInfo::isWritable when it should return false
Extend existing tests to verify that QFileInfo::isWritable returns
false when file is read-only or non-existent.

Task-number: QTBUG-124011
Pick-to: 6.7 6.5
Change-Id: If41241b500aa76036b39a53590b5e0b6ab2f20ea
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 42004d245e2bf4846520e5e186a5c86aa87a6019)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-20 01:28:02 +00:00
Philip Schuchardt
1873ff0346 QFuture: Fix for heap-use-after-free on qfutureinterface watch
Replace deleteLater with destroyWatcher.

If the continuation is called from a separate thread,
emit watcher->run() can't detect thatthe watcher has
been deleted in the separate thread, causing a race
condition and potential heap-use-after-free issue inside
QObject::doActivate. destroyWatcher forces the deletion
of the watcher to occur after emit watcher->run()
completes and prevents the race condition.

Fixes: QTBUG-126013
Fixes: QTBUG-127880
Pick-to: 6.7
Change-Id: Id5f80ad0ec3fbd2d9c1e0d134aecd6b08ba2c79c
Reviewed-by: Arno Rehn <a.rehn@menlosystems.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 2bc82f6a1126025affd6e891efc386c08d5fa013)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-20 01:28:01 +00:00
Eskil Abrahamsen Blomfeldt
9993c1d13e Update Freetype to 2.13.3
[ChangeLog][Third-Party Code] Updated bundled Freetype
to version 2.13.3.

Pick-to: 6.7 6.5 6.2 5.15
Task-number: QTBUG-128124
Change-Id: Ica2fd9ebfd53d6efde4614f09a7fea9f6857eeac
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 7c7b34f76a78fb144600002c0aebe031e3dd42e9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-19 19:42:55 +00:00
Vlad Zahorodnii
2e6b237b03 QMimeData: Fix hasText() for text/plain;charset=utf-8
text() looks up `text/plain;charset=utf-8` but the hasText() function
has no matching check.

Pick-to: 6.7
Change-Id: Id309cd3bd11003813057704338beb36c65974f4a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 014fb179d81456577c745418017e333faeb1f08e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-19 19:42:55 +00:00
Ivan Solovev
a77987e600 QModelIndex: do not use compareThreeWayMulti() and asTuple()
There are doubts that the implementation would result in a huge
template bloat. Also, compareThreeWayMulti() seems to be inefficient,
because it copies the tail over and over again.

Rewrite the comparison helper functions to get rid of the
compareThreeWayMulti() calls. This also allows us to drop the asTuple()
method.

Amends ece36a7394594ede3fba6744fb8f5b450a477652.

Found in 6.8 API review.

Change-Id: I8be4e5f56c350039acde78c2e591e29773f3472c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 564f2cbbddbca3f118198f0fb4ca0a97b95b8a59)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-19 19:42:55 +00:00
Eskil Abrahamsen Blomfeldt
aa9a991169 Respect QTextDocument::defaultFont() in ODF writer
The ODF writer would ignore the default font set on the document
and just output default values according to spec, such as "Sans"
for the font family.

With this patch, any settings set explicitly on the default font
will be taken into account, granted that they are not overridden
by any properties in the QTextCharFormat.

[ChangeLog][Text] The ODF backend to QTextDocumentWriter will now
respect the default font set on the QTextDocument.

Fixes: QTBUG-124570
Change-Id: Ia937420f7f721bbf3264661160cb0a593907358c
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 77a9a208227ecf750d620b3048053fd4fc4299a4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-19 19:42:55 +00:00
Morten Sørvig
9313c60cd9 wasm: fix compile error due to EM_BOOL type change
emsdk 3.1.62 changes the EM_BOOL type from int to  bool. We were
using int in two places in the wasm platform plugin.

Use EM_BOOL instead to stay compatible with emsdk editions earlier 
and and later than 3.1.62

Pick-to: 6.7
Change-Id: I837e76f869225859643dd5a98a28a1eefb5f14a4
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Reviewed-by: Even Oscar Andersen <even.oscar.andersen@qt.io>
(cherry picked from commit 48beca4e7635cf2031c6707042d623c4daf44778)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-19 19:42:55 +00:00
Alexandru Croitor
1bd96b5f40 CMake: Read CPEs from attribution files when generating SBOMs
Also split up the CPE handling to allow for more values to be set,
rather than preferring the first one that is encountered.

Task-number: QTBUG-122899
Change-Id: I3209cb5d66f5483c7294b40816431d9df75e00e5
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 47fd38be4bce0958fcfce8080d1580c4e3c2a15b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-19 11:47:53 +00:00
Alexandru Croitor
c33e213a6a CMake: Read UpstreamPURL from attribution files when generating SBOMs
Task-number: QTBUG-122899
Change-Id: Id65770cdee17c6bf4701b10565ab428f3e28887f
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 95b7fe49900904d19fca21876c84f97c2a6ae03d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-19 11:47:52 +00:00
Alexandru Croitor
ba4172d0d7 CMake: Rework SBOM PURL handling to handle multiple values
Using a single PURL for a target is not enough to represent all the
information that an SBOM processing tool might want to know about.

For example for the bundled harfbuzz package, we want to inform at
least about two versions: the upstream version that was originally
imported into Qt sources, and the Qt version or sha1 of the sources
that were used, because the 3rdparty code might have been modified and
there might be new Qt-specific vulnerabilities.

To handle this, we need to generate multiple PURLs for a single
target.

Introduce six new options to be understood by qt_internal_add_module
and other SBOM functions:
 - PURL_QT_ARGS
 - PURL_MIRROR_ARGS
 - PURL_3RDPARTY_UPSTREAM_ARGS
 - PURL_QT_VALUE
 - PURL_3RDPARTY_UPSTREAM_VALUE
 - PURL_MIRROR_VALUE

The first three options take multiple arguments, and will generate a
PURL for each used variant, based on the purl parsing options that
were previously handled. For example passing:
  PURL_3RDPARTY_UPSTREAM_ARGS
      PURL_TYPE "github"
      PURL_NAMESPACE "harfbuzz"
      PURL_NAME "harfbuzz"
      PURL_VERSION "v8.5.0" # tag

will generate a PURL pointing to the upstream harfbuzz repo hosted
on github.

The next three options allow specifying a purl value directly as a
single string, rather than as separate parts. This might be useful
when the PURL is pre-constructed and read from a qt_attribution file.
Example:
  PURL_3RDPARTY_UPSTREAM_VALUE "pkg:github/harfbuzz/harfbuzz@v8.5.0"

When no arguments are specified, targets like Qt modules or Qt
3rd party libraries will have automatically generated QT and MIRROR
variant PURLs that point to code.qt.io and github.com, along with
important info like the version and subdir source path for a given
target.

Third party libraries are expected to be manually annotated with a
3RDPARTY_UPSTREAM variant PURL that points to the original upstream.
In a future change, these will be read from a qt_attribution.json
file.

The final set of generated PURLs for the harfbuzz package might look
like:

  pkg:github/harfbuzz/harfbuzz@v8.5.0
  pkg:github/qt/qtbase@5018b71e99f?library_name=BundledHarfbuzz#src/3rdparty/harfbuzz-ng
  pkg:generic/TheQtCompany/qtbase-BundledHarfbuzz@5018b71e99f?vcs_url=https://code.qt.io/qt/qtbase.git@5018b71e99f&library_name=BundledHarfbuzz#src/3rdparty/harfbuzz-ng

Additionally a few more purl parsing options are added.

Add a PURL_USE_PACKAGE_VERSION option that will use the
qt_attribution.json or custom PACKAGE_VERSION value as the PURL
version, so it doesn't have to be manually specified.

This is an opt-in, and not the default, because some attribution
files contain plain text, white-space separated, strings as the
version value (like the 'sha3' 3rd party lib) which ends up generating
a broken PURL and a failing JSON conversion of the SBOM.
So we have to manually annotate targets that should use the
attribution json package version, until a better way to handle this
can be found.

Add a PURL_VCS_URL option that will generate a PURL qualifier (a HTTP
query parameter) with the given value, to indicate to SBOM-processing
tools what is the upstream repo URL for the package.
They can use this information to display known vulnerabilities for the
package hosted at that URL.
This is mostly useful for the generic QT purl variant, and is
automatically generated for Qt entity types.

Task-number: QTBUG-122899
Change-Id: Ie000b01b478bef4bff6f4803dd39e37b7a8055d5
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit f7e1123620b623be0c321b54eaba7a1d618a7ce1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-19 11:47:50 +00:00
Alexandru Croitor
bb26830b3c CMake: Detect 3rd party header modules during SBOM generation
They should inherit the version of the 3rd party library they are part
of, and not be treated as Qt modules.

Task-number: QTBUG-122899
Change-Id: Ibf99f4481fbc1acca488fc96cca048298b080d35
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit b17dfbbb992b1d38d7a1aeb2b0109bab9cb1e4e3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-19 11:47:49 +00:00
Alexandru Croitor
1ddf6ea20b CMake: Propagate SBOM options to auto-created attribution targets
Previously if an option like CPE was passed to a 3rd party target that
would create nested attribution targets, one per entry in the
attribution file, the CPE option would only apply to the first /
parent target, but not to the nested targets.

This change will now propagate all SBOM options to the nested targets,
but only if the parent target is not a Qt entity type like a module,
plugin, etc, which means it will only apply to 3rd party attribution
targets. The restriction is there because because mostly only 3rd
party attribution targets should inherit the same set of CPEs and
similar SBOM values.
If the restriction proves to be too strict, it will be re-assessed in
a future change.

Task-number: QTBUG-122899
Change-Id: I96cfa046ad611c10877b7a06504b35615b539bbe
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 5daabb5a74c4e7c5d087da7f9207d79d2ee05b13)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-19 11:47:47 +00:00
Alexandru Croitor
e17115b0c6 CMake: Expose the short git hash during SBOM generation
Task-number: QTBUG-122899
Change-Id: Id87afba7bce4d67984c7e8811444fd35be758bec
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 3e7fc98063f123d5e2925d47f9278c40535ee452)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-19 11:47:45 +00:00
Edward Welbourne
389aca9b71 Correct Arabic exponent separator in QLocale benchmarks
The separator was changed at CLDR v44 to use a plain aleph, U+0623,
rather than the U+0627 aleph with hamza above previously used. This
is, in both cases, followed by U+0633, "seen".

Task-number: QTBUG-121325
Task-number: QTBUG-126060
Pick-to: 6.7 6.5
Change-Id: I013525e0876c4c47111846135c9311e7b3442dd3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 45ec096672a67db01d29f78e7e910bebab36e31b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-19 11:27:06 +00:00
Edward Welbourne
6cc95e1d92 Add QTZ::displayName() benchmarks
Task-number: QTBUG-115158
Pick-to: 6.7 6.5 6.2 5.15
Change-Id: I7465a19f6003cfae7507d798fadeab22bf1b118d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 01acb888e0f9f06cac07d69d8c934eac9d32daf3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-19 11:26:52 +00:00
Edward Welbourne
c8d7f1a5ec tst_QLocale: remove duplicate fromScriptLand_data() data rows
Pick-to: 6.7 6.5 6.2
Change-Id: I78ceb053d73fcf22deff7258a349a8ec22e7ad3d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 9dab0aecc078224e807fa0625a08fb92c9a7b58e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-19 11:26:33 +00:00
Andre Hartmann
bc1011dc36 Doc: Use consistent terminology in Q(Chrono)Timer's docs
Unify the wording "running" and "active".

"Running" seems more natural, so keep that wording,
and replace "active" with "running" in API docs.

Change-Id: I300f530d1cfe789f74ed32f57afe9388f2127ead
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 94f87d6d65f42140dbf58b8c6badd1a4c61c8c76)
2024-08-19 11:11:04 +00:00
Wang Yu
04f3381f11 Fix the crash of test case authentication required
Empty transfer is caused by using its password,
resulting in a crash

Pick-to: 6.5
Change-Id: I2b208ce48b5abc2adea3278d875f3005cda77a8b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 8143e85bb4706799f9275c25b2caf72b22b457a4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-19 04:04:18 +00:00
Ville Voutilainen
1079d210d1 Fix an evaluated use of std::declval in qjnitypes.h
While other compilers don't seem to have trouble with this, the latest
NDK (27) compiler does. That compiler diagnoses the empty-pack case, even though in that case there is no actual use of declval, as the pack-expanded expression contains no use of declval.
For other compilers, that may work for functions that have no arguments, but will not work for any function that does have arguments; in that case, the attempt to use declval will always be ill-formed, and there will be an attempt to use declval.

The fix is straightforward; we have a Ret(*)(Args...), its return type
is simply Ret. So use a simple trait instead of the result of a call.

Task-number: QTBUG-127468
Change-Id: I0dc9e1201914ab94acc2940870be7c6d8cb16c12
Pick-to: 6.7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 236c6ec6f4c777d0534539f1c293cfc74006a6eb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-19 00:50:16 +00:00
Marius Kittler
a75b432c8a Fix QCommandLinkButton in Windows 11 style when darkmode is used
Fix polishing QCommandLinkButton in Windows 11 style: The condition
for QCommandLinkButton needs to be checked before the condition for
QAbstractButton; otherwise it is never entered and the colors from
the Vista style are used breaking darkmode.

Pick-to: 6.7
Change-Id: Ie9e1c20b38a52b2d72f28279e38deb533595b974
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
(cherry picked from commit a17c34d2b7ef8391e5485d0ba06966ece793d184)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-18 21:57:52 +00:00
Christian Ehrlicher
328a2642dd QLoggingRegistry: Misc fixes
Fix the name of the env var in the debug output for QT_LOGGING_CONF
and adjust the documentation to not suggest to add quotes around the
value of QT_LOGGING_RULES as this will not get properly parsed.

Change-Id: I2da4f841c42c6af6e73d09f19d9baada3582bcd1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 753d035e152f0572ba99717d04116a882a506bef)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-18 20:29:09 +00:00
Marc Mutz
2f8d5ea487 QUuid:: fix UB in (Id128Bytes) ctor
After qbswap() has run, the Id128Bytes active member is data64, yet
the rest of the QUuid constructor accesses .data. This is UB.

Use the void* dest overload of qbswap() or memcpy() the Id128Bytes
into a char buffer and consume data from there instead.

Amends 686c02224c03735356bdab987bf62644eb34cc34.

Task-number: QTBUG-120637
Pick-to: 6.7 6.6 6.5
Change-Id: Iba62a692391a5600b867c30dcb3bc50b82ee072f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f5b7e8a3fbc27082651b8eda08f1fe4ff7d70f3f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-18 19:35:03 +00:00
Andre Hartmann
68326ad432 Doc: Clarify setInterval() and start() for active timer
Despite using different code paths, both stop and then
re-start an already active timer, which invalidates
the id().

While at it, port the occurrences of timerId() to the
modern function id(), which exists in both QTimer and
QChronoTimer

Change-Id: I5db099b198b1c11e1cdbd0fbb30ecece5d0135c8
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit ea0f8cee55e56d0f03ea9a185faee328b5cfa7bf)
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2024-08-18 20:14:53 +03:00
Thiago Macieira
5f46669178 QMimeData/Docs: include the fact that some functions may convert
QMimeDataPrivate::retrieveTypedData() converts if the target MIME type
is text/plain or if the target meta type is QByteArray.

Fixes: QTBUG-127296
Change-Id: I4878533dcb2d4b3e8efefffd17e49ade9fbb32f8
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 05aaf2a684e49d6034f3860fb55a70e75de61e49)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-18 00:44:20 +00:00
Ahmad Samir
9c64b6a201 Q{Chrono,}Timer: de-duplicate API docs
Change-Id: Ib88d89e5f8dae4a834467c05e2e5fa6983e7cd76
Reviewed-by: André Hartmann <aha_1980@gmx.de>
(cherry picked from commit 46b8da642b9016c84d0cba12dab9bae3fba24ae4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-17 22:19:05 +00:00
Michael Weghorn
32b0ff2124 a11y atspi: Map QAccessible::Border to AT-SPI2 panel role
Instead of mapping QAccessible::Border to ATSPI_ROLE_FRAME
("A top level window with a title bar, border, menubar, etc." [1]),
map it to ATSPI_ROLE_PANEL ("A generic container that is often used to
group objects."), as widgets using that role (in particular QFrame)
are not top-level windows, but rather containers for other widgets.

[1] https://docs.gtk.org/atspi2/enum.Role.html#frame

Fixes: QTBUG-127552
Pick-to: 6.7 6.5
Change-Id: I565793b6e02903402cfc764e2e38d391a2960af1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit a19d66385fc9fa13ce5ee811386ad104c0718941)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-17 18:11:00 +00:00
Mårten Nordheim
699f722789 http2: delete byte device without deleteLater
If we own the byte device we can just delete it directly when we are
done with it.

Change-Id: I9da99943ff61925f6f5416df403bcd747c2558d5
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
(cherry picked from commit 4bc878ff4fbacd39d4c0ed1e8e742fd18fa74fed)
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-08-16 17:34:30 +00:00
Marc Mutz
4cb06919aa qfloat16: remove IsIntegral work-around
We now assume that is_integral works for qint128 if QT_SUPPORTS_INT128
is defined, so we no longer need to roll our own version of
std::is_integral.

Amends 0d85d0a72fd0136bd89e201d0cc1bf7fac2c24c8 (which is in 6.7, but
we're only guaranteeing that std::is_integral works for qint128 since
6.8, so not picking all the way).

Task-number: QTBUG-119901
Task-number: QTBUG-117637
Change-Id: I0651f1f17c1abfe4dc2b2d08ae4304fc8dcae092
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit da580a12b10f33fcff5783ca595d1c53b5b8b7de)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-16 17:34:30 +00:00
Marc Mutz
feb43b779a Switch to non-strict C++ builds so QT_SUPPORTS_INT128 is true
A previous commit disabled QT_SUPPORTS_INT128 if the Standard Library
doesn't properly specialize <type_traits> and <limits> for the 128-bit
types, like libstdc++ in strict mode. As a consequence, we now need to
compile Qt in non-strict mode so QT_SUPPORTS_INT128 is true when
building Qt, at least if the compiler supports 128-bit integers in
principle.

Statically assert that QT_SUPPORTS_INT128 is defined if the compiler
in principle supports it, to catch other problematic platforms early.

We have a few out-of-line implementations that should be built if the
compiler supports int128 in principle, so that Qt users are free to
use the types if their compiler supports them and not run into missing
support in the Qt library. This patch ensures this.

Compiling in non-strict mode removes the early warning we were getting
from it, but a) headersclean still uses strict mode, so at least our
headers are regularly checked and b) this is a cross-platform project;
if we were to use platform-specific extensions unprotected, other
platform's compilers will still complain.

Fixes: QTBUG-119901
Change-Id: I974f95ca0f26085dd0fe5ceb8bbef4f62467979a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 30e04340dac26ebd09f9bc8ceb598e873ab63ba7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-16 17:34:29 +00:00
Marc Mutz
7805b3c32f Only define QT_SUPPORTS_INT128 if type_traits work for them
It turns out that libstdc++ in -ansi mode defines __SIZEOF_INT128__,
but not the corresponding specializations of <type_traits> and
<limits>. This has caused numerous pain points over time, esp. since
is_signed doesn't work, so qt_saturate e.g. can't be used on qint128
inputs e.g.

After another such issue (cmp_equal()), we decided to require
<type_traits> and <limits> support for extended integer types in the
stdlib, or we will disable Qt's support for it, too.

So check that if QT_SUPPORTS_INT128 is defined, is_signed_v,
is_integral_v and numeric_limits work, too. Disable QT_SUPPORTS_INT128
when compiling with libstdc++ in __STRICT_ANSI__ mode (-ansi or
-std=c++NN instead of (the default) -std=gnu++NN).

[ChangeLog][Potentially Source-Incompatible Changes] Qt's support for
128-bit integers (qint128/quint128) is now conditional on support for
these types from the Standard Library, in particular <type_traits> and
<limits>. Qt no longer tries to work around missing Standard Library
support. As a consequence, e.g. GCC -ansi and GCC -std=c++NN (instead
of -std=gnu++NN, the default) builds will now no longer support these
types.

Task-number: QTBUG-119901
Change-Id: I8529e72a52a2f5da0f469bae543688e18220255f
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 9bb2ab5978625eee96f703871d5eca8e54b31386)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-16 17:34:29 +00:00
Marc Mutz
073fed11e8 Don't rely on qdoc running on a QT_SUPPORTS_INT128 platform
Make the typedefs (and functions using qint128) visible to qdoc,
always.

Amends befda1accab417ce5f55cb11816e6ded51af55e3.

Pick-to: 6.7
Change-Id: I7743b130a87033bf6d8cac317d6c5e9ea09f845a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit e4a0a2fe8d5cd468a3dde46d6bdcdf8c5b0a9804)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-16 17:34:29 +00:00
Marc Mutz
caf57f0ca3 tst_QGlobal: add a build of this test in strict mode
This is in preparation of adding some static assertions here that we
need to have evaluated in both "normal" and "strict" mode, namely
<type_traits> and <limits> support for qint128.

But this change is more general, so making it a separate change.

Turns out we already have (non-static) assertions here about <limits>
support for qint128. These force us to define precisely when
GCC/libstdc++ has gained <limits> support for __int128_t: the
timestamp of the __GLIBCXX__ macro is the Daily Bump immediately
preceding the gcc commit that fixed <limits>
(gcc/8eb9a45e87bdb81cb44948c651edee846c622a0f).

Let's hope no-one is running the prerelease version of GCC 10.3 from
that particular day, otherwise these might become XPASSes. But just
not testing is also wrong; we want to be informed about True Positives
and Negatives here.

Task-number: QTBUG-119901
Pick-to: 6.7 6.5
Change-Id: I6f9be047f846fff74133c466c5bed40d0039d60f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit e7c54248987d474cff9f49cad502822eb9dcb114)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-16 17:34:29 +00:00
Christian Ehrlicher
ae7ca75995 SQLite: Update SQLite to v3.46.1
[ChangeLog][Third-Party Code] Updated SQLite to v3.46.1

Pick-to: 6.7 6.5 6.2 5.15
Change-Id: Ibf82bf1612724e32e5f31a6aa561c2a74a13ec68
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit dcc49d20a866142cec11d2483024045df0f28a61)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-16 17:34:29 +00:00
Christian Ehrlicher
19706de70e QPA/Windows: Avoid confusing warning about empty QPixmap
Fix the condition to really don't call scaledPixmap() on an empty
pixmap.
This amends db328ca975bc63f3baf3d021dcff1ea37fa6b6a0.

Pick-to: 6.7 6.5
Task-number: QTBUG-122755
Change-Id: I10470704fff162f699a936f7b61451c02e3bf4e9
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit c1d2de095e420315c626fc08d6d6a5e2a34a1870)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-16 17:34:29 +00:00
Joerg Bornemann
1ec258dfb4 Ignore QT_WIN_DEBUG_CONSOLE for console applications
On Windows, the windeployqt tool failed if QT_WIN_DEBUG_CONSOLE was set
to "attached", because the following happened:
- windeployqt calls qtpaths
- qtpaths attaches to windeployqt's console
- qtpaths' output goes to that console
- windeployqt cannot read qtpaths' output anymore

Other Qt-based command line tools are also affected.

The QT_WIN_DEBUG_CONSOLE environment variable was introduced to see
output from Gui applications on the console. It should not affect
console applications.

We now determine whether the current process was linked with
/SUBSYSTEM:CONSOLE and ignore QT_WIN_DEBUG_CONSOLE's value in that case.

Fixes: QTBUG-127732
Pick-to: 6.7
Change-Id: Iba7031eed88c7b38cfe3e794c1885b504e4f2ee4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Zhao Yuhang <yuhangzhao@deepin.org>
(cherry picked from commit cef270265fd9bd299e2fe5bb45a7c14002cfe1bf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-16 14:36:02 +00:00
Orkun Tokdemir
b856d2f248 windeployqt: deployWebProcess: Copy QtWebEngineProcess.exe to --libdir
When the executable is deployed using the CMake deployment API, `QtWebEngineProcess.exe` should be copied into the same folder where the deployed project executable is, which is 'bin'.

https://doc.qt.io/qt-6/qtwebengine-deploying.html#deploying-qt-webengine-processes

In the previous implementation, the `--dir` argument is used as the
target directory. This commit changes the target directory for
`QtWebEngineProcess.exe` from `--dir` to `--libdir`.

Pick-to: 6.7
Fixes: QTBUG-126572
Change-Id: I07abfc789d439ac66a9ff2706de52a05d80e9b51
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit e56d98cea0c422827cd72c6cb4d7ee43143d5bac)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-16 11:36:20 +00:00
Eirik Aavitsland
12bca46996 Remove inline downscaling in png reader
In Qt 5.0 timeframe, support for downscaled reading was added to the
png handler, as a help for devices with very limited memory. Instead
of decoding the whole image into memory and then scaling it down (as
happens for most image formats if scaled reading is requested), a
separate reading function was added that would perform line-by-line
decoding and downscaling.

Although this provides a transient memory saving during decoding, it
has a number of drawbacks:

- The scaling routine is simplistic and can create artifacts for
  images with transparency, ref. the linked bug report

- The scaled result from the png handler is in general different from
  the result of using the common QImage smoothscaling function

- The line-by-line scaling function is generally slower than the
  common smoothscaling function, since the latter is optimized using
  SSE/NEON extensions

- It adds a redundant implementation of image scaling to the code base

Hence we drop this functionalty going forward. This effectively
reverts 44a9c08eff0647f398863de55e2b62dbd6541e27.

[ChangeLog][QtGui][Image I/O] The PNG handler no longer implements
progressive downscaling during decoding when scaled image reading is
requested.

Fixes: QTBUG-121724
Change-Id: I7b524b12c174c64201b98945ee2fa062ed127f87
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit a2a315eaa28edf9c649e13c951fdb1154e3ddf48)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-16 06:49:53 +00:00
Tor Arne Vestbø
71e77398bb tst_qhighdpi: Write screen config to temporary directory
Instead of build dir, where it can clash when multiple tests runs
are being done from the same build dir in parallel.

Due to the way platform plugin argument parsing works we can't
pass the full file name of the config, as on Windows this would
include C:, which QGuiApplication will split into two, thinking
they are two different platform plugin arguments.

Instead we chdir into the temp dir, and create the file there,
passing the file name as a relative path as before.

Change-Id: Ia4ea82280e35f4f52b7de74bbf53b2a48ecbaecd
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit fd68f894b969b016201e032ba23dac431c19b90a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-15 08:37:32 +00:00
Volker Hilsheimer
b361fd6021 QPdfOutputIntent: Remove noexcept from copy member functions
Found during header review, and following status quo in existing APIs.

Task-number: QTBUG-125859
Change-Id: Ib8004dd7fc4f22973be83b45f172003de20d5f90
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 7bcd33fe097925e640f3270f669c3a9a1a30afd1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-15 06:24:50 +00:00
Lorn Potter
53c0dad37a wasm: fix example code correct useage of toEcmaUint8Array()
Pick-to: 6.7
Change-Id: Id20ec88df500cb7209ce294fdee28e0244f1d580
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit b9ee93fa56a6313bd7d6ea9dcf479783605978b1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-15 05:11:27 +00:00
Lena Biliaieva
88ae8785ef QHttp2Connection test: silence conversion warning
Follow-Up to: 6aa1cb05e357cf4221aaedd4cf742c45983af446

Change-Id: Ie355c2813f38aa6097fe3bbcdd1f021fd1f0d791
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
(cherry picked from commit 4a44a8a8a5768b3ffaa3cb00f995bfee792ca5c2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-14 12:20:34 +00:00
Tim Blechmann
606f7af1d2 Tests: rename stenciloutline to tst_stenciloutline
`stenciloutline` clashes with the example of the same name in
qtquick3d/examples/quick3d/extensions/stenciloutline.

Prefixing the test target with tst_ to fix the name clash.

Fixes: QTBUG-127981
Change-Id: I23026523d34abeb09f083e3186273120551bc6c4
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 70b431345e00f78fe0f77b92ca86c859c818eceb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-14 11:20:48 +00:00
Eirik Aavitsland
940ba11f8c Fix crash in font distancefield computation
If setting a larger-than-default distance field base font size
(renderTypeQuality in qml), an exceptionally large glyph could cause
integer overflows in the distance filed computation, causing asserts
or crashes.
Change the computation types to avoid the overflow.

This improves on b6f962c87f5084eaf962bfb033b1398f80475120.

Fixes: QTBUG-124310
Pick-to: 6.7 6.5 6.2 5.15
Change-Id: I48b7dc3c0a0f35859d45c40d03498ac057e9fa70
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit 30a753944300c13e96f9239a9891cbc8e2e378c1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-14 09:49:24 +00:00
Timothée Keller
65a1e71700 Windeployqt: fix exclusion option for Internal modules
The "Internal" suffix was added to module names, but only in the help
text and not in the option's name. Change this by adding the "Internal"
suffix to the option name in general, rather than just the help text.

Fixes: QTBUG-122774
Pick-to: 6.7
Change-Id: Iaffcde4768a8bf70ba4b8e52cec4ea6490e20bfc
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 7c218d20aedd8aaf2c0f2b6954ac400902ae040b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-14 07:36:25 +00:00
Christian Ehrlicher
a053dc51d5 Fusion style/QScrollbar: use correct arrow rect
Pass the correct arrow rect to the draw arrow function. This amends
0ef5d5dba3e23224c372be9c9f1144c8a73b6a49

Task-number: QTBUG-127104
Change-Id: I78392fb112a0dbf9ac4e034a4dbdc91077b59d24
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 161015d29f9af500d9c3899f9a6aea26f9ca1827)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-13 21:25:53 +00:00
Christian Ehrlicher
e7c7402802 SQL/ODBC: Fix calling SQLGetData() for old drivers
Some old drivers don't return SQL_NO_DATA when all data was fetched
which resulted in an infinite loop. The previous check does not work
when we receive chunked data and the driver returns fewer bytes than the
maximum buffer size.
Therefore simply check for SQL_SUCCESS since according the msdn docs,
SQL_SUCCESS_WITH_INFO must be returned when there is more data to fetch.
This also avoids an additional call to SQLGetData() here.

Pick-to: 6.7 6.5
Fixes: QTBUG-119753
Change-Id: I42ed194f3955a650e63615615fe82d785f324228
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-08-13 17:39:40 +02:00
Ivan Solovev
c197fefb22 Qt::totally_ordered_wrapper: do not allow operator*() for void*
Disable operator*() for void* type, because it otherwise causes
a compiler error:

  qcomparehelpers.h:1103:18: error: forming reference to void
     constexpr T& operator*() const noexcept { return *get(); }
                  ^~~~~~~~

Use this as an opportunity to add more tests for operator*().

Amends ece36a7394594ede3fba6744fb8f5b450a477652.

Change-Id: I205b9989bd142ca9aa49f8f4d15854e591e3042b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 053b8ff7fedfe5aed29a91a82569c00cac466e9a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-13 12:56:19 +00:00
Lucie Gérard
74e50e224f Correct tests license
According to QUIP-18 [1], all test files should be
LicenseRef-Qt-Commercial OR GPL-3.0-only

[1]: https://contribute.qt-project.org/quips/18

Task-number: QTBUG-121787
Change-Id: I0a35709284c4b6e7d080f41f361a9adea1415ca0
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
(cherry picked from commit 334a92ecb86fb89a65091bb4c230431eeb0fa587)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-13 12:56:14 +00:00
Ivan Solovev
9dfddeb913 Comparison helper macros: drop the check for noexcept
Now when we explicitly have the _NON_NOEXCEPT version of the macros,
and a static_assert() in the "normal" macros, it does not make sense
to have these checks in the helper functions. If the developers choose
the _NON_NOEXCEPT macro, they clearly know what they are doing.

So simply drop the check and get rid of the annoying XFAILs in the
test log.

Change-Id: Id467ae5ad6a852da7c39dd1dbf32ce5838e69ecc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 80bc0152448fbd4a57a4c95147e7b3f067e6a35c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-13 12:56:13 +00:00
Tor Arne Vestbø
7fa3737552 QMacMimeRtfText: Remove stray newline when converting RTF to HTML
NSAttributedString wrongly inserts a newline at the end of the string
when generating HTML from RTF. The rules for HTML parsing specify that
this newline, after the closing </html> tag, should be treated the same
way as if it had been part of the body.

  - https://html.spec.whatwg.org/multipage/syntax.html#start-tags
  - https://html.spec.whatwg.org/multipage/parsing.html#the-after-after-body-insertion-mode

This results in an additional space character if the HTML is converted
to a QTextDocument by QTextHtmlParser, for example when inserting text
from another application via the clipboard or drag-and-drop.

Pick-to: 6.5 6.2 5.15
Change-Id: If17cfcdc9ad5452e7b516fc6b50d834bd5184e23
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
(cherry picked from commit 3dceef8e23787d3aded207e4f6ca554de4a1c2d4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-13 12:08:28 +00:00
Tor Arne Vestbø
eeb0740f2e QTextHtmlParser: Handle fractional font-size pixel values
The CSS spec defines the font-size as being a length, which is a
combination of a real number and a unit. This applies to the 'px'
unit as well, so by treating px values as integers when parsing
we were failing to parse not only '12.5px' but also '12.0px'.

The code now uses QMetaType::fromType<qreal> but then sets the
resulting pixel type on the QFont as an integer, as QFont does
not support fractional pixel sizes.

Other code paths in the CSS parsing machinery use QString::toInt(),
either directly or via intValueHelper() or lengthValue(). The font
code path can potentially be ported over to these other APIs for
consistency, but to keep the patch simple this is left for a
follow-up.

Pick-to: 6.5 6.2 5.15
Change-Id: I972cfe0f3fa3c785efa18c7593d6a497ff28911c
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit 5731e3e185d3a69502b2bc4f1fee48c156b34c3c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-13 12:08:27 +00:00
Tor Arne Vestbø
893a882151 Bump accepted Apple OS SDK versions
We've tested building with these SDKs, and things generally work, so
no need to issue a warning for them.

Change-Id: Ib5775034962165c46b877e37b386ca71db97e1a6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit f75841fb8fc90921b60169fe66b24b80e6775a00)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-13 06:47:51 +00:00
Tor Arne Vestbø
75f798129a wasm: Only show resize border if direct parent window enables it
A top level window with a window frame will have the has-border class,
and hence a resize border, but child windows of that window shouldn't
have their own resize borders.

Ideally we wouldn't generate these non-client-area elements for child
windows, but changing that requires more work, as it involves creating
and destroying these elements on the fly if a window goes from being
a child window to a top level and vice versa.

Change-Id: I64ec27d87df952419284354b50420df8e48824d8
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
(cherry picked from commit 9322f80c3cde118aec803e6b2c86197b1b5dbb67)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-13 06:47:43 +00:00
Tor Arne Vestbø
7017dc6d37 wasm: Re-evaluate window flags when reparenting window
We apply CSS classes to the qt-window in setWindowFlags based on
whether it hasFrame(), hasBorder(), etc. Which in turn depends on
whether the window is a top level or child window.

As a QPlatformWindow may be created while a QWindow is top level,
and then reparented into another QPlatformWindow, we need to update
the window flags, and re-sync the CSS classes, as otherwise we end
up with child windows with shadows and tile bars.

Change-Id: Ibbb3d2230a880057053d7b12f93257d9b250aa6f
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
(cherry picked from commit e6db07c4e7cca41a94dd787d9a4938abab7918ac)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-13 06:47:18 +00:00
David Faure
2b50551923 QIdentityProxyModel: add setHandleSourceDataChanges(bool)
Some sub-classes have special handling of source model data changes,
they relied on disconnecting the connections to the _q_*layout* slots
in the private class using the SLOT macro. This isn't possible any more
after the recent port to PMF connects.

Sub-classes resorting to using private API is a clear sign some
functionality is missing from the public API, so a cleaner solution for
this issue is adding this setter which enables sub-classes to tell
QIdentityProxyModel to leave handling of the dataChanged signal to them.

Similar to commit 675b4f63feab7c81c75e49f6dea82a39dd18f489 (but
this should be the last one needed).

[ChangeLog][QtCore][QIdentityProxyModel] Added
setHandleSourceDataChanges(bool) method to allow sub-classes to
indicate to QIdentityProxyModel that they will handle source model
data changes on their own. Also added a getter,
isHandleSourceDataChanges().

Task-number: QTBUG-127959
Change-Id: Id8f567c330e4ee834940a62b6497d8cbb8ba4a46
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 5a31800d41273a14436c543438a142562f74f857)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-12 20:18:41 +00:00
Allan Sandfeld Jensen
4ba6cd2dcd Fix HDR colorspace transforms for non-SSE2/non-NEON
Task-number: QTBUG-127646
Change-Id: Ie3eab7b7e07155a0e9f70455c8e33f308f7b84d1
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 8e942c9d704376232d8a5437f861174709a26600)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-12 20:18:41 +00:00
Ivan Solovev
a83d113f66 Fix partial_ordering::unordered != 0 comparison
The standard does not provide any details on implementing operator!=(),
because it relies on the fact that it will be synthesized by the
compiler.

Our C++17 implementation, however, has to provide operator!=(), and we
made the mistake of copy-pasting the implementation from other
operators.
However, the isOrdered() check does not make sense for operator!=(),
because an unordered value is never equal to literal zero.

Fix the implementation for both Qt::partial_ordering and legacy
QPartialOrdering.

Amends 405244fe301ac18d20aae245ba2faafaec74e453 (for QPartialOrdering)
and bdd41f491c0f85ae0897a1c7372c5ecda62a5aab (for Qt::partial_ordering).

[ChangeLog][QtCore][QtCompare] Fixed a bug where
partial_ordering::unordered != 0 comparison produced an incorrect
result.

Fixes: QTBUG-127759
Pick-to: 6.7 6.5 6.2 5.15
Change-Id: I5008f72831c17dc7fa4ae181bfc8115198a691f0
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit d39441a2eb5658f3d4a01046c592adb827525118)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-12 20:18:41 +00:00
Ivan Solovev
247ec89cc5 Test partial_ordering::unordered != 0 comparison
... and figure out that it does not match the std implementation.
Fix will be provided in a follow-up commit.

Task-number: QTBUG-127759
Pick-to: 6.7 6.5 6.2 5.15
Change-Id: I51c4f086af531a81a6aae03f3462972437d41f97
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit fed1099ad2909cb8e75477e60e0a8b41db3f58d0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-12 20:18:41 +00:00
Tor Arne Vestbø
79be5fa986 Make QWidgetPrivate::setVisible virtual
Initially the function was used as a helper function for QWidget,
implemented in da55a1b04121abd44d9c72e0c7cba7d72f16d4f2. But with
e0bb9e81ab1a9d71f2893844ea82430467422e21 we started overriding it
e.g. QDialog. This "worked" because QDialog itself would call the
private helper, but left a footgun when called via a plain QWidget
pointer, as we did in 5ba0982b2879a1a4c13bf97467b8e5ad296e57a2.

That specific instance of the problem was solved by the change in
fc4c6fb5f6bd6bd63b13f1f8b5b7a7289a5fd230, but the trap still exists.

To ensure we can use the function in a polymorphic context in the
future we make it virtual.

Task-number: QTBUG-127806
Change-Id: Ic0810c5439b1e696cfbf199e701f41217acc5742
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 1a0f056f318417ba5e54c8110257b75cf5537acb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-12 17:26:50 +00:00
Alexey Edelev
5a795793eb Prohibit the use of fontconfig feature on Apple platfroms
The feature is noop and is broken on Apple platforms. The obvious
solution is disabling this feature there.

Fixes: QTBUG-116083
Pick-to: 6.7 6.5
Change-Id: Ife4d101c70310aba8a2743d0364397b67d0a887f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit ccdeb2cfaf1e67cb9ba936cbe577025ed784717f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-12 17:26:50 +00:00
Thiago Macieira
7a250d9d67 QByteArray/QString: don't unnecessarily use QArrayDataPointer::operator->
The operator->() function casts *this to QArrayDataOps, a type that
*this technically isn't. This has been harmless since forever, but is
technically UB, and does prevent using these functions in a constexpr
context (something we can't do yet, but will in 6.9).

Change-Id: I398f9e3d83d44f198a69fffd17e26fc8cd9a572f
(cherry picked from commit ffbb585f6fa5e97aee81387f275342b049ba7d9c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-12 10:26:50 -07:00
Alexandru Croitor
fe200fb713 CMake: Use lowercase project name for skipping tests and examples
Previously one had to specify names like 'QtSvg' to -skip-tests
and -skip-examples, but this is not the same behavior as what
the -submodules and -skip options expect.

To keep it consistent, change the code to consider only the lower case
names.

Amends 25b89f2c88cdfc98bfa462949531a33f7ef50996
Amends 7c9efdf40c9d9f7f89f7a9be0c06e0d3ec54ec2c

Pick-to: 6.7
Fixes: QTBUG-127857
Change-Id: Ie80edb98ce16b6835fe361198953e36b8255102a
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 34f127834c2d83517687522b5725f6a67f67bad2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-12 17:26:49 +00:00
Orkun Tokdemir
c7a9c813fe CMake: qt_add_ui: Add sources to target_sources
* Add a new test combining with qt_add_resources
* Remove redundant ADDITIONAL_ARGS string modification
* Correct comments

Change-Id: I9b76a4d01705be3d80cc6386fbadb0b6f706a537
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 442cac6dd412559fa25d1782bda4ad60ee99dc81)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-12 17:26:49 +00:00
Joerg Bornemann
e2c02c5b20 CMake: Fix qt_add_ui for CMake 3.16
qt_add_ui failed for CMake 3.16 and the Ninja generator on Linux,
because it generated empty commands like
   ... && "" && "" && "" && ""
for targets that don't have AUTOUIC set.

Adjust the generator expressions for those commands to generate the
"cmake -E true" command instead of the empty string.

Change-Id: I03c9eb2e8f14685bccadf4eb74f309bcf152c01b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit e98517564fa0a87ff030deb1cb05ec51aa231294)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-12 15:03:28 +00:00
Alexei Cazacov
7c1e2072f5 Docs: Fix a typo in QRhiTextureRenderTargetDescription
Fixes: QTBUG-127403
Pick-to: 6.7
Change-Id: I089896e6abdd095057218adfd63727e65f4d92df
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 934ff5afb533c78f06baad830066473174d2de3c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-12 14:38:19 +00:00
Edward Welbourne
e7db7a68f6 Remove an unfounded assertion, add the test-case that tripped it
The date-time parser, unless it hits a fixed-width numeric field
that's unfilled, leaves checking the date against its configured range
until it's parsed all fields. This means it can be out of range due to
a full-width field when it hits an unfilled one and tries to take the
range into account when deciding whether to zero-pad or expect more
input into the field. So asserting the current partially-parsed
datetime is in range at that point is not justified.

Thanks to Albert Astals Cid for reporting this fiendish corner case,
found by oss-fuzzing of KDE's image plugins, in IRC.

Pick-to: 6.7 6.5 6.2 5.15
Change-Id: Id7db7409a0b5afadafb6920a0785a4cec4c80b62
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Albert Astals Cid <aacid@kde.org>
(cherry picked from commit e0a4de17ddb924d9bf222fb3ea2d0526813edea6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-12 11:26:20 +00:00
Edward Welbourne
88f3fd0f75 Fix #if-ery on QDate::stdSysDaysToJulianDay()
It relies on QT6_CALL_NEW_OVERLOAD_TAIL hence on QT6_ONLY, which is
inactive in bootstrap builds (they're treated as Qt 7). Thanks to
Ahmad Samir for reporting the resulting compiler warning at API change
review.  Amends commit 88702cc87cf830b145c8bff5174748e3719364f9

Pick-to: 6.7
Task-number: QTBUG-125859
Change-Id: I3472d3bd489f16175d04ef6198522b060fa6150a
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 91f48cc4b77b1cfb5a4490c3bed3eb97edd2f85a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-12 11:25:28 +00:00
Lucie Gérard
46ac560d0a Correct license for module and plugin file
According to QUIP-18 [1], all module and
plugin files should be
LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
or
LicenseRef-Qt-Commercial OR GPL-3.0-only

Also, LGPL and non LGPL should not be mixed in a given directory

[1]: https://contribute.qt-project.org/quips/18

Task-number: QTBUG-121787
Change-Id: I3c0d98490a9d0bb45b9801d004e23e7e22ebaa34
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit bc4552963345def94645b74cfd1a7d047e56137b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-12 10:10:26 +00:00
Allan Sandfeld Jensen
9017e95858 Fix ARM NEON detection on MSVC arm64
MSVC doesn't define __ARM_NEON, but neon is a necessary part of arm64,
so will always be there.

At the same time fix the NEON code for MSVC which has a different
idea of what the intrinsics types are, even if all the intrinsic
functions are the same. This has two consequences:
1. Since NEON lacks construction intrinsics except duplication, NEON mask constants needs to be built differently.
2. Since MSVC has all the NEON types aliases of the same underlying type, QSimdNeon cant do the same type based dispatch as before.

Fixes: QTBUG-127646
Change-Id: I8038bb6bb4557e8ce29e3844f2742a97b4489818
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 572aa7caa04e85cbc07b18e1d0c720038facbf83)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-12 10:10:22 +00:00
Lucie Gérard
121639c53e Add exception for build system file licensing
The files are MIT and BSD-3-Clause instead of only BSD-3-Clause
because parts are copied from an upstream source that had them
MIT licensed

Task-number: QTBUG-121787
Change-Id: I5598033e71e97e5da807ab14d63755c05f655980
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 70667f46243e05f21cae31198aaf1662bf698114)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-12 10:10:20 +00:00
Thiago Macieira
c778f11eef QH2Connection: store the BitPatterns as constexpr
Unlike Clang, GCC does not automatically emit them as constexpr with
just "const" declaration.

$ nm -C lib64/libQt6Network.so.6.9.0  | grep -F 'HPack::('
00000000001dc376 r HPack::(anonymous namespace)::LiteralNoIndexing
00000000001dc374 r HPack::(anonymous namespace)::LiteralNeverIndexing
00000000001dc480 r HPack::(anonymous namespace)::staticHuffmanCodeTable
00000000001dc378 r HPack::(anonymous namespace)::LiteralIncrementalIndexing
00000000001dc37a r HPack::(anonymous namespace)::Indexed

Pick-to: 6.7 6.5
Change-Id: I398f9e3d83d44f198a69fffd17e26e30b9bce7ed
Reviewed-by: Lena Biliaieva <lena.biliaieva@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit c607a3894c39a2c5a35e9d474b233637a6f55cc7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-12 09:43:39 +00:00
Liang Qi
9f0c48c6b1 xcb: ignore bigger size window icon when size exceeds limit
In the absence of the BIG-REQUESTS extension, the maximum
request length is only 65535, with DPR=2, a 128*128 icon size
will be (128*2)^2 = 65536, which exceeds the maximum
request length.

See also the official doc for xcb_get_maximum_request_length.

https://xcb.freedesktop.org/manual/group__XCB__Core__API.html

uint32_t xcb_get_maximum_request_length(xcb_connection_t *c)

In the absence of the BIG-REQUESTS extension, returns the maximum
request length field from the connection setup data, which may be
as much as 65535. If the server supports BIG-REQUESTS, then the
maximum request length field from the reply to the BigRequestsEnable
request will be returned instead.

Note that this length is measured in four-byte units, making the
theoretical maximum lengths roughly 256kB without BIG-REQUESTS and
16GB with.

Fixes: QTBUG-127392
Pick-to: 6.7 6.5 6.2 5.15
Change-Id: Iee53f579802e8bc54ed1519bc5b5591b5e5700e1
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit 0ed5d4d674c241f7affa3b87feb948c26e11d5cc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-12 09:43:39 +00:00
Liang Qi
c237b57983 tests: blacklist tst_QGraphicsItem::cursor()
on Ubuntu 24.04 GNOME Wayland.

There is a bug in GNOME 46.0 on Ubuntu 24.04 Wayland when showing
a maximized or fullscreen window.

Task-number: QTBUG-127920
Change-Id: I15e1f6b9bbf27d92cd106318ac44c33fdabfa3a0
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit f31bce32cdb50eb02bffc690e3ba7cc6b986915e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-12 09:43:39 +00:00
Liang Qi
6d8261a68b tests: blacklist tst_QPrinter::testPrintPreviewDialog()
on Ubuntu 24.04 GNOME Wayland.

There is a bug in GNOME 46.0 on Ubuntu 24.04 Wayland when showing
a maximized or fullscreen window.

Task-number: QTBUG-127920
Change-Id: I1500ec1dcf93005b358b7411dcd40ae79f7494fe
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit f54ab49fb8cee4611a040ef40c883b8158bfa2d9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-12 09:43:38 +00:00
Liang Qi
cf32e1697e tests: extend tst_QBackingStore::flush()
There is a bug in GNOME 46.0 on Ubuntu 24.04 Wayland when showing
a maximized or fullscreen window.

Task-number: QTBUG-127920
Change-Id: I49c0f53b16f501072cbbe92ddd79ff21fb9adb27
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 66591b658f4270252f8bf342dac7e2a9bcad34a0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-12 09:43:38 +00:00
Ahmad Samir
c178110208 QCollatorSortKey: don't export the private class destructor
It needn't be exported because the public class destructor is defined
out-of-line and the move ctor, even though inline, and requiring the
definition of the member destructor at compile time, doesn't actually
call it.

Amends 612ed28985736cabce722580d9b84c5af4460e05.

Found in API review.

Change-Id: Ia782fd5597c215c16929752e9f34534b74406230
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit d9346c96104f9d83dad2d29a945f7ac96ab9258d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-12 09:43:38 +00:00
Axel Spoerl
a94b3deb49 Add missing break in tst_QWidget::reparentWindowHandles()
6c036012b5f2304a05af29f29daa7582603f79ae added a case branch to a
switch before the break of the previous case.

Amend the commit and add the missing break.

Task-number: QTBUG-127641
Task-number: QTBUG-125149
Task-number: QTBUG-122747
Pick-to: 6.7 6.5
Change-Id: I3f2b3e07db463b72fa99af493f40cbc1a783f1ed
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 1d409c0854d664bafc2a35b33cb73129a51c947a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-12 09:43:38 +00:00
Thiago Macieira
68c9ea8888 tst_moc: check the enum's own metatype, not its underlying metatype
Checking the underlying type's metatype is checking through a QMetaType
feature, not moc's functionality. And QMetaType currently always returns
the metatype for int for all QFlags types.

Change-Id: I8a96935cf6c742259c9dfffd17e9791608e38b6e
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 46b73b1ef37e22af23bfce992f41498c6409df3a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-12 09:43:38 +00:00
Thiago Macieira
46ef4c8b86 tst_moc: fix the order of arguments in QCOMPARE in checkEnum
QCOMPARE is (actual, expected).

Take the opportunity to test out-of-range returns from QMetaEnum too.

Change-Id: I8a96935cf6c742259c9dfffd17e9575a6d4cf90a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit e3e44e2294c06f243838dfa28ec4f350c5e6ffbb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-12 09:43:38 +00:00
Thiago Macieira
3d90aa1771 QDebug: cast the QFlags value to the right-sized unsigned type (2/2)
This applies to the Q_ENUM/Q_FLAGS overload of the debugging functions.
This prevents the sign-extension of a signed QFlags field when
converting to quint64, which would have resulted in 0x8000'0000 becoming
0xffff'ffff'8000'0000.

Right now, this is a no-op change because the implementation in
qt_QMetaEnum_flagDebugOperator() calls QMetaEnum::valueToKey(), which is
limited to int (32 bits).

Change-Id: I8a96935cf6c742259c9dfffd17e998c3a0538146
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 232ad339ab14965b6207d04a45d8d37ec3139558)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-12 09:43:38 +00:00
Thiago Macieira
9883f88850 QDebug: cast the QFlags value to the right-sized unsigned type (1/2)
This change fixes three problems in the non-Q_ENUM overload. First, the
printing of the sign bit for a signed flag. This is correct, but
unexpected:
  QFlags(0x1|0x2|-0x80000000)
By using unsigned types, we'll print instead:
  QFlags(0x1|0x2|0x80000000)

Second, shifting into the sign bit is UB, so we remove the problem by
not having a sign bit at all.

Third, this provides an out-of-line non-template overload of the
implementation for unsigned QFlags, thereby avoiding an unnecessary
instantiation of the template function qt_QMetaEnum_flagDebugOperator()
in user code.

Change-Id: I8a96935cf6c742259c9dfffd17e992caa315e1d3
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 91a27c1a516068b69ab62778a07c566ad22f3576)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-12 09:43:38 +00:00
Marc Mutz
a9f26089ed Enable QT_NO_QSNPRINTF globally
The qsnprintf() function introduces even more platform variability
than std::snprintf(), so from now on, we're using only std::snprintf().

Task-number: QTBUG-127110
Change-Id: Ic81b2a760521d77442cc328d2cfa7659bba8b7e2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit b8a956c2d3f9c158594265eca89185bd2bc671e7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-12 09:43:38 +00:00
Marc Mutz
ba823e3a5f qYieldCpu(): compile in strict C11 mode
This function is one of the few Qt functions that are also available
in C (as opposed to C++) mode. Testing has shown that 'asm' doesn't
work in strict mode (-std=c11) on GCC, so use __asm__ instead, like we
do in qthread.h.

Amends a7f227f56cfe562280e89d3c73040f7e8384129e and
877c158c5976bebffd0ff02c39b6b66a842c6344.

Task-number: QTBUG-119901
Task-number: QTBUG-103014
Task-number: QTBUG-103011
Pick-to: 6.7 6.5
Change-Id: I4cb59bf6c716b09bfc7225314624ccd5ab77a5fd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 0c4d4cfa02ce8743a7aae3924af0d120c1c5e2fb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-12 09:43:38 +00:00
Assam Boudjelthia
6f01a67bdc CMake: make tst_manual_permissions standalone project
Similar to 0e56dd2746a8d19d81f71241d6be55e1c94ab037.

Fixes: QTBUG-126415
Change-Id: Ia6993a050bac1eb6860d7bbdf76c454c62eb46b3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 052d8714cdad9126ca69fcbee95bce223ef7eb67)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-10 10:07:44 +00:00
Liang Qi
fe090e0a09 tests: blacklist tst_QHeaderView::stretchAndRestoreLastSection()
on Ubuntu 24.04

Task-number: QTBUG-126493
Change-Id: I21c6c4c1b66a48d7c30c98c30557aa2ccfe76b59
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit bc93d5b712f48bf6da400cdaf58daf7e0c852d23)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-10 07:57:32 +00:00
Liang Qi
24c8e309ee tests: blacklist tst_QMenuBar::check_menuPosition() on U2404
Task-number: QTBUG-68865
Task-number: QTBUG-126498
Change-Id: Iee8831cfac5f3317163a33d96b2dcea09bd033bb
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit a5022924109beed1730569d232611bb131a83633)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-10 07:57:25 +00:00
Liang Qi
afd6ae6091 tests: blacklist tst_QWidget::saveRestoreGeometry() on u24.04 x11
Task-number: QTBUG-126495
Change-Id: I26905d7c2bbcad9a092bbd8084494a1ad0af9ee3
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit a660c8e94daca1c362fd955d28a01f715b62ade3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-10 07:57:18 +00:00
Friedemann Kleint
dd825ccfff tst_uic: Modernize code
Use modern string literals, initializer lists and fix some clang-tidy
warnings.

Change-Id: I77ea935121995e41211f5342552c0dd37191e35e
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
(cherry picked from commit 5790d167448eea094439c7520e2fc68aed480e39)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-09 15:16:50 +00:00
Joerg Bornemann
9ff399fd09 CMake: Fix qt6_wrap_cpp's __QT_INTERNAL_OUTPUT_MOC_JSON_FILES option
This output parameter was not forwarded from _qt_internal_wrap_cpp.
This amends commit f3d29dfb89f3e35623edd7e5bca934a1e85a6c35.

Fixes: QTBUG-127799
Change-Id: I4a17961d220b556c8d85503de9bd3129713a4474
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
Reviewed-by: Orkun Tokdemir <orkun.tokdemir@qt.io>
(cherry picked from commit 987c6d2d75429444f866bd17ccc24227198b090f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-09 09:10:46 +00:00
Thiago Macieira
adf619ce0e QFile::moveFileToTrash: explicitly disable Android support
This code has been enabled but didn't work: we kept getting permission
errors on use. So let's save some library size.

Change-Id: Ifb754f0e28774c20aa7cfffd17e7549e7624e42a
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit c41b6b7986cdf68c18a20ae6ef54efe1e9c1396e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-08 04:36:13 +00:00
Tor Arne Vestbø
1ccaae4c14 Android: Create QtWindow as initially hidden
QWindows are not visible when created, and require a setVisible(true)
call to be be shown. Android Views on the other hand are visible by
default.

This mismatch caused problems when a foreign window was parented into
a QWindow that was yet to be shown. If the foreign window child was shown,
it would show up on screen, due to its QtWindow parent, as well as the
parent window's QtWindow both being visible.

Technically this problem also applied to normal Qt child windows, but
because these windows rarely render unless isExposed() returns true
they would not show anything.

We now initialize QtWindow to being hidden on creation, and let QWindow
handle the order of when the window is made visible.

The QAndroidPlatformForeignWindow::setVisible code had to be adjusted,
as it doesn't call into the QAndroidPlatformWindow base class, where
we normally handle the visibility toggling of our QtWindow layout.

Change-Id: I3debba5f42609d687dc88f7f92c89055cfa6c5f1
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 6faf18aceb21a4c5e06d0dfe87b9fbaa037f80fd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-08 01:10:01 +00:00
Tor Arne Vestbø
c9dcb28824 Android: Don't set geometry when creating surface or adding native view
The window geometry has been propagated to the QtWindow layout already
via setGeometry() already, so we don't need the additional plumbing
for createSurface and setNativeView.

It's enough to set the layout params of the inserted View to match
the parent (the QtWindow in this case).

Change-Id: I40b44282e80ed04b109ffc1958144cb3e3edd11d
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 9d398a18c24ab0a16ceb0346fc20b8eebf95410d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-08 01:10:01 +00:00
Tor Arne Vestbø
292965201a Android: Don't set QtWindow layout to MATCH_PARENT when adding top level
The top level might have a non-fullscreen geometry set, and we should
respect that.

Change-Id: I9717d185a3fe008f4d23a02c527e1a9739aea1d6
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
(cherry picked from commit aa45280d972460a4da500d2f6a2bb4fa5f8b6e43)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-08 01:10:01 +00:00
Tor Arne Vestbø
8a8df25f32 Android: Always apply initial geometry from QWindow to QtWindow
We shouldn't rely on the QWindow geometry being propagated through
other means, so we should always propagate the geometry when
initializing the QAndroidPlatformWindow.

Change-Id: I489b059ffae7a209005edaaff3674c1f39273bee
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
(cherry picked from commit 6e52d010535b87300bacd54c0c21fba7cc926eaa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-08 01:10:01 +00:00
Tor Arne Vestbø
555242e637 Android: Unconditionally set geometry when asked to via setGeometry
The geometry() of the platform window may match the incoming geometry
at the point of the call, but the native geometry of the Android layout
and view might not, so we still need to propagate it to the platform.

This matches what other platforms do in QPlatformWindow::setGeometry.

Change-Id: I5f04a323412ce2ce9561cace1f0cec461c133e28
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 02734b644e0ae566163da68dd51623943d41fb13)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-08 01:10:00 +00:00
Tor Arne Vestbø
35f3ba214b Android: Remove unused member m_oldGeometry
The usage was removed in a02ea26b469a32fbdcd9ce777dd46aeacc5cd82f.

Change-Id: I91ec688b7388ea62b2b69745747f83112eaae439
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 5edeaa0720c04cb619db92a98bdcc0401774d9df)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-08 01:10:00 +00:00
Tor Arne Vestbø
10cf8c8fde Android: Simplify QAndroidPlatformWindow::setGeometry plumbing
Instead of splitting the geometry setting into setGeometry and
setNativeGeometry we can leave setGeometry to do the right choice
of whether to propagate the geometry to the QtWindow layout or not.

Change-Id: I30291dbf7079df76f4d3a54d6ea3c9c3f1329c90
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit b3e60c5acfaf809f376f66d6ab7f98ca644b0fce)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-08 01:10:00 +00:00
Tor Arne Vestbø
f8ae1a4ab1 Android: Remove m_surfaceCreated check from setNativeGeometry
As long as we have a QtWindow we should be able to set its layout
parameters. Adding surfaces or native views later on will adopt
the QtWindow's layout params.

Change-Id: I08591e18f95bfe1e85358bb68507145d35630486
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
(cherry picked from commit 79ae28d9ace358c20c716ced0d0d9471b500e0cc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-08 01:10:00 +00:00
Tor Arne Vestbø
913552ad0b Android: Create QtWindow before applying QWindow geometry during init
During QAndroidPlatformWindow::initialize() we call setGeometry, which
may end up in QAndroidPlatformWindow::setNativeGeometry() via one of
the QAndroidPlatformWindow subclasses, i.e. GL, Vulkan, or foreign
window.

We currently bail out from setNativeGeometry if !m_surfaceCreated,
but this is only a workaround for the m_nativeQtWindow not being
alive yet.

As long as we have a m_nativeQtWindow, we should be able to set the
layout parameters of that QtWindow, independently of whether it has
a QtSurface or is hosting a foreign Android view.

As a start, move the QtWindow initialization earlier in initialize().
The isEmbeddingContainer() check can go at the top, as we shouldn't
do any modifications to a window that's purely used to act as a
container when embedding Qt in native Android apps.

Change-Id: Ia3f0b33e6729f5399946d86799f39877d058511b
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
(cherry picked from commit e2ce1f724f56db8072033665d066ad34f4d4c702)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-08 01:10:00 +00:00
Tor Arne Vestbø
b9022081b0 Android: Don't add QtEditText to foreign windows
We don't handle input on behalf of these windows, so we don't need
a QtEditText for them. Any Qt managed child QWindow added to a foreign
window will get its own QtEditText as normal.

Change-Id: I32daa83f22487aadca7509379595b6c82b29ea4a
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
(cherry picked from commit eea00824bdbc6740261d2b78821e31c1f21c9c0c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-08 01:10:00 +00:00
Tor Arne Vestbø
c45da998ad Android: Initialize window in QPlatformWindow::initialize() override
During the QAndroidPlatformWindow constructor we can't safely call
virtual functions of QPlatformWindow and expect them to resolve to
subclasses, e.g. QAndroidPlatformForeignWindow. Importantly, this
means we can't check isForeignWindow() during construction.

QPlatformWindow has a dedicated initialization function for this
use-case, so use that instead.

The existing order of between QAndroidPlatformForeignWindow and
QAndroidPlatformWindow has been kept as is.

Change-Id: I2a08326fae6a3b079cd153c50a13794310ac3d74
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
(cherry picked from commit 7150c79d0ee10d6aca330e6a0862b0fbfec071fc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-08 01:10:00 +00:00
Giuseppe D'Angelo
4c1a82e4cf QRegularExpression: coalesce consecutive * tokens in wildcards
When converting a wildcard into a regexp, convert a series of
consecutive '*' tokens in just one '.*' (instead of a series of '.*').
The pattern matched is the same, but we reduce the effects of a
possible catastrophic backtracking. I'm not actually sure whether
PCRE optimizes this case out of its own or it doesn't; Perl appears
not to.

Change-Id: Ia83336391593d56cf6d8332c96649a034a83a15b
Fixes: QTBUG-127672
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit a041cd35214e57a189aaa1f1f77199ff42303f83)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-08 01:09:59 +00:00
Mårten Nordheim
a903414898 QNonContiguousByteDeviceByteArrayImpl: store value not pointer
Storing a pointer was fine when used with the QBuffer version, but
that means you have to keep the QBArray alive outside the class
itself.

Just store the value and it is a little easier to use.

Changes in this cherry-pick: The dev patch chain has the test update in
the wrong commit, so cherry-picked it along with this.
And apparently I also forgot to commit a bug-fix to this commit as well,
the bug anyway disappeared in dev when I deleted the class and
redirected everything to the ByteArray class.

Change-Id: Ic02e0b4627fde2b5fdd7e5fb69a94e06aa768ab9
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
(cherry picked from commit 67140afca21efae75aad35f63ca1d7211fe6ec3a)
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-08-08 00:33:14 +02:00
Marc Mutz
c250c59f7c Fix QT_SUPPORTS_INT128 checks
The macro is defined or not, not defined to 1 or 0.

Amends 1d7950c9467ba4db75ac065bd54ffe08e4a29710 (qhashfunctions.h),
0d85d0a72fd0136bd89e201d0cc1bf7fac2c24c8 (tst_qfloat16.cpp),
104a0a9ecdb18d65e4d9075d87e8860c6c9d8335 (tst_qglobal.cpp),
7a829eaf51853e0852db28b8b8223e1a62a3db0c (tst_qtendian.cpp).

Pick-to: 6.7
Change-Id: I190e208f3c96f27100dae3eef512739afa8fadd9
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit c78994a887f56f1bc77a5fa0db3b98196851db5e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-07 19:57:04 +00:00
Matthias Rauter
a3e4a7eecb Ensure that RST_STREAM is sent following RFC 9113
RFC 9913 differentiates between stream errors and connection errors.
Some error handling only requires stream errors in the form of
RST_STREAM frames, while other sever errors require connection errors
in the from of GOAWAY frames.

This patch streamlines the sending of RST_STREAM frames, and ensures
that they are sent whenever mandated by RFC 9113. In some cases this
was missing, in some cases we were sending connection errors instead
of stream errors.

Further this patch adds tests to ensure the correct behavior.

Fixes: QTBUG-122345
Pick-to: 6.7
Change-Id: Ic93ae7a358a4eb551aa23342a6683cdd5dd0abb0
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit d17d260948e16549d82f1fdd4dec98d246b0622e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-07 19:56:20 +00:00
Morten Sørvig
0285424930 Enable WIDGETS_RHI when HIGHDPI_DOWNSCALE is set
QT_WIDGETS_HIGHDPI_DOWNSCALE requires the rhi backing
store backend for GPU downscaling. Enable that automatically
to make the downscale functionality easier to use.

Change-Id: I27a538fef426768fe69fcfe07104136209b3bae2
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 672310c74691c60b303520c69287d73d07ab32a1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-07 19:05:39 +00:00
Alexandru Croitor
db58564f4f CMake: Unset DESTDIR when installing non-standalone examples
When QT_INTERNAL_EXAMPLES_INSTALL_PREFIX is set, the build system
should ignore the DESTDIR env var when installing examples. Otherwise
the examples will still be installed into a location where the Coin
agent will archive the files, and thus blow up the package size,
especially if each example contains deployed Qt libraries.

Backup and temporarily unset the DESTDIR env var while example
installation is in progress.

Amends 02cb165ef8050230b477358e4136e9f0acd83eb6
Amends 7694b01aafd52b7064161b2f8c9a98cd330d24d3

Task-number: QTBUG-90820
Task-number: QTBUG-96232
Change-Id: Ibe24a88dd672d246b579d815a813dd042f60e6a6
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 90db9a41566f0fdb26b7a80b68b55ac0360489f0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-07 17:30:07 +00:00
Tor Arne Vestbø
5400025796 widgets: Persist window Qt::Popup state when reparenting parent widget
As a result of c956eb8eddb1b3608d7e3d332fbe55df5ec41578 we are now
reparenting QWindows managed by QWidgets when the widget itself or
any of its parent widgets are reparented. When reparenting a child
widget from being a child to a top level, or top level to child, we
need to know the new top level state to determine if the QWindow
should have a QWindow parent or not. As the window flags of the
widget are in flux during the reparenting, we were using the new
window flags of the reparented widget to determine this.

However, for QWidget children of the widget that's being reparented
we can't use the window flags of the reparented widget. We must use
the flags of the child itself. These flags are not in flux, so we
can use QWidget::windowFlags() directly.

Failing to propagate the child widget window flags was causing us to
lose the transient parent relationship to its parent QWindow for
popup windows.

Fixes: QTBUG-127641
Fixes: QTBUG-125149
Task-number: QTBUG-122747
Pick-to: 6.7 6.5
Change-Id: I6dbc5ff5ad019b0f9188516ff3d645e860a9627b
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Volodymyr Zibarov <gogan419@gmail.com>
(cherry picked from commit 6c036012b5f2304a05af29f29daa7582603f79ae)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-07 09:29:02 +00:00
Eirik Aavitsland
051764ddf4 QPainter: Skip drawing text if target rect is invalid
If drawText() is passed an empty/invalid target rectangle, we would
still go though the motions of laying out and painting the
text. Output would normally be empty, as expected, since the clipping
would take of it. But for paint devices with limited clipping support,
like QSvgGenerator in 1.2 Tiny mode, the text would wrongly show up.

Add a shortcut to skip painting text in this case.

Fixes: QTBUG-127114
Change-Id: Ia7de3e7d2493218fc2a0f6cb0e815285ddceeb1d
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit c7df8dda8b60b4e4e7b1859f462d65cef5d8c85b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-07 09:22:15 +00:00
Jukka Jokiniva
68b07f90f9 Fix cmake module_includes and test_opengl_lib tests when no_opengl
Fixes: QTBUG-126350
Fixes: QTBUG-126351
Change-Id: Ic241e15b45090c69d24efe58c03df91ea8c1d298
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 6899008daab3ec31af4871d3b5063b99296e89fd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-07 08:16:30 +00:00
Jarek Kobus
9f56f88c02 QFutureWatcher: Fix typo
The right replacement for pause() is suspend(),
not suspended() - the latter is a signal name.

Amends 37cfc3c6d2e3b290c7fc41cd7545283d24e4433c

Pick-to: 6.7 6.5 6.2
Change-Id: Ic94919de9e9890f62335a4bdee267549616f4a42
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 4f234b378e24742eecbefc16b63349e638828112)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-07 08:16:28 +00:00
Marc Mutz
2e2cdc3c4f qtestcase.cpp: standardize on <cstdio>
As part of the qsnprint() -> std::snprintf() port, we included both
<stdio.h> and <cstdio>. Standardize on the latter; this is a C++
project, after all.

Change-Id: Icd8ef528b94cea75dd0ede18b4105f85b08c3515
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 73d7138c020d0f95ad354c4ec4512a54914e0195)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-07 07:18:06 +00:00
Eskil Abrahamsen Blomfeldt
5f5dafac08 Fix tst_QTextLayout::softHyphens failure with some fonts
The test did not account for the fact that kerning can alter the
distance between subsequent characters, so sum of horizontal
advances does not accurately measure the width of the string when
kerning is enabled.

This caused the test to fail with e.g. with the font Ubuntu Sans.

This amends 0ffdbb21261eee3a9ec1cd541478ee883a12065c .

Pick-to: 6.7 6.5 6.2
Fixes: QTBUG-127512
Change-Id: Id3ae7a6c79c84edd603db2fc0fed07777fa67741
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit e7ac6667f27369c25719ebedefd2d5344fd93bfd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-06 20:42:59 +00:00
Thiago Macieira
a758315eba QAnyStringView: remove direct #include <compare>
Since commit 2bc9ad0e5dd75cf69f4a8bf94a6a917de2b4e8c4, we have our
qcompare.h header, which takes care of this. This also fixes the build
when the compiler supports operator<=> but the Standard Library doesn't
(e.g, VxWorks):

qanystringview.h:13:10: fatal error: 'compare' file not found

Change-Id: I8a96935cf6c742259c9dfffd17e9014a52d4991c
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit f48f425d3ebc76b242243b440fb853ba29e0970c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-06 20:27:32 +00:00
Orkun Tokdemir
086a2ac3aa Doc: Improve AUTOGEN_BETTER_GRAPH_MULTI_CONFIG documentation
Task-number: QTBUG-126461
Change-Id: I9d7fa477b7889dfef009bbf8e09b281212b70ea9
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit f8409dcc68f1df4f05e2a051e7019d523402c0a7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-06 20:27:30 +00:00
Tor Arne Vestbø
69e5a9fb4a tst_QWindow::framePositioning: Skip on Android and fullscreen-only systems
The framePositioning test was split out from the positioning test, but
without the existing skips. Turns out we do need the same skips, so
add them.

Change-Id: Ib5d1cdf474a3a88a154c7cdc8df346668c8053d6
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
(cherry picked from commit 6f46f85899b425729d595af6461c6dbe3f4f7e1c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-06 20:27:28 +00:00
Petri Virkkunen
7cea4391ce Android: Set window focus based on window touch, not global focus parentage
Since QtEditText is no longer focused on QtWindow touch,
onGlobalFocusChange event is no longer triggered, and so we cannot get
the parent View (QtWindow) of the current global focus object and set
it as the focused QWindow.

Move QWindow focus setting to be done directly under QtWindow onTouched.

Pick-to: 6.7
Change-Id: I292f197c64d170aa2f15a3118e6f861b59c906f5
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
(cherry picked from commit 1442a9ea479d197ed338f440d5106a7e195c4ee2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-06 12:01:13 +00:00
Petri Virkkunen
e6211e49b9 Android: Don't call QtWindow.windowFocusChanged with invalid window ID
Invalid window ID just ends in an assert.

Pick-to: 6.7
Change-Id: I30ef90278ad2b862ada124beb0e5a7925192827b
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
(cherry picked from commit a624a7d00a925efd862bc3b84309a86f34291834)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-06 12:01:12 +00:00
Petri Virkkunen
bdca63dba3 Android: Do not request focus on window touch
Remove focusing QtEditText on window touch so that hardware keyboard
events can still be sent to the application after touching the screen.

Move QtEditText focus request back to showSoftwareKeyboard in
QtInputDelegate, so that we can still show virtual keyboard on
QtEditText when needed.

So that QtInputDelegate still has a valid QtEditText instance to show a
virtual keyboard with, add a new QtInputConnectionListener interface
function that gives the currently "active" QtEditText to listeners.

Call the new QtInputConnectionListener interface function when QtWindow
is touched.

Pick-to: 6.7
Task-number: QTBUG-126187
Change-Id: Iff90b96351d5285249d5bcd19f3caa648628cf14
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
(cherry picked from commit 25852624e1a306ab35acb7192ab29dc80b416556)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-06 12:01:10 +00:00
Alexandru Croitor
07dc649747 CMake: Fix build of oci plugin on arm macOS with the classic linker
When using Xcode 14, or 15 but with the classic linker on arm macOS,
the linking of the oci plugin fails with:

 ld: file not found: @rpath/libnnz.dylib for architecture arm64

Even though the file is present in the expected location.

This seems to be related to the use of the -flat_namespace flag, which
was originally added in 2003 for Qt 3.1, to avoid an issue with the
linker not finding the environ symbol.

These flags doesn't seem to be necessary anymore to successfully link
the plugin.

Remove both the -flat_namespace and -U,_environ flags when building
the plugin.

Amends 3ada49976a06ae251911fd8cd734f697fe4ddab4 in the historical qt
repo, which is not available publicly.

Pick-to: 6.7 6.5
Fixes: QTBUG-127342
Change-Id: If522cacb92aceff35d36d3bcfd3c1f838c134ada
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 3642ce6e4b1912a774cc55c9a6a85ecf716d7080)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-05 22:38:48 +00:00
Toni Saario
30e0091774 Coin: Prefer publickey in QNX emulator ssh
When starting QNX emulator this makes VM to try to publickey first.

This avoids VM from trying to use gssapi-with-mic authentication,
which in some cases hangs indefinitely causing a timeout.

Pick-to: 6.7 6.5
Change-Id: I499c668a910851d97ce8de803a1064dcd7b0b74d
Reviewed-by: Jukka Jokiniva <jukka.jokiniva@qt.io>
(cherry picked from commit 97637f909482a0b8472f99c6ecdc873029843cb1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-05 19:28:43 +00:00
Łukasz Matysiak
d6a10893cd Prevent -feature-c++20 on VxWorks
The way that Qt checks if C++20 is supported by the platform does not
work properly on VxWorks.
Their toolchain accepts the C++20 switch, because they use clang with a
wrapper around it, that (for the time being) does not reject it.
The compiler itself claims that it does support C++20.
The problem is that the standard library available on VxWorks only
supports C++17.
This leads to Qt falsely believing that C++20 is supported.
This is being discussed as a defect in support case 00152044.

Prevent weird compilation errors by failing early if the user passes
-feature-c++20 to the configure call.

Task-number: QTBUG-115777
Pick-to: 6.7
Change-Id: Ica6686428b01a0638117f853586313be63e5fe99
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit a578a09a418c689c9c9a43152961288ad075471b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-05 19:28:43 +00:00
Marc Mutz
ffe4b7cc5b QtGui: port away from q(v)snprintf() and mark the module free of it
No format-string warnings here, thankfully.

Change-Id: Ib901550ca5e532247635afd995d560dc81628863
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit b2b0a5df25c32c3c36c731e2f5ca092edc2c8385)
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2024-08-05 21:28:43 +02:00
Marc Mutz
33077559a2 QtTest: port from qsnprintf to std::snprintf and mark the module as qsnprintf-free
Drive-by remove an explicit NUL-termination (std::snprintf() does
that) and port a repeated use of printf argument checking to the
protect() idiom.

Change-Id: Ida15940fe9aef0622e9836a229a398c909503a9a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit b5115d1c2fc73feb149a8ee97de011b3c75694fb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-05 18:23:04 +02:00
Marc Mutz
2a72fb6d81 QTest: simplify qPrintDataTags() string building
Use higher-level API (QByteArray::chopped()/operator+()) instead
of new[] and qsnprintf().

methodSignature() already heavily depends on QByteArray concatenation,
therefore trying to avoid using Qt code in QtTest is pointless, at
least here.

Drive-by indent lines so a follow-up port to std::fsprintf() will not
have to re-indent these lines again.

Amends b68bae1132b5dc5c8f55435c72cd48e24aa52ec9.

Pick-to: 6.7 6.5
Change-Id: I94ec440d7e6d09196cf87cd3dbbfd765e0df69d0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit a15ff49be73228bbbc72989736d32059322c414f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-05 18:22:58 +02:00
Marc Mutz
13ed410121 Make headers QT_NO_QSNPRINTF-clean
Before we roll out QT_NO_QSNPRINTF across Qt, we need to make sure at
least the headers are clean, so downstream modules can port without
being stabbed in the back by unported upstream headers.

Task-number: QTBUG-127110
Change-Id: I7411ff0036482ad68bd5867b624518f68f249228
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 7e2fa57faf230ef8cb505b95c2bc0e70867ac131)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-05 18:22:50 +02:00
Marc Mutz
0eab6aac05 Introduce QT_NO_QSNPRINTF and mark QtCore as qsnprintf-free
... except, of course, the implementation file, which therefore has to
be excluded from PCH'ed builds.

Remove qvsnprintf.cpp from libbootstrap, as it's no longer needed
after porting all five uses of qsnprintf() in QtCore to C++11's
std::snprintf(), which even Windows implements with std behavior.

The reason we're removing the function is that std::snprintf() is the
better alternative: qsnprintf() just introduces even more platform
variance than any implementation-defined behavior of C or C++
snprintf().

To wit:

- On Windows, the return value is sometimes "wrong"
  (cf. Windows-specific qsnprintf() tests in tst_qbytearray.cpp)

- On WASM and at least some Android configurations, it is incorrectly
  implmented using the QString::asprintf().toLocal8Bit() work-around,
  even though both platforms have a working snprintf().
  QString::asprintf() is implemented in Qt itself, so has some
  differences:

  - the `a` format for hex floats is not supported

  - %ls expects char16_t*, not wchar_t* (these are, in general, not
     the same width)

We will deprecate these functions in 6.9, but before we do, we need to
get the Qt code in order, and that's where this macro comes in.

[ChangeLog][QtCore] Added the QT_NO_QSNPRINTF macro to disable
qsnprintf() and qvsnprintf(), which will also be deprecated in 6.9.
See the documentation for details why we take this step.

Task-number: QTBUG-127110
Change-Id: I4e1c1f213bcfd615f83387f5f51e77fa1ff2062e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit bd7d54249e3f2b6a9dd6b759c892d7c97d26c0aa)
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2024-08-05 18:22:44 +02:00
Orkun Tokdemir
5fe247df39 Doc: Use qt_add_ui instead of qt6_add_ui
Task-number: QTBUG-126463
Change-Id: Ib5d207e72c0de436b4daec29efd8baec8a998103
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 4f39704602de001db4c9e82fb0708ee1b2713e38)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-05 14:44:15 +00:00
Orkun Tokdemir
a0b6488969 Doc: Improve qt_add_ui documentation
* Remove links to `qt_add_ui` in the qt_add_ui documentation
* Add links for `qt_wrap_ui` and `AUTOUIC`

Task-number: QTBUG-126463
Change-Id: I73c8e406407e3f71bba40e1c41473a17a7f45222
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 2e8d7c552df4ac0987d7756ed4de9f35bb4735cc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-05 14:44:09 +00:00
Orkun Tokdemir
a9dbdcd986 CMake: Add new signature to qt6_wrap_cpp
* Introduce a new signature to qt6_wrap_cpp so that it accepts a target
name as the first parameter.
* Update the qt_wrap_cpp documentation.
* Show a warning message when the previous signature is used.
* Amends dc4159286b8571a3f3543e457fe1b51b9f5965b7 because it deleted
the `qt_wrap_cpp_3` example by mistake.

[ChangeLog][Build System] A new target-based signature was added for
qt_wrap_cpp. The usage of the previous output-variable signature is
deprecated and will issue a warning.

Fixes: QTBUG-126460
Change-Id: I85b7c516d6aebd8bbfda441fb6c68999e4898479
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
(cherry picked from commit f3d29dfb89f3e35623edd7e5bca934a1e85a6c35)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-05 14:44:07 +00:00
Dmitry Shachnev
f2601a27b0 Use _Float16 only when SSE2 is enabled
The GCC documentation [1] says: “On x86 targets with SSE2 enabled, GCC
supports half-precision (16-bit) floating point via the _Float16 type”.

On non-SSE2 x86 (such as Debian i386 baseline [2]), __FLT16_MAX__ is
defined starting with GCC 14 [3], however any non-trivial use of the
_Float16 type results in an error:

error: operation not permitted on type ‘_Float16’ without option ‘-msse2’

which makes some packages fail to build on i386 architecture [4].

[1]: https://gcc.gnu.org/onlinedocs/gcc/Half-Precision.html
[2]: https://wiki.debian.org/ArchitectureSpecificsMemo#i386-1
[3]: https://gcc.gnu.org/g:9a19fa8b616f83474c35cc5b34a3865073ced829
[4]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1076986

Pick-to: 6.7 6.5
Change-Id: I393ee83eb8e8888f5fc9e3b349dc8b063eef6f5a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 39fa7e7bef90be2940c5f736935f963e3969e0bd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-03 13:49:35 +00:00
Marc Mutz
a58abfec1c QtTest: mark more functions as cold
Unit test failure should not happen, so mark failure formatters as
cold (like qFail() itself).

As a drive-by, mark formatFailMessage() overloads file-static, too.

Change-Id: I92f5b674a7282f4ebaa9250894a9971a524f4108
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 69c510d6bcc52ac133a82d7a9493ffba037c4521)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-03 11:15:43 +00:00
Volker Hilsheimer
0f89dbb571 Windows: Use pixmaps at 1.0 scale for icons in the QPA menus
The Menu type from Qt Quick's libs.platform module on Windows uses the
Win32-based menus implemented in the Windows QPA backend. Those are not
High-DPI aware, so we cannot use a scaled up pixmap for the menu icons.
The native Windows icon engine returns scaled pixmaps (defaulting to the
QGuiApplication::devicePixelRatio value if not explicitly specified), so
we have to explicitly ask for pixmaps with scale factor 1.0.

Pick-to: 6.7
Fixes: QTBUG-127551
Change-Id: I191915127890ae265b169d5cd8d6c9f058e36a13
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit fdfb360f4f60cbdb9ce7f29f424dad70f0679b17)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-03 11:15:42 +00:00
Volker Hilsheimer
5aafe2851f Apple: cache all pixmaps from the icon engine
So far we have only cached the most recently requested pixmap, under the
assumption that this is the one usually requested several times in a
row. However, our menu integration requests the pixmaps for all
available sizes when populating the native menu item with an NSImage.
Not caching the pixmaps for all sizes results in repeated rendering of
the image, which significantly slows down the opening of native menus
e.g. using Qt Quick's labs.platform Menu.

Use a per-icon-engine cache for the pixmaps, with a cache key that is a
struct holding the mode, state, size, and scale factor.

Pick-to: 6.7
Fixes: QTBUG-127614
Change-Id: Ie13cae8c69a8ee979907d4b9ea01bcdd89dd585b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit c8a2794c441dfc6aa0ceec3ae847a8b1e353a89f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-03 11:15:42 +00:00
Christian Ehrlicher
e1cc2bfeb2 Tests/QTreeView: make styleOptionViewItem more robust
styleOptionViewItem() sometimes fails due to a very small widget size
even when using showMaximized(). This might be due to a mis-configured
vm scrren size or similar. To make sure that all 4 rows are properly
painted set the minimum width to a reasonable value and also resize the
sections appropriately.

Pick-to: 6.7 6.5
Fixes: QTBUG-126494
Change-Id: I9956d3119be1ba9e0fb33e4e7b30f40b01b017a5
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit f7662366b120c1cacd43a2c2ae36b03f578d7478)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-03 11:15:42 +00:00
Thiago Macieira
a1610c6c68 QUrl::resolved: rewrite to fix some corner cases for relative URLs
Both issues reported in QTBUG-120396 came from the same dubious piece of
code, which predates the public Qt history

        if (path->size() >= 2 && in[0].unicode() == '.' && in[1].unicode() == '/')
            in += 2;
        else if (path->size() >= 3 && in[0].unicode() == '.'
                 && in[1].unicode() == '.' && in[2].unicode() == '/')
            in += 3;

It makes no sense to check path->size() inside the loop, as the in
pointer will have advanced past the beginning and the remaining size of
the input will not be path->size().

It additionally had theoretical UB in expressions like
  in <= end - 4
for paths that were less than 4 characters long (it cannot happen with
current QString because of the QArrayData header before the payload).

So this commit rewrites the function to fix those issues and some others
found during the unit-testing. It gives the function a major
simplification.

Fixes: QTBUG-120396
Pick-to: 6.7 6.5
Change-Id: I46feca3a447244a8ba19fffd17e012c27e410056
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 4b1547adc9b195e6acc90471fc48dec7ee0c429d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-03 08:24:57 +00:00
Volker Hilsheimer
65144dba05 QIcon: don't detach in setIsMask if value doesn't change
QQuickLabsPlatformIconLoader calls setIsMask on the icon to reflect the
value from the Icon element, and usually that doesn't change the value.
Detaching it anyway results in the icon no longer reusing the cached
engine.

Task-number: QTBUG-127614
Pick-to: 6.7 6.5
Change-Id: Iead04d8a8a2342b03858cf5f72b43c51d442dd6b
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 55f41eb6732d5577eacaf181d5c092c3e15a2b4e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-03 07:56:16 +00:00
Marc Mutz
25b1405dbf QVariant::setValue(T&&): remove a facually incorrect comment
The function template is constrained in the template-initializer to
only rvalues, therefore this overload is never instantiated for
lvalue.

Amends 79ae79d05c65019233cf9ae9e77ef59d90e75ac2.

Pick-to: 6.7
Change-Id: If0260799fa233eba1ccb3545b9d053496901fc2e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 297bc0fb306954dbdf34d80017055b6924315d81)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-03 07:47:21 +00:00
Marc Mutz
42c467a11d Add __attribute__((format(printf()))) to q(v)nprintf()
They were lacking it since the start of the public history, and
porting to std::snprintf() (which has the warning) as part of making
Qt compile with QT_NO_SNPRINTF has turned up surprisingly many
-Wformat warnings, so enable the warning for the remaining (non-tree)
users.

Backporting aggressively, as this might unearth security bugs in user
code.

[ChangeLog][QtCore][q(v)snprintf] Added attributes for GCC-compatible
compilers to detect format/argument mismatches. If this throws warnings
for your calls now, don't ignore them. printf() format mistakes could
be security-relevant. You may also find that you relied on undocumented
behavior, such as that certain implementations (Windows, Android, WASM)
of qsnprintf() support char16_t* instead of wchar_t* for %ls. In that
case, you should port to qUtf16Printable() and QString::asprintf(), or
suppress the warning and port away from the platform dependence at your
earliest convenience.

Task-number: QTBUG-127110
Pick-to: 6.7 6.5 6.2 5.15
Change-Id: I5c1fd9b2d5d2d55c68773f33edfd76acacd2408c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Jason McDonald <macadder1@gmail.com>
(cherry picked from commit 64416d3cf645187385d8ad90bc44d9c8e9ce864f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-03 07:47:19 +00:00
Marc Mutz
f92cab0bee QtTest: Fix format error in _q_compareSequence()
Commit 63295f43e70955a194602a7acf39013f124e14b7 changed the size:
placeholders to %lld, but wrapped only one of the arguments in
qlonglong. This causes 32-bit builds to read past the end of the
expectedSize variable.

Fix by wrapping the other, too.

Pick-to: 6.7 6.5 6.2 5.15
Change-Id: I9c23ab589c8895e8f038fb508e18ac3006fa4f8f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 57eff5b092dbd692594125edc70d3efd898660ea)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-03 07:47:17 +00:00
Fabian Kosmale
ac3af71d04 moc: add line number for class definition to JSON output
Amend moc's JSON output with line information for the classes we find.

Task-number: QTBUG-119143
Change-Id: I821f0c30a56ed992cb9c6173f1e28ace1f26e9cf
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Reviewed-by: Semih Yavuz <semih.yavuz@qt.io>
(cherry picked from commit 1d4533bd5fac54cb5555f03ff08e9085fa533c16)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-03 07:04:04 +00:00
hjk
e2233061d2 Partially revert "QLabel: cleanup QLabelPrivate"
This partially reverts commit 8bd532b1e.

Replacing the std::optional's with real objects led to unwanted
extra allocations, some even in the destructor.

Change-Id: Ib9f949b7d93352c9027ec8a162741d7830e9ec72
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 6f62f25daffafab750f84aec2b90e129e14c2cd9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-02 16:00:00 +00:00
Mårten Nordheim
70d46c20f1 QVariant: fix msvc version comparison for c++20 support check
Was meant to be >=, not <.

Amends ab06d402dd833cefe9c0d929c13e93068aab96d9

Pick-to: 6.7
Change-Id: I5aa2236d2ffc7274e14918aea28c9a3e3545b6c4
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit d6eda60b330e72570be9ce43ce5dc01cd8851665)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-02 14:23:44 +00:00
Vladimir Belyavsky
36e5c45071 gestures: fix build when -DFEATURE_scrollarea=OFF
Pick-to: 6.7 6.5
Change-Id: I1c6089875024b2cb4e3787bf7dcc2f7e8e441bd2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 91bfa5531a92001f48863888e40a870aaba94602)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-02 14:23:44 +00:00
Alexandru Croitor
633751f186 CMake: Fix configuring standalone tests with a cross-compiled Qt
The Qt6 package needs to be found before calling
qt_build_internals_set_up_private_api, otherwise it will fail when
using a cross-compiled Qt, because QT_HOST_PATH will not be set.

The error is:

CMake Error at qtbase/cmake/QtBuildHelpers.cmake:341 (message):
  You need to set QT_HOST_PATH to cross compile Qt.
Call Stack (most recent call first):
  cmake/QtBuildHelpers.cmake:444 (qt_internal_check_host_path_set_for_cross_compiling)
  cmake/QtBuild.cmake:4 (qt_internal_setup_build_and_global_variables)
  cmake/QtSetup.cmake:6 (include)
  cmake/QtBuildRepoHelpers.cmake:21 (include)
  lib/cmake/Qt6BuildInternals/QtStandaloneTestTemplateProject/Main.cmake:7 (qt_build_internals_set_up_private_api)
  cmake/QtBuildRepoHelpers.cmake:1036 (include)
  cmake/QtBuildRepoHelpers.cmake:1053 (qt_internal_setup_standalone_test_when_called_as_a_find_package_component)
  lib/cmake/Qt6BuildInternals/Qt6BuildInternalsConfig.cmake:68 (qt_internal_setup_build_internals)
  CMakeLists.txt:11 (find_package)

Pick-to: 6.7 6.5
Fixes: QTBUG-127668
Change-Id: I2fb3df05ce7aed3949d428d98657fe61de723abd
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 4f9da08b058382cf170bf3a0e14fc73c8cf4fecd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-02 14:23:43 +00:00
Vladimir Belyavsky
2c4ffc1745 widgets: fix build using PCH with disabled features
Fix build using PCH when
-DFEATURE_abstractbutton=OFF
and/or
-DFEATURE_abstractslider=OFF

Pick-to: 6.7 6.5
Change-Id: Ifdb8d6454c242cf98f5effcd2708ef797c99a26d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit e54fa3c75656784cdde26dfd4d7d579d9ac93f00)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-02 14:23:43 +00:00
Ahmed El Khazari
53c7eb49b7 Android: Prevent Qt apps from running in the background
Previously, the environment variable QT_BLOCK_EVENT_LOOPS_WHEN_SUSPENDED
was set to an empty string, which allowed QAndroidEventDispatcherStopper
to keep the application running in the background when it entered the
suspended state (onStop).
To address this issue, the isBackgroundRunningBlocked() function has
been added to validate the proper value when getMetaData(..) returns a
value.

Fixes: QTBUG-125496
Pick-to: 6.7
Change-Id: I541af3bb1f4e239ee8ba2be32583b91afc7a43e2
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
(cherry picked from commit 1f1f726c79ca4d539932e078857a36e8836d474b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-02 11:59:02 +00:00
Laszlo Agocs
1e6950fd77 rhi: d3d12: Also default to max frame latency 2
Follow what's been done in the D3D11 backend. Slightly different
logic here and there due to always having the newer interfaces
available, but does the same thing. Use QT_D3D_MAX_FRAME_LATENCY
to override the default 2.

[ChangeLog][RHI] The D3D12 backend creates swapchains from now on with
DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT by default, with a
max frame latency of 2.

Task-number: QTBUG-127267
Change-Id: I4d0361ab546a1c0041592389f8954281f588b0ba
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 91cae3f9cc9cb97eab69e39d405000f2fd1e533a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-02 09:35:47 +00:00
Laszlo Agocs
9200606068 rhi: d3d11: Wait in beginFrame with a max latency of 2
Implements what's described in
https://learn.microsoft.com/en-us/windows/uwp/gaming/reduce-latency-with-dxgi-1-3-swap-chains

By default SetMaximumFrameLatency is called with a value of 2, since we
do not want to force 1 on everyone as some application may have more GPU
heavy 2D/3D scenes. Use QT_D3D_MAX_FRAME_LATENCY to override. Setting to
0 disables the whole thing. This patch contains no C++ API (could be in
the backend-specific init params), because it is not clear if it is
reasonable to expect applications to control such details of the
presentation mechanism. This also allows cherry picking to earlier
branches.

The result is that, for example, the visible lag between the mouse
cursor and the dragged item will get reduced in Qt Quick scenes that
have a mouse draggable item in them. This comes at the expense of
potentially reducing CPU-GPU parallelism, but many scenes do not need
that kind of performance to begin with.

One big gain here is that with a MaximumFrameLatency of 2 the behavior
becomes closer, and basically identical, to what one gets when running
with OpenGL (where Qt has no control whatsoever over such presentation
details), and so the behavior becomes closer out of the box with Qt 6 to
what one got with Qt 5. This is true at least with NVIDIA graphics on
Windows 11; note that it may not apply to other vendors' GL
implementations.

The QRhi doc update just brings in what's been true for some time in Qt
6: as IDXGIFactory2 is required, the minimum required DXGI version is in
fact 1.3 and so D3D 11.2. (which is Windows 8.1 stuff so should be fine)

[ChangeLog][RHI] The D3D11 backend creates swapchains from now on with
DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT by default, with a
max frame latency of 2.

Task-number: QTBUG-127267
Change-Id: I74f68f7af41097b957b8e0bbdbae39f9302b1ad3
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 02bf4d06b2432d95df9a1f6c9ad072b953b06cda)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-02 09:35:40 +00:00
Marc Mutz
0a67a8c3d4 qtestlog.cpp: remove duplicate <vector> include
Amends efb283fb7f72e950c8ecf755b960a3c1b36b5507.

Pick-to: 6.7 6.5
Change-Id: I92f5b674a7282f4ebaa9250894a9971a524f3096
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 16d085c370a775234ba577461238765c2cf154e5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-02 06:50:02 +00:00
Laszlo Agocs
4b6b601638 rhi: gl: Add a helper virtual to punch through to glBufferSubData
The default implementation of the virtual is of course just
memcopying into beginFullDynamicBufferUpdateForCurrentFrame()'s
result, so not very useful for any backend except OpenGL where
(for non-uniform buffers) it is implemented rather with
glBufferSubData (leaving it up to the OpenGL implementation what's
going to happen internally).

The value is somewhat limited in practice, however one user is
going to be Qt Quick: to get as identical as possible results
to Qt 5 in artificial "benchmark" scenes, it becomes important
to go directly to glBufferSubData (just as Qt 5 did) when
updating geometry for a large number of items in every frame,
and skip any intermediate resource update logic.

Task-number: QTBUG-125087
Change-Id: I780a1431e021b90590b493e1fb82334cd71bd75b
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit cdaa4c317cf1969330e3ad148e7cb0a7cb01d859)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-01 18:43:03 +00:00
Laszlo Agocs
d049d7cdba rhi: gl: Map with write+invalidate
Presumably the equivalent of D3D11_MAP_WRITE_DISCARD.
Stating READ is pointless given reading is not possible with other
backends such as D3D11.

Task-number: QTBUG-125087
Pick-to: 6.7 6.6 6.5
Change-Id: I3c0aeb2a3669d4f8c279f7ace9a8a55e92988807
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit f52018e45ff19fd487e729321b6d2d1750f33a4a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-01 18:42:56 +00:00
Laszlo Agocs
0a92c970b7 rhi: gl: Move bindShaderResources scratch arrays to be non-local
..and reusable.

Task-number: QTBUG-125087
Change-Id: I469a4f826d15635c4c825431a7a7a8aaead41823
Pick-to: 6.7 6.6 6.5
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit c7d536a83763c65c4dd789f60404ce3e283d668b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-01 18:42:50 +00:00
Laszlo Agocs
a682cb9596 rhi: gl: reduce uniform location table prealloc to 32
Not sure why we used 256 given the typical shaders used with Qt.
A prealloc of 256 means 8328 bytes on the stack, which feels excessive,
and shows up in profiler hotspots for some reason.

Task-number: QTBUG-125087
Pick-to: 6.7 6.6 6.5
Change-Id: Ibae26dae95cbc8d0e9ea53423daa151e768a93b2
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit fb2e33b65aea28609996c4e1ac59c3ee75e5b839)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-01 18:42:44 +00:00
Laszlo Agocs
9745c3d708 rhi: gl: Add missing bindBuffer
And make sure the default nativeBuffers(), used e.g. by the Null
backend, correctly zeroes out the slotCount, which will be relevant
for Qt Quick.

Task-number: QTBUG-125087
Pick-to: 6.7 6.6 6.5
Change-Id: Ia3a0ac82818821f7068b380e33a0dd42db87b349
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit d6906fb5975e7e1442836ab5c894f69c90a3e5a9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-01 18:42:37 +00:00
Marc Mutz
9c3ab9a17e QPROPERTY_TEST_COMPARISON_HELPER: fix extra leading \n in failure output
Once we ported the formatting to use formatFailMessage() in
aa8a4be9e9eae82b6c6b8875371114dbfb3ec06a, it became apparent that the
output contained an extra leading newline compared QCOMPARE use of
formatFailMessage(). We kept the newline in the patch that was picked
to older branches. Since this is a stylistic discrepancy, though,
standardize on no leading newline going forward.

Change-Id: I4badf700900a106d835f3f72e92441d8a8912ff7
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 4bc81fe5d1d1e4587075a82a45be9b34825b5233)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-01 15:48:18 +00:00
Oliver Wolff
a8a866b626 QCommandlineParser doc: Mention QT_COMMAND_LINE_PARSER_NO_GUI_MESSAGE_BOXES
Pick-to: 6.7 6.5
Change-Id: I2c3dd6000a29e23f256480076f4f832765af08c9
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
(cherry picked from commit 119e7a3038e282c18ec79c87c07884036ca3362b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-01 15:48:16 +00:00
Orkun Tokdemir
2c29abc611 CMake: Use correct project name for test_wrap_cpp_moc
Change-Id: I9cb32981eaeeb4a47176e2fbbde7ccde4554f4d1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 98ffe407fa1cdf26a488db0d842cbce31627fe09)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-01 12:46:22 +00:00
Wladimir Leuschner
c561b7197b Update QMdiSubWindow after windowFlags were changed
Adding or removing close/maximize/minimize buttons to an already
existing QMdiSubWindow is only visible after the window is repainted.
This patch repaints the QMdiSubWindow at the end of setWindowFlags.

Fixes: QTBUG-125778
Pick-to: 6.7
Change-Id: Ibdf136621bf70337a2af29dfcfd10b60dde11e15
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 6520ed0f2567c5a8fd680dccbff59c5ef8fc89c2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-01 09:38:01 +00:00
Marc Mutz
e7aa8aa118 QtTest: port approx_wide_len() from std::clamp() to qt_saturate()
The patch that originally added the function used std::clamp() because
qt_saturate() wasn't available in all the branches to which the patch
was backported. This patch modernizes the code for newer branches.

Pick-to: 6.7 6.5
Change-Id: I1b764d303e00ec04858643efed3dcc71f2c7ce4c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit d042c14c9940c6aabaa5b39d3061c0f9e50fff06)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-01 00:43:34 +00:00
Thiago Macieira
12667b77ff QFile::moveFileToTrash/Darwin: do set the error on iOS
We are returning false indicating we failed; explain why (functionality
not implemented).

Pick-to: 6.7 6.5
Change-Id: Ifb754f0e28774c20aa7cfffd17e6c97778fda575
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit d6bf56bb9268e944f75c960623a629a05b3ee6ac)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-01 00:43:27 +00:00
Mate Barany
59268b6d54 Change type of variable qssl_dhparams_default_base64
From const char* to const char[] to address a
"Character pointer is not const" Axivion warning.

Task-number: QTBUG-125026
Pick-to: 6.7 6.5
Change-Id: I0d6606c6abde5b01ec250ffb4595c89a497b7c29
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit fd8cec34965afc8ca6d7f5e844e8aab44e182c90)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-01 00:43:20 +00:00
Volker Hilsheimer
4fe0e5dbc4 Icon engines: don't paint on a null-pixmap
If the pixmap created is null (perhaps because the size is null), then
don't paint into it. It might crash as we might end up with an invalid
device context.

Task-number: QTBUG-127085
Pick-to: 6.7
Change-Id: I03b3beabe02f150a2970013c15842369d3a27596
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit b2b4bc2f2fb5de53e262c88023f278f782b80de5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-01 00:43:13 +00:00
Marc Mutz
fbbcd87039 tst_QGraphicsGridLayout: port away from qsnprintf()
Change-Id: Icf35b873fe64aa7b91c78bbd7933e1a7729cb650
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 7e256d74b3c895aeb27d53867208c4c31edfd6f0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-01 00:43:07 +00:00
Marc Mutz
c3e25c61d2 Remove dead code in qtestcase.cpp for Qt 6
This is a clean-up after a previous commit that needed the version
check for cherry-picking to 5.15.

Pick-to: 6.7 6.5 6.2
Change-Id: I914ca6ec184e2d7c376de4c7de6f2f0f7e9ecb22
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 4dd730f99fc95ad1e4c231dda70957b6c01df1b0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-01 00:42:58 +00:00
Marc Mutz
d7a8b34d4a QTest::toString(): Fix format specifier for q(u)int64 on Windows
Qt 5 had qint64 as __int64 on Windows, so using I64 was correct, then,
but MinGW was already using long long, so using I64 for all Q_OS_WIN
builds was wrong even then. So exclude Q_CC_GNU from the I64
formatting.

In Qt 6, all platforms always use long long, so no Windows-specific
handling is needed anymore.

Found by adding __attribute__((format(printf))) to qsnprintf().

Pick-to: 6.7 6.5 6.2 5.15
Change-Id: Icfa0afc6f0fe06e5d47684702097ac1d3da6cef1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit ab74c1779ec2499758449d41999356a91bb82cf8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-01 00:42:50 +00:00
Marc Mutz
821a8fd523 QPROPERTY_TEST_COMPARISON_HELPER: fix mbstowcs and snprintf usage
The mbstowcs() function is not re-entrant, and while we can probably
rule out that our test macros are being executed concurrently, we
can't rule out that other parts of the test concurrently execute
std::mbstowcs().

To fix, de-inline the code so we can re-use the existing
formatFailMessage() in qtestresult.cpp, which has already been fixed
before.

Amends 930e59b798d9e3d08e17440980d33a08fb411cbe.

Pick-to: 6.7 6.5 6.2
Change-Id: I61144af13a41ea0b4fba17bd232e660ef33dbd20
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit aa8a4be9e9eae82b6c6b8875371114dbfb3ec06a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-01 00:42:42 +00:00
Marc Mutz
8777e13b5a QTest::formatFailMessage(): fix use of std::mbstowcs()
This function is not re-entrant, and while we can probably rule out
that our test macros are being executed concurrently, we can't rule
out that other parts of the test concurrently execute std::mbstowcs().

Use the re-entrant version and also fix the format string (%* requires
int, not size_t).

Saturation is ok here, because, while std::mbsrtowcs() will happily
return a value > maxMsgLen when dst == nullptr and the string is
longer, we will never actually print more than maxMsgLen of it.

As a drive-by, port to std and adjust the QNX comments to describe the
quirky QNX behavior, if, indeed, still present in the <cwchar>
version, better. This author had to go back in the git history to
figure out what it wanted to tell him.

Amends 2d8028d696a86102a7753f9d59fb41f4170181a8 (mbstowcs) and
d040681b6f3d03b349e9b9487fe89a611d03ee3c (%*).

Pick-to: 6.7 6.5 6.2 5.15
Change-Id: I6215713c643647727f73f4e2f2a7ac34204af40d
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 1579b18dfa49252318b4a2b3cfa83a4ce325ba0c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-31 15:52:28 +00:00
Marc Mutz
e4a03a4001 Fix -Wformat issues in our headers
Before we add __attribute__((format(printf))) to qsnprintf(), we need 
to make sure our code is clean.

Pick-to: 6.7 6.5 6.2 5.15
Task-number: QTBUG-127110
Change-Id: I7411ff0036482ad68bd5867b624518f68f249229
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 63295f43e70955a194602a7acf39013f124e14b7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-31 15:52:12 +00:00
Mate Barany
d520bfe803 Initialize error in QSslErrorPrivate
Axivion warning: "Compiler-generated constructor leaves some fields
uninitialized."

As the constructor of QSslError sets the error to QSslError::NoError
do the same in QSslErrorPrivate with NSDMI.

Task-number: QTBUG-125026
Pick-to: 6.7 6.5
Change-Id: I0db85dffb5eda3a6c768e326f87a01f8c176e4f1
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit bc34fe0e351d682584387dbfe5adee06ff59895c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-31 15:21:38 +00:00
Giuseppe D'Angelo
6e2c9dc7a6 QKeyCombination: move the operators into namespace Qt
QKeyCombination comes with a few operators that combine a Qt::Modifier
and a Qt::Key. These operators are normally defined in Qt's own
namespace (which by default is the global namespace), but indeed the
arguments are declared in the (nested) namespace `Qt`. This is wrong,
as their lookup will fail if a user places an unrelated operator| in
a custom namespace U and then tries to use QKeyCombination's operators:
the overload in namespace U will hide the ones defined globally;
unqualified lookup (as per [over.match.oper]) will search in the
namespaces associated with the parameters (QtNamespace::Qt), but the
operators are *not* in there!

In other words:

namespace NS {
  X operator|(Y, Z);
  auto kc = Qt::Shift | Qt::Key_A;
}

fails to compile if QKeyCombination's operator| is *not* defined in the
`Qt` namespace.

Fix this by indeed defining the operator where it belongs. The functions
are all inline and non-exported so there should not be any ABI issues.

Change-Id: I6d7a4e976fb109b7bf514011142b9a9573e507c5
Pick-to: 6.7 6.5 6.2
Fixes: QTBUG-126820
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 1f77e8566f71d98f4bc6bbf5092594e67a32f268)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-31 15:21:36 +00:00
Marc Mutz
f209e81d0f tst_selftest: port away from qsnprintf()
Change-Id: I6ef71b7229f6740dde993fcb5b9bbf29a6a07cef
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 8bc84da8e0b50b117ba9c0006816cdb7f0a078ec)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-30 16:47:38 +00:00
Marc Mutz
a228f1f399 ipctestcommon.h: port away from qsnprintf()
Use std::snprintf() instead. Also use qToUnderlying() instead of
explicit cast to unsigned (so the compiler warns us should the
underlying type of he QNativeIpcKey::Type enum ever change) and
applyRAII to temporary toString() results.

Amends 32a06e983073080d939b4742996a3dc9cd75bb83.

Pick-to: 6.7
Change-Id: I4dd00672382d377285d722a47d998bdf12422eb4
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit ce7b8fc91d82402cbed230e83c00cab3a54f9916)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-30 16:47:32 +00:00
Alexandru Croitor
37dc5b91fd coin: Add instructions for running license checker during test phase
Add yaml instructions to run the license checker from the qtqa dev
branch, when the LicenseCheckV2 feature is enabled.

This is intended to replace the old legacy instructions that are
hard coded into Coin, that are activated via the 'LicenseCheck' and
'UseLegacyInstructions' features.

We can't reuse the old name and remove the 'UseLegacyInstructions'
feature, because Coin expects license checking instructions to be
added to a separate 'LicenseCheck' phase in the yaml file,
and doesn't allow doing it in the 'Test' phase.

A platform config should enable both the LicenseCheckV2 and TestOnly
features, to ensure the license checking doesn't wait for the build to
finish before running.

The instructions are added to
coin_module_test_template_v3.yaml and
coin_module_test_template_v2.yaml
so that we don't have to add them manually to all repo's
module_config.yaml file, but rather reuse the existing yaml files.

We add the instructions to the v2 file as well, because not all repos
have been ported to v3, like qtmqtt, which is not ported on purpose,
because tests don't pass there currently.

Note that so far, all license checking was done using the qtqa master
branch, not the dev branch. The dev branch currently has more changes
than master (many changes were not cherry-picked). That means that the
check might fail in some repos, and thus have to be fixed.

Task-number: QTBUG-124453
Task-number: QTBUG-125211
Task-number: QTBUG-125569
Task-number: QTQAINFRA-3935
Change-Id: I715b99853aa041cb036d6b61b071746f010565d0
Reviewed-by: Toni Saario <toni.saario@qt.io>
(cherry picked from commit 2a0e89981a52633c497f62bad0c7d26c466493cb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-30 12:50:37 +00:00
Mate Barany
29df33a1a4 Remove default case from QNetworkReplyHttpImplPrivate::convert
QNetworkRequest::Priority has three possible values and all of them
are handled already by the switch. The default label also disables
-Wswitch, so remove it.

Pick-to: 6.7 6.5
Change-Id: I971a41ef9cbce237f5ff6ae5d28408cbf612eae3
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 645f954d358117ebf1130ac9adc29b0835dad9d4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-29 12:30:02 +00:00
Mate Barany
779ff8f333 Initialize all data members in QNetworkAccessCache::CacheableObject
Address the "A constructor must initialize all data members of the
class" warning.

The class should accept initial values as argument of a (possibly
protected) constructor if it expects them to be set by a derived
class.

Add an enum Option and a protected constructor that can be called
by the derived classes with the enum values.
This makes setExpires and setShareable redundant so remove them.

Found by an Axivion scan.

Pick-to: 6.7 6.5
Task-number: QTBUG-125026
Change-Id: Ia8a2a19469a2c0185b5d2e6b2a0895e897f33f28
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 36aa5fc3fa361ecb6f7bb035c3cace3dd14735e0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-29 12:29:56 +00:00
Liang Qi
b17e92952a Blacklist: tst_QGraphicsAnchorLayout::layoutDirection for Ubuntu 24.04
Task-number: QTBUG-87728
Task-number: QTBUG-125446
Change-Id: I13e3e49b005e27162c4a1ad3bb89b401ff7b9a7e
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 0c0f57dd1ea27239255e77820e10f598d0f72551)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-29 11:12:41 +00:00
Petri Virkkunen
45f361e97e Android: Warn user if backend register does not have requested interface
Just in case, warn user if they are trying to use callInterface on an
interface that does not exist (probably has not been registered)

Change-Id: I1a4b2226cfecd139e36ab6386ea2fe868bd73f3f
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
(cherry picked from commit 6643e97a89f06f0c32c3dff8b2c343eaa76c0e85)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-29 09:12:04 +00:00
Christian Ehrlicher
bb3f1cc62a QImage: remove outdated version check
Remove an outdated ifdef which was already always true.

Pick-to: 6.7 6.5
Change-Id: I99b645ac3465e81641813726ef1004770561d554
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 959eaa88f213c31040d58cda1b5edb1b773855e4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-27 10:23:10 +00:00
Mate Barany
2beaf27122 Do not use non-POD global static variable in qrestaccessmanager.cpp
Replace it with a static variable that is in a static function.

Found by an Axivion scan.

Task-number: QTBUG-125026
Pick-to: 6.7 6.5
Change-Id: I190003b2c798ceddfaf22bbf83786d8e98677721
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit f4d2f3d1d158b501f0373f13cab12243ab99b3c5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-26 16:44:05 +00:00
Mate Barany
406ddb88f8 Do not use global static non-POD variable for backend name
Replace it with a static variable that is inside a static
function.

Found by an Axivion scan.

Task-number: QTBUG-125026
Pick-to: 6.7 6.5
Change-Id: Ic85b683fddb18a389f1d461e4f7ab6b08bf8c3ec
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 51dbdb6f9bf41fa2d7a30c598e9bdc61eaece281)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-26 16:43:58 +00:00
Mate Barany
4ed494f4ad Use QscopedValueRollback in startRequestSynchronously()
Use QscopedValueRollback in
QHttpThreadDelegate::startRequestSynchronously
to handle a "Potentially leaking reference/pointer to local variable"
warning.

Found by an Axivion scan.

Task-number: QTBUG-125026
Pick-to: 6.7 6.5
Change-Id: I18c7b9e2f4f8093393176eedfb3ed5a2604bf51b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 41f6338a7d8b848008d7906016bda498c13928e1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-26 16:43:52 +00:00
Petri Virkkunen
191969e432 Android: Make QtEmbeddedDelegate register a QtInputInterface backend
This was missed in the original patchset, should improve some input
functionality in embedded QML views.

Change-Id: Ie6c8e28d11c5c5336dd291027a179462c0b3529c
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
(cherry picked from commit ca97e445bc976c1d89ac99e89cec4eeaec127b0f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-26 14:38:55 +00:00
Mårten Nordheim
c861e01300 Http2: RST: Also checking peer stream IDs for idleness
A peer can send a RST_STREAM frame for their own stream, so we have to
check if one such stream has been active instead of just our own.

Change-Id: I5a46b10df98809ed3d803bfb1a92a45ab7f7d961
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 0026b17eff313a0bb248a8d04593eb80f16f315d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-26 12:34:45 +00:00
Ivan Solovev
61ae6f1c8a Remove QArrayDataOps::compare()
Replace the only usage in QList with std::equal().

Change-Id: I2176b51a2943e0523073a435484a53a1c4ecb635
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 71a1f7c1ea2d11c5e84be5c9956f70c609bb8ebe)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-26 11:22:38 +00:00
Jaishree Vyas
ceaf5b9a2b Doc: Documentation for QList classes should mention how to sort them
Added a statement in the QList descriton and linked it to the
Qt containers and std algorithms

Fixes: QTBUG-94993
Change-Id: I12b75d147cb6e80036133547cc6365b3325c7e28
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 4f66c10ba2f6234b7d404e7617b86eff567d657b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-26 11:22:34 +00:00
Ivan Solovev
f53074c747 QArrayDataOps: fix FP equality comparison
We cannot use memcmp() for that, as it incorrectly results in two
NaN values being equal.
Simply replace the whole self-written algorithm with std::equal(),
as it's doing the same thing, but lets the compiler decide when
to do the optimizations.

Amends db89349bdba2fcc03b2f7e2d23f549a9ec5dc0e3.

[ChangeLog][QtCore][QList] Fixed a bug when two QLists holding NaN
values were considered to be equal.

Fixes: QTBUG-127473
Pick-to: 6.7 6.5 6.2
Change-Id: If7e77549b4cbeb96711893d14344b9e0a40c1a87
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit cb3faeba3d9411ba82c311751bd7de36d0fec939)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-26 11:22:32 +00:00
Thiago Macieira
7a31702345 QOffsetStringArray: fix off-by-one error for the past-the-end elements
For legacy reasons, the accessor class allows operator[] to go out of
bounds and just returns an empty string. However, we were returning a
pointer to the one-past-end of the array, which appears to have been a
null byte in the test.

Instead of adding branching code to load the length of the first string
in operator[], we can just add an extra null character at the position
we were returning anyway.

Pick-to: 6.5
Change-Id: I4878533dcb2d4b3e8efefffd17e4f876b43e9ee3
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 8a768fe7db6ac5388fec6a68687817796b44439e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-25 20:06:41 +00:00
Liang Qi
3111b7b52a tests: skip tst_QWindow::framePositioning() on Wayland
This amends 31ec108dd08d6381a15e49b6fbec9337705c3b2a .

framePositioning() was split from positioning(), which was skipped
before.

Pick-to: 6.7 6.5
Change-Id: I23dcfbe6012bb44c9b7c343b963e7338ddd16f28
Reviewed-by: David Edmundson <davidedmundson@kde.org>
(cherry picked from commit e2165f0198ec09c5c0faa6bdb3dbec3b9ca482ab)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-25 20:06:41 +00:00
Liang Qi
eadaecdc63 tests: skip tst_QApplication::abortQuitOnShow() on Wayland - 2
This amends 91079e64d89be5dbec6c9f33f84d3e483aec31e0 .

It needs to have a QGuiApplication object before the check.

Task-number: QTBUG-123172
Change-Id: I51929431e69e4584c46e2dc08ca9c33b48b900c6
Reviewed-by: Inho Lee <inho.lee@qt.io>
(cherry picked from commit e743931294d9d9c4e5a27d2644fd1cd354ce56cb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-25 20:06:40 +00:00
Giuseppe D'Angelo
0fa33b8c61 Disable -ftrivial-auto-var-init=pattern on GCC < 14.2
GCC generates broken code with that option enabled, see
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115527 .

For simplicity I'm not building a comprehensive set of GCC versions
which do have the fix applied; I'll just exclude old ones.

Change-Id: Ia2f128cac633f8d72d5aedc5efe4e64e1c40c51b
Fixes: QTBUG-127507
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 6c11f40701e9a406942dbcd2920c9b7d56b4af72)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-25 20:06:40 +00:00
Ahmad Samir
8d99b980e6 tst_QLineEdit: use qWaitForWindowFocused() on Wayland to fix some tests
QTest::qWaitForWindowActive() isn't supported on Wayland, however in
these tests what's required is a specific widget having keyboard focus.

Pick-to: 6.7
Change-Id: Ib47431351f60f4ee31d67563ce1892dc2e8149eb
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit 3d3faa128508b6eb5fd656330cf3be0097844abb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-25 13:35:17 +00:00
Jøger Hansegård
b64e918c85 Call std::addressof instead of operator& in QDebug::toString
QDebug::toString intends to pass the input object's address to its
nested implementation, but was calling operator& which does not work
with types that has a custom overload. Calling std::addressof fixes this
problem.

Fixes: QTBUG-127510
Change-Id: Ie608f7b1a63c4032246b6ff98a3651695f0536ca
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 6cd6c3d6d70f8e76059153dd58ed2c61af2889b3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-25 11:21:35 +00:00
Alexandru Croitor
633013827a coin: Unset DESTDIR after installation
Keeping DESTDIR set to "{{.InstallRoot}}" after installation has
potential to break other unintended CMake file(INSTALL) calls that
take DESTDIR into account.

This already happened for the CMake macOS POST_BUILD deployment API,
which accidentally installed into the install root, when it shouldn't
have.

Unset the DESTDIR env var after we install Qt.

We already do that in the cross-compiling Coin instructions, so this
brings uniformity to the host builds as well.

Task-number: QTBUG-90820
Task-number: QTBUG-96232
Change-Id: I6aca31e36c67c8d4b293efd746c37a42ea9ca834
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 02cb165ef8050230b477358e4136e9f0acd83eb6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-24 20:14:21 +00:00
Morten Sørvig
00a1bdfbe1 wasm: set input element position on startup
Follow-up from commit c844a7a5.

The input element was taking up space on the html body,
and was offsetting the Qt app content, making it partly
invisible.

The element already has position: "absolute" which should
remove it from the layout, but it looks like it needs
to have a set position as well on some browser for that
to happen.

Pick-to: 6.7
Change-Id: I618d2561eb32e181797034d0b3005d716d4f6136
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Reviewed-by: Inho Lee <inho.lee@qt.io>
(cherry picked from commit 59645a409b4b2a68a329b61d7e5837b6fd651a48)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-24 16:49:20 +00:00
Mate Barany
305880fcda Initialize wrappedUploadByteDevice as nullptr
Axivion warning: "Compiler-generated constructor leaves some fields
uninitialized."

Initialize the wrappedUploadByteDevice as nullptr just like the other
pointer member variables.

Task-number: QTBUG-125026
Pick-to: 6.7 6.5
Change-Id: If4e0a0e169b1256e8aca3596d26d5532fc950a4d
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 804fae2e463c1be34dc1e40207e4e715e3e2f1d4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-24 15:31:41 +00:00
Mate Barany
bfd7fce59c Remove the Receiver struct from qnetworkaccesscache.cpp
Found this by an Axivion warning: "Compiler-generated constructor
leaves some fields uninitialized." but it seems that this struct is not
used anywhere else, so instead of initializing the member variable just
remove the struct.

Task-number: QTBUG-125026
Pick-to: 6.7 6.5
Change-Id: I09bb8936241ece148debbd572c8441dc9d998ff9
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit a427e75d826c40cf3d39683bb7bd63126f00329f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-24 15:31:35 +00:00
Mate Barany
22c5f8974c Initialize some member variables in qsocks5socketengine.cpp
Axivion warning: "Compiler-generated constructor leaves some fields
uninitialized."

Initialize the ports as 0 and the udpSocket as nullptr.

Task-number: QTBUG-125026
Pick-to: 6.7 6.5
Change-Id: Ifa021aceea35e7c5e8c62cd2d6f651d422d629a2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 0e6d0af9af65ff41ea7c07cd7b53c365d61ca643)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-24 15:31:29 +00:00
Mårten Nordheim
10d7da6168 Http2: Use the enum for error codes and fix bugs
The code was all initially taken out of the QNAM protocol handler,
so it was using QNetworkReply error-values somewhat liberally.
That means it would emit quint32s with values from two different
enums and no good way to tell them apart.

Instead, just use the Http2Error enum for everything.

Pick-to: 6.7
Change-Id: I31be4e3ac8f0439478c22b173cd8830550d16ddb
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 28dd5e0a716039a058b9156509909c2da639909a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-24 12:55:43 +00:00
Alexandru Croitor
dcacb0be97 coin: Enable generation and linting of source SBOM
This will enable generation and linting of source SBOMs only if the
repository source root contains a REUSE.toml file. Otherwise the steps
will be skipped.

Task-number: QTBUG-122899
Task-number: QTBUG-125211
Change-Id: I87ea9aad7fb4f15ec7fa9d00072c81cddbe7ea2c
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 186d368f0d613d7d1b60a6d1dc197269ab4db8f8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-24 12:38:21 +00:00
Alexandru Croitor
0da10e9b22 CMake: Allow generating and verifying a source SBOM using 'reuse' tool
Add code to generate and install a source SBOM SPDX file for every
repo. It relies on the python 'reuse' tool being installed and
available in PATH.

Also add code to allow running 'reuse lint', which checks compliance
with the reuse specification.

The features are only enabled when configuring with
 -DQT_GENERATE_SBOM=ON
 -DQT_GENERATE_SOURCE_SBOM=ON
 -DQT_LINT_SOURCE_SBOM=ON
which will be the case for our CI in a follow up patch.

Because most of our repos are not yet reuse compliant, the actual
generation of the source SBOM and the linting is skipped if the
project root directory does not contain a REUSE.toml file.

This allows incremental handling of each repository, while also
enforcing the compliance at installation time when the REUSE.toml file
is actually there.

The source SBOM generation and linting will run at installation time,
but they can also be manually triggered at build time using the
ninja 'sbom' and 'reuse_lint' custom targets.

Various opt outs are provided as a fail safe:
- QT_FORCE_SOURCE_SBOM_GENERATION to force source sbom generation
  even if a REUSE.toml file is not present in the root source dir
- QT_FORCE_REUSE_LINT_ERROR to force linting to error out, even if
  a REUSE.toml file is not present
- QT_FORCE_SKIP_REUSE_LINT_ON_INSTALL to skip linting at installation
  time, but allow running it at build time

These can be set either locally or conditionally passed to CMake
inside repo-specific Coin instructions.

Task-number: QTBUG-122899
Task-number: QTBUG-125211
Change-Id: I664e69830936c4427688143ee86b98782c1733ab
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 6d9b4291746907e30ea49ac0adf8608ad8a1129b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-24 12:38:15 +00:00
Alexey Edelev
1647193afa Make the android multi-ABI builds with Unix Makefiles pure sequential
Add the missing dependency between qt_internal_android_<abi>_configure
and the last target from previous ABI-specific step in the chain.

This slows the Unix Makefiles builds, but ensures that there is no race
condition when executing configuring step.

Also as a driven-by fix the _qt_android_abi_steps property list, by removing
the parazite -NOTFOUND entries.

Pick-to: 6.7 6.5
Fixes: QTBUG-127414
Change-Id: Ibb69dcdebd2052a7aa1d4bd0c3f657cdeb312f37
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 924dd10afc9f9137ce2da7643306d8df511c6ab9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-24 12:38:11 +00:00
Alexandru Croitor
82d9b18535 CMake: Introduce sbom 'output file path without extensions' variable
Some operations might want to install additional files next to the
repo sbom, with the same file base name as the repo sbom file name.
E.g install qtbase.source.spdx.json next to qtbase.spdx.json.

Make the output file path without the extension available in a new
QT_SBOM_OUTPUT_PATH_WITHOUT_EXT variable during installation.

Task-number: QTBUG-122899
Change-Id: I0b9442cffa3f3b0fd2387e77569a94e43ce387a5
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 35bd5df58932299221ad475ebaf25e2c0492e6a0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-24 12:38:08 +00:00
Alexandru Croitor
551e01c124 CMake: Allow opting out of Intel CET hardening
Some Qt internal targets might not work correctly when built with
Intel CET hardening.

Add a per-target opt out to skip adding the Intel CET flags.

Task-number: QTBUG-127464
Change-Id: I1a28b228a82b3505d987649eec6db08281c15482
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit c5e42a9d2faef611e3a6d124d5b093670346fb87)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-24 11:48:45 +00:00
Mate Barany
873bacc549 Rename signal in QNetworkFile
Address the "Overloaded signals should be avoided" warning: there
is already a method named "error" in QFileDevice, rename the signal
"error" to "networkError".

Found by an Axivion scan.

Pick-to: 6.7 6.5
Task-number: QTBUG-125026
Change-Id: I2f1b5752238aca614af82a94e2918399c582f74d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 7f0450a47f2cab8c0482131475eba7162f4bdf8f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-24 09:19:02 +00:00
Kai Köhne
5cd80af50f Doc: Make it explicit what QJsonParseError::offset refers to
Pick-to: 6.7 6.5 6.2
Change-Id: I278929f89e9e6f9f4461558dc0dd949d0455dcb1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit e00a032eac1a234c0846571a0e8a6ac1e5c411b7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-24 09:19:00 +00:00
Lorn Potter
a065afa40b wasm: set status code before readyRead is sent
Pick-to: 6.7
Change-Id: I6f0360158cf6fe728eb49f61dc0ec819924e96e2
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
(cherry picked from commit cd213bb750cb6619defeb700aea270f016c6cd19)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-24 05:21:22 +00:00
Axel Spoerl
5413d4b460 Minor code cleanup QTestPrivate::parseBlackList()
Constify local variables, where possible.
Remove redundant include.
Bump (c) year to 2024.

Change-Id: If13fb87b306926cb94f75186071a1dff2969a945
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 6de2203fb75e034c1a02478daa13e8ddfcea5d75)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-23 22:52:53 +00:00
Ahmad Samir
d04e4bac4f tst_QMimeDatabase: update shared-mime-info local testing instructions
Also store the version in one variable and reuse it, to make it easier
to update in the future.

Change-Id: Ib843a1cfa5c53233f9daa6c373d238f756eb4853
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 922e197bd3468d4c10b8fcd6377cd7b67f2541f2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-23 22:52:53 +00:00
Alexandru Croitor
2d4f6ec8a1 CMake: Improve SBOM PURL handling
Tools that consume SBOMs expect that each SBOM package will contain a
unique purl: https://github.com/package-url/purl-spec

Each Qt target maps to an SBOM package, so generate a target-specific
PURL for each Qt target, by using the combination of the repo name
and target name as the purl name.
The purl external reference will then look something like:

ExternalRef: PACKAGE-MANAGER purl pkg:/TheQtCompany/qtbase-Gui@6.8.0

Also allow customizing the purl for each target by specifying one of
the following options to functions like qt_internal_add_module or
qt_internal_extend_sbom:
- PURL_TYPE
- PURL_NAMESPACE
- PURL_NAME
- PURL_VERSION
- PURL_SUBPATH
- PURL_QUALIFIERS
- NO_PURL
- NO_DEFAULT_QT_PURL

Task-number: QTBUG-122899
Change-Id: I6926dd773a0ef6fc688664bcac7b23483ecbabe6
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit f6fdc1fe5fde253d7e70a2d2bbef42e9c411956e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-23 14:29:39 +00:00
Gary Wang
44a17e9a36 QJpegPlugin: also recognize jfif suffix
Currently QJpegPlugin can load JFIF image without issue, but didn't
register jfif as recognized suffix. This add the support for jfif
suffix and will load the image as regular JPEG image.

Qt image formats plugins doesn't care about the extra metadata provided
by image itself, so it's fine to simply use the existing QJpegPlugin
to load JFIF image files.

Change-Id: I880d7603f356fbb01af7de8e4fb62fa010a0fd1f
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 68f58ce198a794e7b2890f1127c99e0395d105a5)
2024-07-23 09:15:31 +00:00
Giuseppe D'Angelo
e358eb3bab QCompare: add more relational operator overloads
libc++ has a "poisoned" set of relational operator overloads for
the standard category types. A call like

  std::strong_ordering::equivalent == Qt::partial_ordering::equivalent

fails to compile, despite the presence of

  operator==(std::partial_ordering, Qt::partial_ordering)

This is viable after converting strong_ordering. But strong_ordering
itself defines a

  operator==(std::strong_ordering, CmpZero)

where CmpZero is poisoned and accepts Qt::partial_ordering, making
the call ill-formed.

I'm not 100% sure if libc++ is right here (cf. the linked upstream
bug report for some ruminations). We can work around this issue by
adding sufficient additional overloads to Qt::partial_ordering and
be a perfect match. For some reason this was already the case for
the other Qt's comparison types.

Notes:

1) I didn't test this. Only libc++-trunk defined the necessary C++
   feature macros to trigger the problem; I made a synthetic testcase
   and it worked.

2) I'm not sure why these operators are defined symmetrically instead of
   relying on C++20's reversed operators, but I'll follow the
   pre-existing ones.

Change-Id: I0937f40b7e685026d4677e7918948d47d2b7cec6
Pick-to: 6.7
Fixes: QTBUG-126541
Task-number: QTQAINFRA-6203
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
Reviewed-by: Khem Raj <raj.khem@gmail.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit b892b39a7a6c50eb5bbf03f0c9f01bdd07756f13)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-22 23:51:33 +00:00
Mate Barany
0e9046f20d Include qnetworkglobal_p.h into qocsp_p.h
Addressing a "Q_OS_WIN should not be checked before qglobal.h is
included" Axivion warning.

Task-number: QTBUG-125026
Pick-to: 6.7 6.5
Change-Id: I78c3df04a92aab8753c2651502d7893822523ed0
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit df3c9f365f9543ec6491354f11103280ded0f3a9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-22 22:10:24 +00:00
Mate Barany
c7de578712 Initialize the expiryTimeoutSeconds variable in CacheableObject
The variable expiryTimeoutSeconds is set by the function
QNetworkAccessCache::addEntry and as a parameter is defaulted to -1
so initialize it to -1 with NSDMI.

Task-number: QTBUG-125026
Pick-to: 6.7 6.5
Change-Id: I8a96c2acbf94be409529200801d4d7169e852ac1
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 9e75236a0dd157ca85e6f38870fac37214b683b2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-22 22:10:18 +00:00
Christian Ehrlicher
28e8a377f1 QWindowsScreen: use correct return value of SetupDiDestroyDeviceInfoList
SetupDiDestroyDeviceInfoList() returns TRUE (1) and not ERROR_SUCCESS
(0) so an assertion is triggered falsely on destruction.
This amends 5183ca14344c04015b32ef407e4cdad1b370c841.

Pick-to: 6.7 6.5
Task-number: QTBUG-127168
Change-Id: I03ea601e35c0cbcf44080379853e33362568122c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit fcaaebd5c8d5323f050fdcf07d16dc37bdba197b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-22 21:18:26 +00:00
Marc Mutz
a0c9b5f020 tst_QList: port away from qsnprintf()
Change-Id: I9ad99a06b2d645108eae3bf9d74e08d95d31f8fc
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit a90a1ebac8b07e6cb8e0b62eefb714a77bb3ed8f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-22 21:00:13 +00:00
Marc Mutz
57ad4caa7b tst_QDeadlineTimer: fix format-string in toString() implementation
The second value (like the first) has type qint64 (aka long long), so
%d is wrong; need to use %lld instead.

Found while porting to std::snprintf() (qsnprintf() never actually got
the __attribute__((printf)), so compilers didn't warn).

Drive-by replace qAbs() with std::abs().

Amends 13c3558fe9967391374555cfeb3209b961a86084.

Pick-to: 6.7 6.5
Change-Id: I9082a1aceefe8a5b04ad0d5725ab666e23483b29
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 61e4be2b62f9b6556a145f226850bf5e62d53e9d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-22 21:00:13 +00:00
Marc Mutz
c9b55d8b39 tst_QStorageInfo: port from qvsnprintf to std::vsnprintf()
Drive-by make a variable const.

Change-Id: I90231330d15edfdef8bc182ed917b80a4c413d2d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 829caad5e773245b7d712bce4b7e53e9377e3764)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-22 21:00:12 +00:00
Christian Ehrlicher
f9d6c8b14c QSqlDriver/doc: Add a note about features depending on the db server
Some features are server-dependent and therefore an open db connection
is needed to make sure that the feature is available.

Pick-to: 6.7 6.5
Fixes: QTBUG-10016
Change-Id: Ia9a117a64ba5fe7cdd69bf95a41cfc301ab5fd94
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 139b8779469244dd1aa226dd3222e6e4aeb2c932)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-22 21:00:12 +00:00
Marc Mutz
205e3a8dc8 ipctestcommon.h: add #pragma once
The file had no protection against multiple inclusions. While current
code doesn't include it multiply, prevent it from becoming a problem
in the future.

Pragma once is sufficient, as this header is not installed.

Amends 32a06e983073080d939b4742996a3dc9cd75bb83.

Pick-to: 6.7
Change-Id: I97bbbb80f46c0e587288e8ebb4fa06ddd2e892be
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 235bb0926a94a73655a266c0ac038fa3a0a982cd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-22 21:00:12 +00:00
Christian Ehrlicher
4ab6fc7215 SQL/QSqlRelationTableModel: don't crash with more than one relation
When more than one relation is used, an internal container might be
resized which can lead to a reallocation. Since the internal data
structure holds a pointer to an element of this container, this pointer
is invalidated after the reallocation. Therefore store a QSharedPointer
instead.

Pick-to: 6.7 6.5
Fixes: QTBUG-60674
Change-Id: I18c6157c7328be201f8b89a7ca12f423a86d9b71
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit c0aabbd8a0c5a01c2048bcaf36525570a8e0bb35)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-22 21:00:12 +00:00
Marc Mutz
c342496831 QPlainTextLogger: FixedBufString: simplify appendf()
qsnprintf() does not make a difference between lvalue and rvalue
arguments, so the wrapper doesn't need to perfectly forward.

Use decay-copy via by-value arguments to potentially reduce the number
of instantiations required for the existing calls.

Adjust indentation so the continuation line doesn't need to be
re-indented when we'll port qsnprintf() to std::snprintf().

Amends 0e8eb20af43ca473b7a7639bb2941c9e6bad537b.

Pick-to: 6.7 6.5
Change-Id: Idcaa441517fdbf00fefd952db7928731779123ab
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit fba67959acb7be39942aa3ce829f6764c46ad3ee)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-22 21:00:12 +00:00
Allan Sandfeld Jensen
5e94d455db Add rvalue versions to new convertedToColorSpace method
Change-Id: I484d8a4258c2a0597549b6bdc6b7e5c144d3cf10
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 20e81dbe29cd9964b1a536901eba7f2c192385ef)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-22 17:08:52 +00:00
Allan Sandfeld Jensen
db78bba3f4 Avoid crashing with plasma-integration
Move the virtual to at least make us call the right methods still when
encountering a platformtheme compiled against an older version

Change-Id: Idb6e75b71889c04b2a11e94492d0906dc8ddc84f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 2b66952b83f048ebaf896691178910ed4e466ede)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-22 14:47:55 +00:00
Ahmad Samir
f5971dc78a QDirListing: add API docs for DirEntry
It's part of the public API.

Drive-by change: add `\ingroup io` to QDirListing too.

Fixes: QTBUG-127152
Change-Id: Ic327cbb8742dfd323cae9f7135a7590d14819869
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 8fc89a4637214a0724a2abb5f47c16487d4fffea)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-22 14:47:54 +00:00
Mårten Nordheim
78e167ab7b tst_http2: stabilize duplicateRequestsWithAborts for macos
The test relies on things ending up in the h2RequestsToSend container
internally. For h2c we would have to use the http1 upgrade mechanism,
and while I have not verified it, it seems to not reliably put
enough requests in the container, and so the test is flaky for macos,
which is the only platform where we use h2c. In CI at least.

Fix it by forcing it by using h2 direct, which will work even on macOS
without server-side ALPN.

Pick-to: 6.7 6.5 6.2
Change-Id: I55816d400baa831524100f075e1b50fd3d9781a6
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 4e827e42e339a2774be26ba844bd5e87a14d83b5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-22 14:47:51 +00:00
Alexandru Croitor
3f89719a4b CMake: Allow marking incomplete 3rd party deps for a target's SBOM
For some targets, it might not be possible to specify all 3rd party
dependencies information for SBOM generation.

qtwebengine is one of these cases, where the 3rd party targets are
only known to GN, and not CMake.

Add a new SBOM_INCOMPLETE_3RD_PARTY_DEPENDENCIES option which can be
passed to qt_internal_add_module and friends.
This will include an informational message into the SBOM package
comment field that the dependency information might be incomplete.

Also add an SBOM_PACKAGE_COMMENT option, which can be used to provide
further information if necessary.

Task-number: QTBUG-122899
Change-Id: I5e893e1e205aae4a5591a457be88d5db54fa8fc3
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 04ade5acc923ae04142004551ce8c7560517d192)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-22 13:16:24 +00:00
Alexandru Croitor
7dd7e5038c CMake: Fix invalid option passed to _qt_internal_generic_deployqt
EXECUTABLE is not a valid option name, EXECUTABLES is. The latter is
already passed.

Remove the EXECUTABLE option, and add a guard to show an error when
there are unparsed arguments.

Task-number: QTBUG-127404
Change-Id: I981f6e53925d9b4a9e7ee23f6e80c69dc41e42e8
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 869c6ee890ee740b9e99eca44730524d6a45d4b6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-22 12:12:31 +00:00
Marc Mutz
853f7b661f QDebug: make toString() SCARY
Extract the non-template-dependent code into an out-of-line function
and pass the actual streaming operation as a callback.

Saves 4% (174811→167936) in executable size for tst_qdebug and 2.7%
(93639→91122) for tst_tostring on Linux GCC 9 AMD64 release builds.

Change-Id: If232e5b26c66981ffcb614f1bdb7007c71e879bf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 5cdd1f594d26e1d4f84b00741be1ab7231458512)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-21 23:06:54 +00:00
Marc Mutz
fbef250c6c Fix (unlikely) truncation in write_xbm_image()
The usual qsizetype -> int problem. Fix by using auto.

Change-Id: Ie990dec39c8c33cdc055da6bfee451319825c934
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 0cef4ae6870fdd57fd908cdecde3c6c426b7321e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-21 23:06:53 +00:00
Igor Khanin
d84105e71f Fixup QTextOption enum formatting
Add missing trailing space, and change to newer "since Qt version"
format for relevant enum values.

Pick-to: 6.7 6.5
Change-Id: Iffe959545d9d608a65c41c8d3ad56f16468cfa73
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit f7d1d5cb0110552c276ff7a4d8bfb79bf1129c87)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-21 23:06:49 +00:00
Marc Mutz
334a83e4a7 Fix potential truncation in write_xbm_image()
The old code sized the buffer according to the UTF-16 size of the
input, but in fact wrote UTF-8 output, which can be up to twice as
large as UTF-16, overflowing the buffer size. Not a buffer overflow,
because qs_n_printf(), but truncation would create an invalid XBM
file here.

Fix by converting to UTF-8 first (and only once), and taking the
buffer size from there.

Introduced by 2883a6de408c991ecf6184d7216c7d3de6fa4f4f, which replaced
toAscii() (whose result has the same size as the input) with toUtf8()
(which can be larger).

Pick-to: 6.7 6.5
Change-Id: I4acc0816a94060520695c3e6895ed982812fdee2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 6d3bd0ebeacc76178fc3c4c368e04bd642881a96)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-21 15:01:31 +00:00
Marc Mutz
c8771a3082 QDebug: make Stream ctors explicit
Their argument types are not faithful representations of a Stream
object, so ctors should not be implicit. Besides, the QDebug ctors
that delegate to these Stream ctors are explicit, too, with the same
arguments.

Change-Id: I8048e26e890009cc8f6bc3ce49e2c01af1e89514
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit a9ab406a69f4edc4228cc2effbcde309fcdcf411)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-21 15:01:31 +00:00
Marc Mutz
0471e845e4 qtesttostring.h: don't write 32..256B of NULs
qsnprint() is unconditionally called to fill the buffer and is
guaranteed to NUL-terminate, so there's no point in filling the whole
stack buffer with NULs beforehand. Leave it uninitialized.

The code was moved in 4ae6f40b3a2e2fe4f617a1c911c8d066c18cdab9, so not
picking further than that.

Change-Id: I34d456ebd2990aa242ccc42693adbbf1f64148de
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 4c5b437a3ce84354dfa3bf2c4706e05144ac03a3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-21 15:01:31 +00:00
Marc Mutz
ae515c3f2e Fix signature of QDebug::toString() (again)
There are zero QDebug operators that take an rvalue RHS, so there's no
need to make toString() perfectly forwarding. It just causes four¹
different versions of the identical function to be instantiated. Not
all compilers can merge the binary representations and those that try,
violate the standard (same address for different functions).

¹ {rvalue, lvalue} × {const, non-const}

Fix by taking by cref.

Amends 40976532158fc49be45bb976455f48e98f9690cf.

[ChangeLog][Potentially Source-Incompatible Changes][QtCore][QDebug]
The toString() static function no longer allows the called
operator<<() to modify the argument. No Qt-provided operator<<() does
that, and operators that do are probably buggy.

Change-Id: Iac1ee9d29f93fd4840b75ffe363d354a2d19a96e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 13244eef6c913bb7f27cd8fbf459f5dfe9a0ed21)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-21 15:01:31 +00:00
David Faure
f7eddcdcb1 QTextDocument: repair AlignBaseline for inline objects
The code from QTBUG-14414 (Qt4 commit
ee9455ed2a83084692d969c398ecb91bcd4fc33a) was removed in commit
199f9c54484b0dae3bc81f83c880a965192ecb24, due to an oversight: that
commit was only about images, while there's also the case of inline
objects that contain actual text. Such objects are easy to overlook
because they are not provided by Qt itself. They are however common
in applications that implement word-processor-looking "variables",
like a place-holder for "page number", for instance).

Pick-to: 6.7
Change-Id: I2ff1476583bdfe24abcc523cffb65ce116b7faf9
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 99c1465215beac52fad4c6772c9bfef2209157e4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-21 12:42:34 +00:00
Alexandru Croitor
abb231a2f0 CMake: Only build QtLibraryInfo if we are building tools
It is a dependency for qmake and qtpaths. If neither of them are
built, because building tools might be disabled, skip building the
library as well.

Task-number: QTBUG-127334
Change-Id: I0f7d5bc9d9a4539a6d25f7c2d841e9b8978a83a3
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 82b2c51c3aec148c890d732978ca4a881e5c6f82)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-21 12:42:33 +00:00
Alexandru Croitor
f240a7a2bb CMake: Allow building qmake docs in a documentation-only build
We never added the qmake subdirectory if we didn't build tools. Thus
we never created a doc target to build qmake's documentation.

Make sure we add the qmake subdirectory regardless of whether we build
tools or not. qt_internal_add_tool can then make sure to skip building
the tool if necessary.

If the tool is not created though, create a fake qmake INTERFACE
library target, so that qt_internal_add_docs has a target to work
with.

Amends 5c352f47b977c72db323bb8e7b6ac25e1a453202

Fixes: QTBUG-127334
Change-Id: I41cc96fb6ad21e32e17d312ea474835dfa38528e
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit aea0f89cfa4aca7e4c7b5056c425fb44ce394770)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-21 12:42:33 +00:00
Axel Spoerl
b572a85b68 Remove GTK3 native menu
QGtk3Menu relied on gtk_menu_popup, which is deprecated and no longer
supported from GTK 3.22 onward. This renders GTK applications
inconsistent, if GTK >= 3.22 is used.

GTK native menus aren't special. They do not blend in with e.g. a main
window or QML ApplicationWindow drawn by Qt itself. There is neither a
performance, nor a visual disadvantage of drawing own menus by Qt.

Remove support for native windows in the GTK3 platform theme.

[ChangeLog][Platform Specific Changes][Linux] Due to deprecation of the gtk_menu_popup() function, we no longer use GTK menus on Gnome: they are now rendered by Qt.

Fixes: QTBUG-124561
Fixes: QTBUG-126598
Pick-to: 6.7 6.5
Change-Id: I031751fb6e070444e99ab2bcac4c622ac509b4c9
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 7ffb4c16955a60ffc0f32d990c70476c49ed0b0b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-21 12:42:33 +00:00
Marc Mutz
6cda03c5d6 QPROPERTY_TEST_COMPARISON_HELPER: don't write 1KiB of NULs
qsnprint() is unconditionally called to fill the buffer and is
guaranteed to NUL-terminate, so there's no point in filling the whole
1KiB stack buffer with NULs beforehand. Leave it uninitialized.

Amends 930e59b798d9e3d08e17440980d33a08fb411cbe.

Pick-to: 6.7 6.5 6.2
Change-Id: I7da859d609ad4492c9038cb3e14f2a721b2acbe4
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 47c2263e896408e733c9aa466aec388cc4b4a6ad)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-21 10:07:40 +00:00
Volker Hilsheimer
5797326b16 JNI: Constrain QJniArray::toContainer to compatible target containers
We can populate a container with the contents of the Java array as long
as the element types are convertible without narrowing (taking various
special cases into account, such as jstring to QString). The container
has to be either support emplace_back, or be a contiguous container
if a primitive element type.

The template helpers need to be in QJniArrayBase in order for qdoc to
accept the input.

Add test coverage, including static compile time tests.

Change-Id: Id9372deed5cf33446ee1969dc284a88991db2aee
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 8f04defa1e3973faec19a9cb1ab9bbf1ea7fb031)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-20 01:13:40 +00:00
Volker Hilsheimer
c21612d246 JNI: Improve the constraint on QJniArray::fromContainer
We can create a QJniArray from any container that has a forward
iterator. A contiguous container can be used to optimize the code path,
as long as the element type is primitive (i.e. not an object type).

Fixes: QTBUG-126151
Change-Id: I21915f944d226d6d4f1113a54e5602ddc9cd727e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 71be7834e67216010dc74ed855dc7b513e302f1a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-20 01:13:35 +00:00
Volker Hilsheimer
c4bd8a5492 JNI: clean up move semantics for QJniArray
Explicitly define (compiler-implemented) copy and move SMF's for
QJniArrayBase; we need to, as the destructor is declared, so without
them the compiler will implicitly convert an array to a QJniObject
and call that constructor.

Constrain the constructors and assignment operator from a QJniArray of
another type so that no narrowing conversion is allowed. Due to the
implicit conversion to QJniObject, we have to explicitly delete the
overload for narrowing conversions. Use the detector we have in
qobjectdefs_impl.h for that.

Make the detection helpers private, and add test coverage.

Change-Id: I1b2bb4435d52223567d20bb55ceb0d516e3b0b15
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit ebbf7b0fdf866190cd20e62d6b13c7c6808101da)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-20 01:13:28 +00:00
Volker Hilsheimer
43f0b1fcee QJniObject: specialize the QtJniTypes::Traits to treat it like jobject
It doesn't make a lot of sense to pass QJniObject instances into APIs,
but to be able to consistently treat QJniObject as an object type we
have to register it with the java/lang/Object signature.

Change-Id: Ic40e2676186bf327fa92764da51404985f74b565
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 82254fa836a21b5ec450a4ec7635e72403dded18)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-20 01:13:11 +00:00
Volker Hilsheimer
6c3513f514 QJniArray: implement operator-> for the iterator
The QJniArray doesn't store values, so at() always returns a temporary.
As we cannot hand out a pointer to a temporary, use a wrapper reference
struct that stores the value and implements operator->. It's all inline,
so we can move it out in the future to return mutable references, if we
ever want to enable write access to QJniArray elements.

Change-Id: I3962df6160db8c5b573d47ebb7975864f8ea7a8b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 3d5af4b912e60beb791f874c2dbfef5597b9aad7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-20 01:13:06 +00:00
Morten Sørvig
71f80cff34 wasm: make the "a11y enable" button cover window
Adjust the button geometry to match window geometry.
Screen readers may visualize the geometry, and this
makes it clearer that the button is relevant.

Setting the clip looks to be sufficient to keep the
button visually hidden, even if the canvas (which would
normally be ordered in front) is missing.

Change-Id: Iff268cd2d8f52eead9be88e8cb460b0b445781a9
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
(cherry picked from commit e6c77a0b7eba75e8837dc7bcd98dbc1ba95318f3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-19 13:42:24 +00:00
Tor Arne Vestbø
de7a39866c tst_macdeployqt: Only pass -use-debug-libs for debug-and-release builds
When passing -use-debug-libs to macdeployqt it will only consider plugins
that end with _debug.dylib, which is not the case for single-configuration
framework builds as of d3be87ff1d558f05309b1f29f7e71f291498584f.

When not passing -use-debug-libs macdeployqt will use whatever library
it finds, both suffixed and not, so the only case where we need to
explicitly make it choose one is when we have a debug-and-release
build of Qt. Otherwise we can leave macdeployqt to choose the right
one.

Change-Id: Ic438da9f21c3090f0d57ce615bc0c0969b9a600d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 60550f8acc4f9d742f6ef7cb027f0ed3e2d5e42a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-19 13:42:22 +00:00
Even Oscar Andersen
52c9346f5b Move destruction logic to QOpenGLWindow from Private
QOpenGLWindow has been destroyed when QOpenGLWindowPrivate
destructor runs

Fixes: QTBUG-126845
Change-Id: I4f0208c4adf1a875cdcaca91fc239cf4e6200e4d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit c337cdf39cc249560bf9a5380e308d09a4c13b95)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-19 13:42:20 +00:00
Volker Hilsheimer
fe284006b2 Doc: link from non-categorized logging API to QLoggingCategory
The <QtLogging> documentation page is easily found, and from there it's
not easy to see that categorized logging is a feature. Add more links.

Task-number: QTBUG-125589
Change-Id: I214b9a561d6fc6b4c8600bc1b1eca04d856678d6
Reviewed-by: Safiyyah Moosa <safiyyah.moosa@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 7c344176d21e00a648bb504da735f174f70f0ad2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-19 12:33:09 +00:00
Wladimir Leuschner
4b4c5b06a0 QWindows11Style: Use QProgressStyleAnimation for QProgressBar
Currently for an indeterminate QProgressBar in QWindows11Style, a busy
drawing is triggered, consuming more CPU resources than necessary. This
patch avoids the busy drawing by using QProgressStyleAnimation, which
only triggers a redraw for specified Fps.

Fixes: QTBUG-127112
Pick-to: 6.7
Change-Id: I46da8ffcb849563c771dbc72af4c7e8b306b4802
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 384acdc1cf2cc6472c9eb9d2d79077736ded0e92)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-19 10:11:40 +00:00
Christian Ehrlicher
f18862e91d SQL/IBase: Don't let open() fail when lastError() is set
Since QSqlDriver::lastError() always contains the last error, it is not
a valid source to check if the last operation failed or not. Therefore
remove the check for lastError() when initializing the timezone mapping
- the function is optional since an old database might not contain the
timezone mapping table which is perfectly fine.

Fixes: QTBUG-127175
Task-number: QTBUG-125467
Change-Id: I22ea75c004654cead9a4461d2eaccfcbe8a116be
Reviewed-by: Andreas Bacher <andi.bacher@outlook.com>
Reviewed-by: Hamish Moffatt <hamish@risingsoftware.com>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 9844da5036d7a7a185ddd4eb3fa59bc4ede9e5d7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-19 06:33:42 +00:00
Christian Ehrlicher
0ff64a5b99 SQL/MySQL: honor schema when retrieving table record
Honor the schema when retrieving the table record - otherwise we might
end up getting the data for the wrong table (same tablename but wrong
schema).

Fixes: QTBUG-127129
Task-number: QTBUG-122723
Change-Id: Ia3e9293dbdc77da760dd4d0702104048187fad5f
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 920dfb2f443042777ea9547ff7a8beef56e90d92)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-19 06:33:35 +00:00
Alexandru Croitor
49193d4afd CMake: Don't add platform CPE to SBOM
It triggers vulnerabilities when loading the SBOM into tools that look
for CVEs matching those CPEs.

Task-number: QTBUG-122899
Change-Id: Ic4949ca5749ce4e297344760d3500d982c9a4449
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit ad0ed9fe307ac01ceb3fadd32816ada961a5afa6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-19 06:32:59 +00:00
Allan Sandfeld Jensen
9dcedc184c Avoid assert on nonsense input
Fixes oss-fuzz 69439. Credit to OSS-Fuzz for finding the case.

Change-Id: I5211900073377c7bdccb904dbc6ff172419e76f1
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
(cherry picked from commit 913cc91c0abb8087a85984930049f208965b05c9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-19 06:32:48 +00:00
Volker Hilsheimer
aabaf64c25 Doc: fix links to QMetaContainer members
QMetaContainer was not documented at all, so links from QMetaSequence
back to its parent class member functions failed.

Add generic class documentation for QMetaContainer. The QMetaAssociation
class is also undocumented, but since QMetaContainer's purpose is to
provide common APIs for both QMetaSequence and QMetaAssociation, mention
it anyway.

Fix warnings from incorrectly named parameters in the QMetaContainer API
documentation, which now gets generated.

Change-Id: I50a9f3ebf90b03f049804be2256ff135f57dab14
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 84be9b069c93afe62082ecd6aa5ec97ce44a8e0f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-19 06:32:08 +00:00
Thiago Macieira
091d732b15 QDnsLookup/Unix: fix buffer size on sending DNS queries
Commit f2f00b2a4632aaeb58e6cdae7faef9e0bafaff49 ("QDnsLookup: implement
DNS-over-TLS") added the use of QSpan, but confounded the size of the
buffer array with the size of the query we prepared. The queryLength
variable was never used after checking if the preparation had failed.

Task-number: QTBUG-127073
Change-Id: Iac1ff680887641888e00fffd17e0e49faab1d579
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 59133b16cd3adffc70833bb2b81332c9649fa51e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-19 04:21:50 +00:00
Marc Mutz
c3477a7375 [docs] qvsnprint(): mention %a and %ls differences on WASM/Android
Pick-to: 6.7 6.5 6.2
Task-number: QTBUG-127110
Change-Id: I919170881846f3a08890ac0a8accfb859157d193
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 1aedd4d7c9968054a1c2880000a5007bb826a179)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-18 13:32:03 +00:00
Marc Mutz
6c21f8103b q(v)snprintf(): mark the functions as \obsolete
We can't deprecate them, yet, because there are way too many users in
Qt and 6.8 is too close by now, but we should give users a heads-up
that better alternatives exist these days.

Pick-to: 6.7 6.5 6.2 5.15
Task-number: QTBUG-127110
Change-Id: Ic14e9d12fc746fdc65d6c0006756c37339aa25f0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 3f54c71b78e4ed4ab513190bbcda89ae27256377)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-18 13:31:49 +00:00
Allan Sandfeld Jensen
85b7aeaddc Fix source compatibility with existing toString() extensions
Change-Id: I946ebf0f0fa82450105e720489c4da35a77078d8
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 7dd2c5f91dd62840d37c5e17cc3f1f5ad46d9366)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-18 11:55:37 +00:00
Mate Barany
1f72315adc Pass QNetworkRequest::Priority by value
It is a small and trivially copyable type.

Found by an Axivion scan.

Task-number: QTBUG-125026
Pick-to: 6.7 6.5
Change-Id: I7990d07a7062472108ab3fff8a135f1917c4f7c7
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 8448292074e72095ed177d77910abe47a24f318c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-18 11:16:58 +00:00
Alexey Edelev
7b8cbbff76 Add the note about the runtime encoding in the QString-like classes and QT_NO_UTF8_SOURCE
Mention that QT_NO_UTF8_SOURCE has no effect on runtime encoding of
QString-like classes.

Amends 37e6159ab0c1456e8dc38f38f3b21643585c1273

Pick-to: 6.7 6.5
Task-number: QTBUG-126435
Change-Id: I3629b8af0e3eb7353c9268e23167dbef6802bb00
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
(cherry picked from commit bba0150200e16e6e0a8926dac1f32b00b8b1493b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-18 10:26:00 +00:00
Marc Mutz
fc4a3a8cfc qxptype_traits.h: include q20type_traits.h
A qNNfoo.h should always include qMMfoo.h, MM=NN-3, if that exists, to
avoid a user having to include both qNNfoo.h and qMMfoo.h, which later
become two <foo> includes on automated replacement. For the purpoes of
this argument, NN=xp is considered equal to max({MM : ∃qMMfoo.h}) + 3.

Following this logic, qxptype_traits.h should include q20type_traits.h
(q23type_traits.h doesn't, yet, exist).

It didn't, so fix.

Amends def2a3de3741410bbf7ab31b59afc27b0777e09b.

Pick-to: 6.7 6.5
Change-Id: I8153d241783dc4e505fddf2407d27990e5c522f4
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 720ae32f79038a5db763a2371c0e8d25d32d93cf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-18 08:42:51 +00:00
Marc Mutz
4c55f496d7 QThread::terminate(): don't depend on stack unwinding
Posix doesn't seem to specify whether the stack of cancelled threads
is unwound, and there's nothing preventing a QThread from
terminate()ing itself, so be extra careful to drop the mutex before
calling pthread_cancel.

We can't drop the mutex in general, as that would open a window for
the following race condition:

   T1                       T2
   t3->terminate()
     lock();
     read ID;
     terminated = true;
     unlock();
   ----------- t3 exits naturally -----------
                            t3->wait();
                            t4->start(); // gets ex-t3's ID
     pthread_cancel(ID) // oops, cancels new t4

But we can drop it when this == currentThread(), because said window
does not exist: While this_thread is executing terminate(), it cannot
at the same time exit naturally.

As drive-by, scope a variable tighter.

Pick-to: 6.7 6.5
Change-Id: I77a628e62d88e383d5aa91cfd97440186c997fc4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 272c0215c2058bc267abf0a247da878f652eaffa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-18 08:42:45 +00:00
Andras Mantia
7b9505eb86 Fix copy-paste error in the QMultiHash documentation
Pick-to: 6.7 6.5
Change-Id: I769a94710994a17160cca7f00243a634d8caf29c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 6f70ab027e785590f61357f907002aa3b4fd1aca)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-18 08:10:31 +00:00
Marc Mutz
93e39f7b79 QAnyStringView: check QASV(char) isn't UTF-8
... it is. Filed QTBUG-125730 to track this and discuss how to deal
with it.

Pick-to: 6.7 6.5 6.2
Task-number: QTBUG-125730
Change-Id: I2c680e1a9e8dda43700468a544ac645e1fa3aa53
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 3ff55648cee8365fb7825ca7a038596b63757ea3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-17 16:26:27 +00:00
Marc Mutz
dabfdb5f2d QSingleShotTimer: de-inline [4/4]: clean up includes
Include what you need, don't rely on transitive
includes. Forward-declare what you need in-name-only.

Also port the one unchanged include in the header
(qabstracteventdispatcher.h) to idiomatic form. It's an unrelated
change, but it looked so lost among the QtCore/ headers, I felt pity.

Amends e0573e73645c0f57e46332a94160e28eb6c8ebac.

Change-Id: I4f25df7465f08378bc4e003bde12c28f4d231f14
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 49d5b0a5a10634841122bbbc5e986ce307e7017a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-17 13:40:56 +00:00
Kai Köhne
661ab8398e Doc: Fix typo in snippet
Change-Id: I1a93a5f58bc5edc07c5449f20eb2444ebc252a61
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 3e1f73aa30761533b5a897ee0ee6d7ce33f5b4bb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-17 13:40:55 +00:00
Alexey Edelev
861664b9d9 Add documentation for the QT_NO_UTF8_SOURCE property
Add the missing documentation for the QT_NO_UTF8_SOURCE. The property
can be set directly or using the qt6_allow_non_utf8_sources function.

Fixes: QTBUG-126435
Pick-to: 6.7 6.5
Change-Id: I2a255e6d4f761f14a2fa30ae51b4f671ed75586f
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
(cherry picked from commit 37e6159ab0c1456e8dc38f38f3b21643585c1273)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-17 13:40:55 +00:00
Edward Welbourne
6a0f00ac4e Update CLDR to v45, adding language Kuvi
This was in fact present in v44, but we overlooked it somehow. The new
version also fixes some inconsistencies in the data, that I reported
against v44.1; in particular, Tamil no longer claims to override the
root AM/PM markers (probably because it uses 24-hour time so doesn't
need them).

Add the test-file under util to the list of files containing generated
content.

Conflict at 6.8 resolved by regenerating the data; this only changed
the date of generation, not the data. Then hand-edited the date to
match the picked upstream commit, to avoid future conflicts.

[ChangeLog][Third-Party Code] Updated CLDR data, used by QLocale, to
v45.

Task-number: QTBUG-126060
Pick-to: 6.7 6.5 6.2
Change-Id: I81a5bcca49519b55091fc541de6b73b606661bb4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f79548e268a496698d77d0e78365334d0e507212)
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-07-17 12:57:30 +02:00
Edward Welbourne
b68eaebc86 Update benchlib's 3rdparty cycle counter to FFTW v3.3.10
Document cycle_p.h's provenance - thanks to Morten Sørvig for digging
that up - and update to its version in the most recent release of
FFTW. Include patches to apply (after purging dangling hspace) for
future updates.

[ChangeLog][Third-Party Code] QtTest's benchlib now uses FFTW
v3.3.10's version of the clock-cycle counter, Cycle.

Task-number: QTBUG-126080
Change-Id: Ib59bc53e5d74cfdc889c03e78f9dd72100168f64
Reviewed-by: Jason McDonald <macadder1@gmail.com>
(cherry picked from commit 6e7c158152cef6a1ae6a628f08661fcc4b27de90)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-17 10:33:01 +00:00
Volker Hilsheimer
8e703f6e21 Touch event dispatching: change qCWarning to qCDebug if no target window
Warning messages are by default emitted for qt.* logging categories. But
neither the end user nor the application developer can do anything about
this particular warning (which gets emitted on macOS when using the
touch pad) - it's only useful for Qt developers.

So change the logging level to debug.

Pick-to: 6.7 6.5
Fixes: QTBUG-125589
Change-Id: I36e6e553494054488209139e3238b7bd11bd170a
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 2b021b2f927eaabbb3b7892b3dfe35d41368cf32)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-17 10:32:59 +00:00
Lena Biliaieva
c373e728c8 QHttp2Connection: Add test for CONTINUATION frames
Task-number: QTBUG-122458
Change-Id: I6c87a7361852bb04173f0216e69cd7c5309a242b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 6aa1cb05e357cf4221aaedd4cf742c45983af446)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-17 10:32:58 +00:00
Marc Mutz
4e26c36171 QThread: fix race condition between parallel terminate() calls
QThread::terminate() is documented to be thread-safe, but had a race
condition: If multiple threads call terminate() on the same thread,
the following could happen:

  T1                     T2

  t0->terminate();
    lock();
    read ID;
    pthread_cancel(ID);
    unlock()
                         t0->terminate();
                           lock();
                           read ID;
    (OS thread finishes)
  t3->start();
    (creates a new OS
     thread with same ID)
                           pthread_cancel(ID); // cancels new t3!
                           unlock();

To fix, record that the thread was already terminated using a new
boolean flag.

An alternative would have been to fetchAndSet() the threadId to nullptr
and only let the thread that actually nulled it call pthread_cancel(),
but that would be harder to restore to the previous state in case
pthread_cancel() fails, and a null threadId might cause other problems
down the line, esp. if cancellation is currently disabled. The
explicit state is much simpler to reason about.

Fixes: QTBUG-127055
Pick-to: 6.7 6.5 6.2 5.15
Change-Id: Iec180bdfaaf913a3a1560210c781966dc99c0d42
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit d8bd4c2306f2acfefc75f8163b58f2037596dc65)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-17 09:30:17 +00:00
Volker Hilsheimer
d2730bc303 Logging: use qCDebug/Warning/Info when for categorized logging
When building qt with QT_NO_DEBUG/WARNING/INFO_OUTPUT set, then the
qDebug/Warning/Info macros expand to `QMessageLogger::noDebug`. That
helper is not defined to take a logging category or category function,
so using `qDebug(lcX, ...)` breaks the build. The correct way to emit
categorized logging is to use the qCDebug/Warning/Info macros.

Task-number: QTBUG-125589
Pick-to: 6.7 6.5
Change-Id: I968b0e826871a09023c11fec9e51caa5a2c4dc0b
Reviewed-by: Jonas Karlsson <jonas.karlsson@qt.io>
(cherry picked from commit 1e1c68017338c89265d6664a27f4137fc8960473)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-17 01:49:15 +00:00
Axel Spoerl
678dccb7ac Revert "Update window state in QWindowsWindow and QXcbWindow geometry setters"
This reverts commit 99c8ffb9f259760e45618f0988bbd79237d6d291. It fixed
QTBUG-104201, which in essence pointed out a state mismatch between
widgets and platform windows on Linux (X11 and wayland). Mismatches
occurred in the margins between calls to QWidget and async screen
rendering: While the widget layer reported the expected size, the
platform layer did so only after the rendering thread had finished.

As mentioned in the comments of QTBUG-104201, the state mismatch is
predictable, temporary and consistent.

By bridging the time gab, an async operation was made to look
synchronous. That gave more comfort to application developers. By
oversight, it broke code that relied on the platform window state
reflecting physical rendering. This has caused QTBUG-126479 as a
regression.

Both purposes can't be served at the same time: The platform window
state either reflects rendering, or the expected state. It's therefore
justified to revert.

Reason for revert: <Causes QTBUG-126479>

Pick-to: 6.7 6.5
Fixes: QTBUG-126479
Task-number: QTBUG-104201
Change-Id: I22380a6a463822a1cb4be90a44d2775954c7ca82
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit 7d7be38d95eb82ef3e0be5250440072d8b5bc4b2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-17 01:49:09 +00:00
Rym Bouabid
35562e8e0a QExplicitlySharedDataPointerV2: Add unit-tests
The tests are needed for the next patch where we modernize comparisons
and wrap the pointer, which involves changing most of the functions.

Pick-to: 6.7 6.5 6.2
Change-Id: If635538bfca33e410e19472d32b9666d258f96a9
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit b44541d8a42b7fc0b24cde4086b0030623280cc0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-16 15:37:55 +00:00
Ivan Solovev
4cdb6991c5 Remove QBAV(QL1SV) and QBAV(QU8SV) constructors
They were added because of conditional noexcept on the relational
operators that was preventing the other constructors from being picked
up by the compiler.

Now when we removed the conditional noexcept on the relational
operators, we no longer need this constructors.

This patch reverts bd581e35e7485cf42fbefd250be7b146737d9d41 and
partially reverts fff6562f8c074d75bda8b80f844dc63c6f2e64d5.

Change-Id: I22cb4507bff0a929a25d2f15caed66cc30d20dc9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 6cafe0f2b48c5f07f07de52490b1d07c7325557b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-16 11:32:19 +00:00
Ivan Solovev
65ef677131 Rework comparison helper macros to get rid of conditional noexcept
The conditional noexcept in comparison operators is known to cause
problems in various cases.
For example, we had a problem in QBAV, where gcc and clang tried to
expand conditional noexcept before the class was complete, and, as a
result, discarded some of the QBAV constructors (see
fff6562f8c074d75bda8b80f844dc63c6f2e64d5 for a more detailed
explanation).
Other problem is related to the GHS compiler which tries to compile
the noexcept specification and provides a hard error instead of
SFINAE'ing out in case of failure
(see e1f45ad8187947e243c8247c5cbac2d884d68d55 or
0ac0b412c754e53d167716f207be9d76a7fe16be as examples).

This patch reworks the macros to get rid of the conditional noexcept.
Instead, it demands that all operators are noexcept by default, and
adds another set of helper macros that can be used if it's not
possible to make the relational operators noexcept.
The new macros end with the _NON_NOEXCEPT suffix.

The patch also adds static_assert() to the generated operators to
verify that the proper macros are used. However, some platforms
(e.g. QNX and Integrity) fail to handle conditional noexcept on
lambdas, and so we have to use yet another macro to generate the
checks only on platforms that handle them properly.

This patch also applies the new approach to qtbase, adding noexcept
where possible, and falling back to the _NON_NOEXCEPT macros
otherwise.

As a drive-by: fix the macro implementation to use
QtOrderingPrivate::reversed() instead of manually reimplementing it.

I decided to pick the patch to 6.8, because it allows to fix some
questionable APIs (see QBAV story above).

Change-Id: I72f56778acb469f18b578b3418c0c41b4f6d62e7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit d292648d0bbac50388dae035dc34782accb3807f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-16 11:32:19 +00:00
Lena Biliaieva
c26e16e1d4 QHttp2Connection: Return connection error if CONTINUATION isn't expected
According to RFC 9113: A CONTINUATION frame MUST be preceded by
a HEADERS, PUSH_PROMISE or CONTINUATION frame without the END_HEADERS
flag set. A recipient that observes violation of this rule MUST respond
with a connection error of type PROTOCOL_ERROR.

Task-number: QTBUG-122458
Change-Id: I1a052b1f4fc80aa73fad4fc18e3c063fb738ae4e
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 10b7b7fcf06d4ed5492e946ac93eb232c168e686)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-16 11:32:18 +00:00
Nodir Temirkhodjaev
e90a61ca49 qwindowsscreen.cpp: Fix memory leak of SetupDiGetClassDevs()
Use SetupDiDestroyDeviceInfoList() to delete the returned device information set.

Fixes: QTBUG-127168
Pick-to: 6.7 6.5
Change-Id: I810e0f284e0d53d9b84d8c64022e566d6b740ab4
Reviewed-by: Pavel Dubsky <pavel.dubsky@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 5183ca14344c04015b32ef407e4cdad1b370c841)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-16 11:32:18 +00:00
Oliver Wolff
2623d34003 Revert "Revert "Ensure that we make case-insensitive comparison of CMAKE_SYSTEM_PROCESSOR""
This reverts commit 361d0b7222fd35133186571762640aada67fa39b.

The qmake behavior is fixed by b66ecb295ecc3981b1c21f01d62c9066f5d6e6ca
so that the original fix can be reinstantiated.

Change-Id: I5338e4cbebc963f48469e7492f18375e56a46200
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 39c36d3230ea26ff327bb1d727c1fd049932fb93)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-16 11:32:18 +00:00
Allan Sandfeld Jensen
646fb238e7 Add virtual stub to QAbstractEventDispatcherV2
To be implemented in 6.9, but added here to avoid a
QAbstractEventDispatcherV3.

Change-Id: If8bd98f6299e39999d09b2c8857565d5fd890eec
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 404ad4e17d9d36566881e0f398e24ccbc2af4a72)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-16 11:32:18 +00:00
Joerg Bornemann
c359af7bfb CMake: Fix exposing source files after target finalization
Calling _qt_internal_expose_source_file_to_ide after a target has
already been finalized did run the function's fallback code for targets
that are not finalized at all. That added the source files under a new
${target}_other_files target, which is a tad ugly in an IDE.

A situation where this occurs is for instance:
- qt_add_executable in a subdirectory
- adding additional files (licenses, documentation, .ts files) to the
  "main" target in the top-level CMakeLists.txt

The code flow is like this:
- enter subdirectory
  - qt6_add_executable(foo)
- leave subdirectory
  - qt6_finalize_target(foo)
    - calls _qt_internal_expose_deferred_files_to_ide(foo)
- _qt_internal_expose_source_file_to_ide(foo bar.txt)
  - sees that the target does not need finalization and runs the
    fallback code

Fix this by immediately running
_qt_internal_expose_deferred_files_to_ide if a target was already
finalized.

Task-number: QTBUG-127052
Change-Id: I1eda9acd48442ba35c6c61d9a185f6ed9ed6307f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 469533fe8108cc56e90201919126502235c5cee6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-16 09:14:43 +00:00
Lucie Gérard
4091f4ede0 Add Files field
[ChangeLog][Third-Party Code] Specify the source file that the "Mipmap generator for D3D12" component consists of.

Pick-to: 6.7
Change-Id: Icb4581c95b925904b25343d8373c907f02cbf8a5
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 766d95edb3e8cdaff1a7712a20218804e688b06f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-15 19:29:32 +00:00
Alexandru Croitor
9f1ced55cd CMake: Add risky workaround for archiving dSYMs with an Xcode project
CMake by default generates an Xcode project with an overridden
CONFIGURATION_BUILD_DIR Xcode attribute pointing to an absolute path
build dir.

Due to a bug in Xcode, that causes dSYMs not to be included in an
xcarchive after invoking the Xcode archiving task.

This can be worked around by re-setting the CONFIGURATION_BUILD_DIR
attribute to have the value "$(inherited)". That ensures that Xcode
places the dSYMs into an expected location, that can then be included
in an xcarchive.

Unfortunately overriding CONFIGURATION_BUILD_DIR breaks certain CMake
build path preconditions, which can result in broken behavior like
$<TARGET_FILE:app> genex evaluation not working, as well as ignoring
of the CMAKE_RUNTIME_OUTPUT_DIRECTORY property.

So modifying the CONFIGURATION_BUILD_DIR can only be done as an
opt-in, where the project developer knows the risks and can decide if
it will affect the project.

The project can opt into the risky fix by setting the
QT_USE_RISKY_DSYM_ARCHIVING_WORKAROUND cmake variable to ON before
creating any targets using qt_add_executable.

If Xcode fixes this bug in the future, we can make the variable a
no-op when we detect a new enough Xcode version.

Pick-to: 6.7
Task-number: QTBUG-126866
Change-Id: I37e8dee569fc45654f149219b8933769ed237fda
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit ff1ba4f1c9da383b357745c2261de5b0050cdf3c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-15 18:54:17 +00:00
Alexandru Croitor
2347afc419 CMake: Add partial fixes for archiving dSYMs with an Xcode project
CMake by default uses the Release configuration for the Xcode archiving
task, providing no way to choose a different configuration. CMake also
sets the "generate debugging symbols" Xcode option aka the -g flag to
NO for the Release config, because it is not the RelWithDebInfo
config. This means that by default the archived project will never have
debugging symbols.

Change the GCC_GENERATE_DEBUGGING_SYMBOLS Xcode attribute to YES for
all the release configs (Release, MinSizeRel, RelWithDebInfo), as well
as the debug config. This matches the defaults of a project created
in Xcode directly and ensures debug symbols are generated for all
configs.

Another issue is that the Xcode project generated by CMake shows no
values for the debugging format option, which is controlled by the
DEBUG_INFORMATION_FORMAT attribute. In contrast a project created in
Xcode directly, sets the Debug config format to "dwarf" and the
Release config format to "dwarf-with-dsym".
This prevents inclusion of the dSYMs into the archive, because the
dSYM would not be created in the first place.

Override the DEBUG_INFORMATION_FORMAT per-config. The release configs
get the 'dwarf-with-dsym' variant, while the debug config will have
'dwarf'.
This matches the values of a new project created directly in Xcode.

Each of these assignments can be opted out by setting one of the
following variables:
- QT_NO_SET_XCODE_DEBUG_INFORMATION_FORMAT
- QT_NO_SET_XCODE_GCC_GENERATE_DEBUGGING_SYMBOLS

These changes improve the defaults for a CMake generated Xcode
project, but are not sufficient to ensure that dSYMs are included into
the archive created by the Xcode archiving task.

For that, the project also needs to set the CONFIGURATION_BUILD_DIR
attribute to '$(inherited)' to avoid a bug in Xcode, where it can't
copy dSYMs out of a non-inherited build dir into the archive.
Qt can't do that unconditionally, because it violates CMake's build
path preconditions, resulting in things like $<TARGET_FILE:app> genex
evaluation not working, as well as ignoring of the
CMAKE_RUNTIME_OUTPUT_DIRECTORY property.

A follow up change will provide an opt-in to do that, but only at the
project developer's own risk.

[ChangeLog][CMake] CMake-generated Xcode projects will now include
debugging symbols by default, regardless of configuration type, and
Release-like configurations will default to using dSYM bundles instead
of keeping the debug symbols in object files, to match Xcode project
defaults.

Pick-to: 6.7
Task-number: QTBUG-126866
Change-Id: Ie17b40e53ba22658a098f9a162c7bcfb1711c45b
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 7ccf30ae46272ace13bedc33ccf5f116ff57091b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-15 18:54:17 +00:00
Alexandru Croitor
9775f52cd5 CMake: Fix lookup of qml plugins for external project examples
There was a typo in the original change, which caused none of the qml
plugins in a prefix per-repo build being picked up.

Amends 06fef6219e992489dae15e9851725e1675ff0bf6

Pick-to: 6.7
Task-number: QTBUG-90820
Task-number: QTBUG-96232
Change-Id: Ibf14d9e0cbb0302c69d32071f4ba090f24a5798d
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 1ab33d575a6993ceb8d9482c20d5c7d6deb252ea)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-15 16:02:57 +00:00
David Faure
ed2f80b75d QMimeDatabase: pick up XML mimetypes from :/qt-project.org/mime/packages
[ChangeLog][QtCore][QMimeDatabase] QMimeDatabase can now pick up XML
mimetype definitions from :/qt-project.org/mime/packages. GPL-compatible
projects which provide self-contained binaries can use this to provide
a copy of freedesktop.org.xml that will be used instead of the TIKA
mimetypes.

Change-Id: Id363317f920ae2cb1e054f32feb732e0e9168de3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit b12542c964c15d074393a7594c97a96d5c2b047d)
2024-07-15 14:47:41 +02:00
David Faure
2d2975bd9f Change the mimetype database embedded into QtCore
Instead of freedesktop.org.xml (which is GPL), use the tika mimetypes
definition (Apache licensed), as fallback on platforms where
shared-mime-info isn't installed.

[ChangeLog][QtCore][QMimeDatabase] For licensing reasons, QtCore
no longer ships a copy of the MIME database from freedesktop.org's
shared-mime-info project, but the one from the Apache Tika project.
The tika definitions don't have icons or translated descriptions, but
are sufficient for matching file types.

[ChangeLog][Third-Party Code] Added TIKA mimetypes and the corresponding
attribution file.

Change-Id: I360ed973f6d89a470dc2f17a21abdf5630c6d15d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 74ad4cbeef40b1f51a59b3168f8c0b62eb0b29c8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-15 12:47:37 +00:00
Oliver Wolff
b0dd8d748e qmake: Add support for arm64 hosts on Windows
Change-Id: I0096300fce870ef4411b071f074588a6420188e0
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit b66ecb295ecc3981b1c21f01d62c9066f5d6e6ca)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-15 11:11:56 +00:00
Mate Barany
9107807653 Use NSDMI to initialize the member variables of QIpPacketHeader
While adding senderPort to the initializer list of the constructor we
have decided that NSDMI would be a better approach for the member
variables.

Task-number: QTBUG-125026
Pick-to: 6.7 6.5
Change-Id: Ibc65251f99a66f1d7ee0c3570e608c2b534aa8b3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 5e2635e3456f2a4251f8194b3115382e63fdb49b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-15 01:07:52 +00:00
Mate Barany
7af02a5860 Call base class assignment operator in QHttpNetworkRequest::operator=()
Address a "Do call the base class copy constructor or assignment
operator, if you implement a copy constructor or assignment operator
in a derived class." warning found by an Axivion scan.

Call the assignment operator of the base class explicitly in the
assignment operator of the derived class.

Task-number: QTBUG-125026
Pick-to: 6.7 6.5
Change-Id: I5a76c9ea96275d569b3a036b1e1b791c57d0042f
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 84bb06fc5699c88b6edc175cc3cf67d88307481b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-14 12:03:33 +00:00
Mate Barany
504968117a Pass HPack::BitPattern by value
It is a small and trivially copyable type.

Found by an Axivion scan.

As a drive-by, forward-declare struct BitPattern at namespace scope
instead of in the argument of a function declaration.

Task-number: QTBUG-125026
Pick-to: 6.7 6.5
Change-Id: Ic3f58cb71a0fd0ad5b0555767af879e813612e72
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 9a41ea0934a745aa4e33280a2cf7a45372cb4073)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-14 12:03:30 +00:00
Christian Ehrlicher
68608585a5 Windows style: paint treeview indicators with correct dpr
The QTreeView indicators in windows style are drawn with the help of
windows themes. Sadly, indicators have to be drawn in the explorer
style.

This was already done correctly for visible windows. Hidden windows, however, using this drawing method, were not dpi-aware.
As a consequence, the dpi of the primary screen was used for drawing. This lead to wrong results on a second monitor with a different dpi.

Create a hidden window for every screen and use this for the painting
instead.

The fix can't be covered by an autotest. It will result in baseline test
mismatches, which must be accepted as new baselines.

Fixes: QTBUG-126533
Change-Id: Ie86cdb69f4cef1b293a5ac65541e5ada12959180
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 7f08822c499f624246d3f4c35dd97a7ba81d85ae)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-13 23:00:44 +00:00
Volker Hilsheimer
2a677940a0 JNI: add swap to QJniArray
It's a value type and should implement swap.

Change-Id: I811377843b6ede1d6d750a701ae7a6b12434f4e6
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 0789dd8723b03d255ff203c717c5e12b6945015e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-13 23:00:28 +00:00
Volker Hilsheimer
92b1923e31 JNI: clean up move and swap semantics in QJniObject
QJniObject is a value type with move semantics, but didn't provide swap,
so add it.
Make it safe to check a moved-from QJniObject for validity, and to
compare it with another QJniObject. As before, two invalid objects
compare as equal.

Change-Id: Ie08bb7c50da831f3e7e98e731e8ddbc0ebb3af78
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 3e0c21691dd2be6911c417f4cbfaf54d10b4d634)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-13 23:00:24 +00:00
Mate Barany
6d55e0b053 Initialize the senderPort member variable in QIpPacketHeader
Address the "A constructor must initialize all data members of the
class" warning found by an Axivion scan.

Just as the destinationPort is defaulted to 0 initialize the senderPort
to be 0 as well.

Task-number: QTBUG-125026
Pick-to: 6.7 6.5
Change-Id: Ifec55ba4b6c23a6feed2b4816d4ba6aae061f1cd
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 213127a013b6ecafb36eae1014d5988198736712)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-13 01:27:22 +00:00
Edward Welbourne
3f85834a47 Tidy up fix for calendar/locale data lookup
Save duplication of fetching and sanity-checking the locale-dependent
calendar index data by packaging it as a lookup function. This can
then take care of making the assertion of consistency with the
matching QLocaleData entry and also lets me add, without duplicating,
the slightly messy assert that m_data is what we expect (and are
relying on) it to be.

Task-number: QTBUG-126390
Change-Id: Ib514bee669956f432c007c858d01a9f7b6bbf86e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit c9c498b5d1f5797c714fb07f06a84df881edb928)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-13 00:43:55 +00:00
Alexey Edelev
474c7dbf6e Revert "Ensure that we make case-insensitive comparison of CMAKE_SYSTEM_PROCESSOR"
This reverts commit 7ae19cee1c782fadfbd0c617568fdad8aba9a493.

Reason for revert: breaks non-cross QMake builds on
Windows on ARM64. The QMake mkspec is now reported as
win32-arm64-msvc, and apparently, QMake is not prepared for this.

Change-Id: I45c19719c6f0862580dbff09244337283305ee6c
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 361d0b7222fd35133186571762640aada67fa39b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-12 22:55:28 +00:00
Mate Barany
8b2ff809f6 Add move constructor to QSslCertificate
The class has a move assignment operator, it should have a move
constructor as well.

Found by an Axivion scan.

Task-number: QTBUG-125026
Change-Id: I71fe066a84baede3a8cd309977a4a73d849dcfd1
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 488362257d668760eb7bb60eb860570bd8b70d4d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-12 21:44:26 +00:00
Mate Barany
7fa938754a Add move constructor to QHostAddress
The class has a move assignment operator, it should have a move
constructor as well.

Found by an Axivion scan.

Task-number: QTBUG-125026
Change-Id: I301e8e3f275b0d5217afc1559947870ff87bcf45
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 1caee12b1ac8cef3aabd8d2e319c88a84c64c585)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-12 21:44:20 +00:00
Alexandru Croitor
a0f2d10c00 CMake: Fix SBOM unsupported type for internal apps targeting Android
Usually apps created by qt_internal_add_app() are not meant for
installation on Android, and are excluded from installation using
qt_exclude_tool_directories_from_default_target().

Some repos might be missing the exclusion call, which means the app
would be built and installed on Android.

qt_internal_add_app creates MODULE_LIBRARYs instead of EXECUTABLEs
when targeting Android. While the SBOM machinery only expects
EXECUTABLEs for apps.

If the app target is not excluded (in which case the SBOM would be
skipped), this would cause the SBOM code to error out saying the
target type is unsupported.

To prevent further errors like this, add MODULE_LIBRARY as a valid
target type for qt apps.

Task-number: QTBUG-122899
Change-Id: I3ec80add22f0584638990171c59b78c24725c052
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit d24936dbdc85d5fe875b5d3df702630df4d4ba9d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-12 20:24:14 +00:00
Ahmad Samir
fcfa245474 QTemporaryFile: clarify usage of the dynamic part of the file name
Pick-to: 6.7
Change-Id: I7d6b1b8a53f7b32bf223ac3435ec7c13c9326d10
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit b4bb4449aea7592afdb9b9134bb90c40fe29735a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-12 18:08:15 +00:00
Ahmad Samir
ec349e0c00 QTemporaryFile: de-duplicate docs wrt. the file name relative/absolute
Make it clearer in fileTemplate() and fileName() that the returned path
will be relative or absolute depending on the specified file name
template.

Task-number: QTBUG-124653
Pick-to: 6.7
Change-Id: Iccb7a6d0ced2cadeacea7d14d3f6e924705b4d58
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 9a5e3e1f4064e275da3370f5dd27e87900da8c45)
2024-07-12 21:08:02 +03:00
Marc Mutz
431ca49614 QSingleShotTimer: de-inline [3/4]: move fromMSecs to qtimer.cpp
Move the implementation of fromSecs() from the header to the
qtimer.cpp file and make it file-static. There are no callers of the
function outside qtimer.cpp.

Amends e0573e73645c0f57e46332a94160e28eb6c8ebac.

As a drive-by, rename the function to snake_case to indicate that it's
a file-static.

Change-Id: Ifa32df8a28816cd9cae44cdb9d481df94d33d741
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit ba80845ed16b784ac00dcc9e7715e4605e3344ff)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-12 17:36:28 +00:00
Kai Köhne
4e209c2188 Doc: List QRegularExpression classes in String Data overview page
Pick-to: 6.7
Change-Id: I25c052e779b7eef78e4dfd1234e0b9b8f71229d0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit d44a0b6fdd1ddbbb3de67f076b01a3926ef71d0a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-12 11:45:56 +00:00
Liang Qi
a2be238207 QGUTheme: add Pantheon to the list of GTK based desktop environments
Pantheon is the desktop environment of elementary OS. It is written
in Vala, using GTK 3 and Granite.

Fixes: QTBUG-52292
Pick-to: 6.7 6.5 6.2 5.15
Change-Id: I01140d8a2f3b0f2736515c1279e5d3150a0c313d
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit d58e7a3b11a5879dad27689c008d83a24d500ad7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-12 11:45:56 +00:00
Kai Köhne
55d1a457c0 Doc: Mention QDirIterator, QLockFile in IO overview page
Pick-to: 6.7
Change-Id: I013fc221ea790b0f3bbc41ef6bf3f63c643cdab6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 0e26a2d74a5117d1a6b25f5038ccb55cffb58ade)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-12 11:45:56 +00:00
Mate Barany
e4c234ac15 Remove the struct NetlinkSocket
Started with fixing a "Class with destructor should also declare a
copy or move constructor and assignment operator." warning found by an
Axivion scan.

However, the NetlinkSocket struct is used only once and the behavior
can be replicated with a qScopeGuard.

Remove the struct NetlinkSocket and use a qScopeGuard for resource
management.

Drive-by: remove a Q_UNLIKELY that's not needed (qErrnoWarning() is
already marked as Q_DECL_COLD_FUNCTION).

Task-number: QTBUG-125026
Pick-to: 6.7 6.5
Change-Id: I6b770e284fdda3ff97b8cabac205e9b5abe88b14
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 954bf6e18eb691ea95dab866831492a4494eff03)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-12 11:45:56 +00:00
Marc Mutz
b174be2247 QSingleShotTimer: de-inline [2/4]: clean up header
Remove the inline keyword.

As a drive-by, mark the ctors explicit and the dtor override, and sort
the SMFs idiomatically (dtor _after_ ctors).

Amends e0573e73645c0f57e46332a94160e28eb6c8ebac.

Change-Id: I2496360e1f72a4ab54a7c090ca966e1c4828a314
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit b05022e8473d5517f0a8b0c8c4d5dff6e31c5a97)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-12 11:45:56 +00:00
Marc Mutz
e3da82d3b6 QSingleShotTimer: de-inline [1/4]: add .cpp file
... and split code between header and .cpp file. The goal here is to
just sort the lines into header and .cpp, not to change them, so
temporarily define inline away. This allows git to reliably track
this as copy instead of independent changes. The inline define will be
cleaned up in a follow-up patch; fixing inline and re-indenting would
reduce the similarity score too much.

Also includemocs and move qsingleshottimer* to the (lexicographically)
correct position in CMakeLists.txt's SOURCES.

Fixes -Wweak-vtable (and therefore prevents this class from being used
outside QtCore (not exported atm)).

Amends e0573e73645c0f57e46332a94160e28eb6c8ebac.

Change-Id: Ia5304434fd1c9a56eb6f2f1988bd14a80ab61442
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 1ef5f50e28edd1bdfcb3828c3858640ba347b2bd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-12 11:45:56 +00:00
Marc Mutz
678c839575 QFormDataBuilder: add options
There are (at least) three RFCs, all non-obsolete, purporting to guard
the formatting of multipart/form-data filename parameters, and they
all disagree: RFC 6266, RFC 7578 and RFC 8187. There is also
considerable implementation divergence.

So, to not have to hard-code any one of the different strategies, add
Options controlling the formatting.

Found to be required in implementation review.

Task-number: QTBUG-125985
Change-Id: Ibc82ff8a3460580ee70eafcaf9b88de36751940d
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Mate Barany <mate.barany@qt.io>
(cherry picked from commit 49ab4f156b7d1a0593f25680d0b841d2dc4c348e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-12 11:45:55 +00:00
Edward Welbourne
03a95f5f20 QtTest 3rdparty: update valgrind headers to v23.0
Nothing hugely consequential, although __VALGRIND_MINOR__ was
previously out of step with the version given in qt_attribution.json.

[ChangeLog][Third-Party Code] Updated QtTest's Valgrind headers to
version 3.23.

Fixes: QTBUG-126080
Change-Id: Ie2c9d41d4f35cd497b1dcf9a366cf4b319b361ad
Reviewed-by: Jason McDonald <macadder1@gmail.com>
(cherry picked from commit efab6e69831c7fc8d35f18e211bda20f854f2f39)
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2024-07-12 13:45:55 +02:00
Edward Welbourne
35062f6510 Replace a renaming in a third-party file with a #define
Our use of the clock-cycle counter from FFTW involved a rename of its
type ticks to our type CycleCounterTicks. This unnaturally bulks up
the diff from upstream, so undo it and use a simple #define to achieve
the same effect, as seen by our code.

Task-number: QTBUG-126080
Change-Id: Icbe9c413b73dd9213b95f183b71585f4a9c38de1
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit ed7becd9cba582640f19704b5c439e5f6807bc29)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-12 11:45:55 +00:00
Edward Welbourne
1c7c4c5ac9 QtTest 3rdparty: isolate Catch2 part as a 3rdparty component
Move from tests/auto/testlib/selftests/ to
src/testlib/3rdparty/cache2/, so that its path includes a 3rdparty
component and it's isolated from the rest of the selftest files.
Instead, it's now grouped with QtTest's other 3rdparty components, to
make it easier, when doing a 3rdparty update, to see what might need
an update.

In the process, document where in the upstream to find the file to be
copied, if an update is needed. The file is generated, so document its
generator, too, in case its output gets renamed. There is no more
recent release than the 2.13.10 we currently have, so no update will
follow.

Task-number: QTBUG-126080
Change-Id: I371bac233b00318f59d6043fb245ab44b914bf8a
Reviewed-by: Jason McDonald <macadder1@gmail.com>
(cherry picked from commit 31adb73e289d1bd93276af2b1df9bc356ba14766)
2024-07-12 13:45:55 +02:00
Edward Welbourne
23e0318d24 Reorganise QtTest 3rdparty to separate its various parts
In the process, update the Linux perf_event.h provenance details to
make it possible to find the latest version. Also, remove 3rdparty
headers from the module's CMakeLists.txt (where possible) so that
anything that includes them makes its 3rdparty dependence visible in
the relative path. That can't be applied to cycle_p.h, though, as it's
used by the tests.

Task-number: QTBUG-126080
Change-Id: I3a7099bc123ba7188ad096714cb7ed45ff35a392
Reviewed-by: Jason McDonald <macadder1@gmail.com>
(cherry picked from commit b14906884c63b3f5f239d7d008eb23aba66836fa)
2024-07-12 13:45:55 +02:00
Volker Hilsheimer
2f319c889d QThread: initialize interruptionRequested atomic
Coverity complains correctly that the variable is not initialized.
std::atomic's default constructor doesn't do it, and we only do it
in QThread::start and QThread::finished. So initialize it using NSMDI.

Pick-to: 6.7 6.5
Coverity-Id: 466429
Change-Id: I36d4624d46718f50e10bec17ef5e437c60541fa9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit d1f6d2258809ed7e2d7aa50de3b6d6f472cf1bd8)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-07-12 11:05:44 +02:00
Piotr Wierciński
f727474ee6 wasm: Update Emscripten to 3.1.56
Change-Id: I26842b3d2769bf130e950fb7289135eaf7c86ffb
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
(cherry picked from commit 468305dfb95f61f489faec8511ad7ae136e8ace6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-12 01:42:29 +00:00
Giuseppe D'Angelo
f47558ca87 PDF: fix the value of the Trapped element in the XMP metadata
XMP 8.2.1.1 says that a boolean shall be "False", not "false".

Change-Id: Ifa4d1038fe481389e2c3914548382ee9c3c88e66
Reviewed-by: Albert Astals Cid <aacid@kde.org>
(cherry picked from commit 1b80d03e0f1d2498c98c11f5b5dca8a6b1b29fd8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-12 00:48:40 +00:00
Volker Hilsheimer
6b3c2dcfc2 Tests: disable various compiler warnings
The build on Android with clang results in a bunch of irrelevant
warnings. Disable them for the offending lines of test code.

Change-Id: Ica5d867e3a2b1215dc526cc5f945a39ac908ac23
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 8d523a098cc8068400a6138970c6382f8f56224c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-12 00:48:40 +00:00
Alexandru Croitor
7857fad91e CMake: Warn when qt_find_package is used with Qt target names
qt_find_package is only meant to be used for looking up 3rd party
packages. Using it with Qt packages can cause issues where we record
the Qt packages as 3rd party packages.

When using a developer build, issue a warning when qt_find_package is
called with a provided target that starts with the Qt6:: namespace.

Change-Id: Ic2a2d613dbf4fa7e7c51e9b73696bf14e4af866f
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 2339cb3ea282d4ad31fd74fd2a127a986a29a3cf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-11 22:22:45 +00:00
Alexandru Croitor
5da0b7624f CMake: Prevent most global promotion errors when building Qt
Backstory.

The main reason why we keep getting "unable to promote 3rd party 'X'
target to global scope" errors when building Qt repositories, is
because we try to promote 3rd party imported targets in a different
scope than where the imported targets were created.

What were the main motivations for promoting 3rd party targets to
global?

1) imported targets are by default local to the directory scope they
   were created in

2) we want 3rd party targets to be accessible across subdirectory
   scopes, but looked up once, e.g. qt_find_package(JPEG) looked up in
   src/gui/CMakeLists.txt, but the target should also be usable in the
   sibling scope
   src/plugins/imageformats/CMakeLists.txt
   Having the package lookup close to the consuming qt module is easier
   to maintain, because all the other 3rd party dependency lookups are
   in the same file. This goes against the conventional CMake advice
   where each subdirectory should look for its own dependencies, or the
   dependency should be available directly in the root project scope.

3) to make the 3rd party targets available in the root project scope
   as part of the following flow:
   QtPostProcess.cmake ->
   qt_internal_create_module_depends_file() ->
   qt_collect_third_party_deps() ->
   get_property(INTERFACE_QT_PACKAGE_NAME) ->
   write 3rd party Dependencies.cmake file for each qt module.
   Properties can only be queried from an imported target if it's in
   the same scope or was promoted to global, otherwise you get
   'non-existent target' errors.

4) for prl and pri file generation, where we need the targets to be
   available during generator expression evaluation within the
   relevant qt module directory scope

Here is a list of approaches I came up with on how to improve the
situation.

1) Make all imported targets global during the Qt build, by iterating
   over the directory property IMPORTED_TARGETS and making each one
   global.
   Requires CMake 3.21.
   Status: Already implemented for a long time, but is opt-in.
   Pros: Relatively robust
   Cons: Minimum CMake version for building Qt is 3.16.

2) Make all imported targets global during the Qt build using the
   CMAKE_FIND_PACKAGE_TARGETS_GLOBAL variable.
   Requires CMake 3.24.
   Status: Not implemented, but can be set by Qt builders directly on
   the command line.
   Pros: Should be robust
   Cons: Minimum CMake version for building Qt is 3.16.

3) Abandon the desire to have a single qt_find_package in a single
   directory scope, and embrace the CMake-way of repeating the
   dependency in each subdirectory that requires it.
   Status: Not implemented.
   Pros: Should be robust
   Cons: A lot of qt_find_package duplication, will require rewriting
   various code paths, QtPostProcess would have to be done at
   directory scope, unclear if dependency tracking will still work
   work reliably when there might be multiple same-named
   directory-scoped targets, other unknown unknowns

4) Move all qt_find_package calls into a $repo_name/dependencies.cmake
   file which would be read at project root scope. This would
   potentially avoid all scoping issues, because all dependencies will
   have to be specified at root scope.
   Status: Not implemented.
   Pros: No duplication
   Cons: Dependencies are not scoped anymore to module directories,
   won't be able to conditionally look for dependencies based on
   module feature evaluation, not clear yet how this will tie into
   standalone tests which are in tests/ subdir, other unknown unknowns

5) Try to promote as many 3rd party libraries at project root scope
   as possible.
   Currently we have 2 general locations where we look up
   dependencies.
   One is each qt_find_package call. The other is
   Qt6FooDependencies.cmake ->
   _qt_internal_find_third_party_dependencies().

   Many 3rd party targets are created by
   _qt_internal_find_third_party_dependencies() in the root scope, but
   not promoted, and then we try to promote them in child scopes using
   qt_find_package, which causes the promotion errors.

   Starting with 58eefbd0b6169d0749b312268c1ae1e594e04362 and
   37a5e001277db9e1392a242171ab2b88cb6c3049 we now record the provided
   targets of previous qt_find_package calls.

   So instead of waiting to try and promote targets later during the
   configuration process, we can make sure we promote the targets at
   _qt_internal_find_third_party_dependencies() call time, right
   when we lookup the Qt dependencies of the qt repo, in the root
   scope.

   Status: Implemented in this change

   Notably, we only promote 3rd party targets to global for qt builds,
   and not user projects, to not accidentally break user project
   behaviors.

   Also, we only promote 3rd party targets, and not Qt internal
   targets like Qt6::Core, Qt6::Platform, Qt6::PlatformCommonInternal,
   Qt6::GlobalConfig, etc, for a few reasons:
   - the code that requires targets to be global only cares about
     3rd party targets
   - promoting the internal targets is more prone to breaking, because
     there is more than one place where find_package(Qt6Foo) might be
     called, and if that ends up being in a different directory scope,
     we encounter the same global promotion errors.
     Some notable cases where this happens:
      - tests/CMakeLists.txt brings in extra Qt packages via
        StandaloneTestsConfig.cmake files
      - qtbase standalone tests qt_internal_qtbase_pre_project_setup()
        calls find_package(Qt6 COMPONENTS BuildInternals) which ends
        up creating the Platform target in the root scope instead of
	the tests/ scope
      - Qt6::BundledLibpng links against Core, which ends up trying to
        promote Core's internal dependencies Platform and GlobalConfig

   To only promote 3rd party targets, we walk the dependencies of
   an initial target recursively, and skip promoting targets that have
   the _qt_is_internal_target or
   _qt_should_skip_global_promotion_always properties set.

   Pros: Improves the situation compared to the status quo
   Cons: Still not ideal due to the various filtering of internal
   targets and having to mark them as such.

6) Avoid promoting targets to global if we can detect that the target
   was created in a different scope than where we are trying to
   promote it.
   We can do that by comparing the target's BINARY_DIR to the
   CMAKE_CURRENT_BINARY_DIR and skip promotion if they are not equal.
   Status: Not implemented, but we can consider it because it's
   quick to do.
   Pros: More robust than newly implemented approach (5)
   Cons: Requires CMake 3.18, because trying to read the BINARY_DIR
   property on an INTERFACE_LIBRARY would error out.
   Also, if we implement it and make it the default when using 3.18+,
   we might 'collect' a lot more hidden promotion errors that will
   only be revealed later once someone uses CMake 3.16 or 3.17,
   because most will probably use newer CMake versions.
   Perhaps the trade-off is worth it?

Fixes: QTBUG-89204
Fixes: QTBUG-94356
Fixes: QTBUG-95052
Fixes: QTBUG-98807
Fixes: QTBUG-125371
Change-Id: I088a17a98ef35aa69537a3ad208c61de40def581
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit d2e85cede01c0898ca73cbc3fb9f53aa9612cab5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-11 22:22:45 +00:00
Alexandru Croitor
57ec256554 CMake: Move some of the target promotion functions to public files
They will used from another Public.cmake file in a follow up commit.

Change-Id: I71b69ed76ca48c391ba45329eb9c305e4a2a238b
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit dad49f5a1e91dbdf91a683e0a68d05cdfa2e1ef1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-11 22:22:45 +00:00
Alexandru Croitor
8b2112643b CMake: Export the internal library and target properties
Will be used in a future commit to do target filtering.

Change-Id: Iaf7039ff456ca11d94c44c6e12f63408d2aaa484
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 4801d4c708f27a1c29118b0dccd24d2e0d3d6ccc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-11 22:22:45 +00:00
Alexandru Croitor
1da1e23704 CMake: Introduce wrappers for the PlatformX and GlobalConfig targets
Introduce some command wrappers for adding the Platform,
PlatformXInternal and GlobalConfig targets, to apply some common
options.

This will allow for less churn in the future when we need to apply
options to all these targets.

The Qt6CoreMacros, Qt6AndroidMacros and Qt6WasmMacros inclusion are
moved before QtBaseGlobalTargets to make the
_qt_internal_add_library command and other platform specific
commands available before we create the Platform targets.

Change-Id: I260fdbeb95a39f06951dfefc714d3da604abb0bb
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit af60bdee8dcb86b73caa23d4d54611b0f1d33bf3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-11 22:22:45 +00:00
Alexandru Croitor
1a4369d9ac CMake: Link to EGL::EGL target instead of library for GLES dependency
This ensures that the EGL::EGL dependency is promoted to global in
the same scope as GLESv2::GLESv2 if it is a link dependency.

Amends c4d3e5d7d31d4cd2bfec35ba8c86aeb7329288b7

Change-Id: Ia156676b40e6d04a5037a305db35192cad306a0c
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 52a3ab1eb23915b620948dceb577cf23c1b2391f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-11 22:22:44 +00:00
Alexandru Croitor
767b1e529a CMake: Export 3rd party dep info also for the Qt6 package
It usually looks up the Threads target, so we want it to be recorded
as a provided target.

Amends 58eefbd0b6169d0749b312268c1ae1e594e04362

Change-Id: I0f06aaae98fd99da8fb6436d232a147e163580a2
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 8c0fb7e07de071de56a74fc637f448afc8bbd102)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-11 22:22:44 +00:00
Volker Hilsheimer
6ff2302a7f Doc: fix warnings from links by fully qualifying the target
The link to QChronoTimer::singleShot seems to ambiguous for qdoc, as
it's both a property and a method. But linking from startTimer to the
QChronoTimer (and QBasicTimer) class rather than singleShot makes
more sense anyway.

Change-Id: I499b1008b8460d9529b8afd00b5dafbb314ceea1
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 6bbc9c714bf067d33ad2f487c552025aaa7278db)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-11 19:19:49 +00:00
Volker Hilsheimer
f856d1e907 Tests: fix warnings from unhandled PaintDeviceMetric enum values
Amends a5953d20e27ab73774058dd06ac514f9310a41e8.

Change-Id: Ib186eb29b0c51333543cec42b0466b7ffdaef0dc
Reviewed-by: Pavel Dubsky <pavel.dubsky@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit b984a07da6bab511d695dd3082161645a70f9367)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-11 19:19:39 +00:00
Volker Hilsheimer
0f62cc21f5 Doc: fix warnings from incorrect signatures in QJniArray
Amends a6b1f80cd6c833f6eb2fbfb778254cd7fcbc000f.

Change-Id: I40c7b6e756ddb7a4f4fe477e0ec2e42bc97ba027
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit dc2b94551c21c6957c4b266647e4aad7cce1e60c)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-07-11 10:57:30 +02:00
Volker Hilsheimer
d9c38b66aa QJniArray: implement offset dereference operator
The last requirement for making the iterator random-access, so
change category type.

Based on review comments.

Task-number: QTBUG-126150
Change-Id: I617f38f92d0f9279781e62ea3ab1929dbf6a07cd
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit e4b2d7607c0243f2a7ca3f38f59e8532c543fcc7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-11 10:57:27 +02:00
Volker Hilsheimer
0db64ca53b QJniArray: add arithmetic operators
Required for making the iterator random access.

Based on review comments.

Task-number: QTBUG-126150
Change-Id: I80ee8ed584747759acb17ee956551caba4d5bdaa
Reviewed-by: Soheil Armin <soheil.armin@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit c4e406e3792405cfc0b8cc97a29f136c0fd44a2e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-11 10:57:24 +02:00
Volker Hilsheimer
46ed4e47d2 QJniArray: make iterator strongly ordered
Required for making the iterator random access.

Implement compareThreeWay, add tests. Comparing iterators operating
on different containers is undefined behavior, so assert if they don't
match (even if they are different QJniArrays referencing the same
Java array).

Based on review comments.

Task-number: QTBUG-126150
Change-Id: Ib3b94558fc66fb9cff19139d2110c6bbd4ac14b5
Reviewed-by: Soheil Armin <soheil.armin@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit d04f38f6f5e49a81211ab598ba23049dc4ef1507)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-07-11 10:57:22 +02:00
Volker Hilsheimer
708b84be11 JNI: establish API symmetry across QJniObject and QJniArray
We implicitly support QString, QStringList, and QByteArray, as well as
C++ types that are equivalent to JNI primitive types (such as bool for
jboolean, or int for jint) in QJniObject and some QJniArray APIs. Make
this symmetrical for QJniArray::to/fromContainer.

Add more compile- and run-time time test coverage.

Change-Id: I8cc84e6181a93f889282d2d3f0a05207416c4dbe
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit d9dd8c4986373789b8bd250d0c2b36b660fe210f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-07-11 10:57:19 +02:00
Volker Hilsheimer
eedbcad7a4 QJniArray: allow container type for toContainer to be set explicitly
Add a template parameter that is defaulted to what our logic would
select as the appropritate container type. If the type is contiguous
and the element is primitive, use the optimized implementation with
the JNI helpers for copying the entire array region.

Otherwise, use an emplace_back loop.

Change-Id: I669bc3261f111bc0c7e3dd2af8fd33293c083801
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit a6b1f80cd6c833f6eb2fbfb778254cd7fcbc000f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-11 10:57:16 +02:00
Wladimir Leuschner
d1e523c8b6 QWindows11Style: Make ItemViews respect alternating row colors
Fixes: QTBUG-124564
Pick-to: 6.7
Change-Id: I2665ecb253d0413d57e67d598593e8064b1ab84e
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 5d73d64f3eaab51518a4385e2a0a3cec8be91769)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-11 08:33:05 +00:00
Thiago Macieira
af8f5d3aaa QLibrary/Unix: update the x86-64-v3 prefix path in our search
glibc introduced the glibc-hwcaps/XXXX path in glibc 2.33 (2020) and
removed the old, legacy "haswell/" prefix in glibc 2.37 (2022). This
means anyone deploying HW-capable libraries must be deploying symlinks,
so we are not losing functionality.

Because it says "glibc-hwcaps", I am now making this dependent on glibc
for libraries.

Added unit testing for this feature. Tested on Linux, FreeBSD, macOS,
and Windows (the QLibrary test SKIPs everywhere except Linux). We do
create a "libtheplugin.dylib.avx2" on macOS with this change, but won't
attempt to load it (Darwin has fat binaries so lipo(1)ing the files
together would be the right thing to do).

Change-Id: Ic0adfa808d28487a8303fffd17d9e78ec87bbd9a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit a1db2959129cb4630adfffcaaece19bafe16db77)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-11 08:27:24 +00:00
Bartlomiej Moskal
5ee0a2124c Android: Change the touch points numbering
Start numbering Android touch points from 1 instead of 0.

The QPointingDevice was added in Qt6. This means we don't need to worry
about unique IDs for each touch point.
Different IDs are needed for multi touch. The touch point ID of each
physical finger must be unique and immutable as long as either finger is
still pressed.

Theoretically, it doesn't matter from what value we start the numbering
of touches.

The problem with numbering from 0 is that the touch point can be easy
overwritten. It is enough to create QSinglePointEvent (like QMouseEvent)
and by default touch point with 0 ID will be cleared and lose all
current data.

Because of that, Android's touch point numbering will start from 1
instead of 0.

Pick-to: 6.7 6.5
Fixes: QTBUG-112287
Change-Id: I83a4678a0751bdb7a5ff5353ec49866d4cca5f05
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit cb3b972bb128e0ee9e4e18a49119934eee4f7c6e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-11 08:27:23 +00:00
Marc Mutz
72c3ae0a83 tst_QHashFunctions: check bool/integral consistency
It doesn't work.

Pick-to: 6.7 6.5
Task-number: QTBUG-126674
Change-Id: Iefdfdf9071d02f5bc8ea98567a2341f95d6ed460
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 878077de2823c40235237e657c2468e0a6cc2262)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-11 08:27:22 +00:00
Thiago Macieira
8dd5bfa591 QFileSystemEngine::canonicalName: skip QDir::cleanPath()
realpath() is supposed to return the canonicalized absolute path, so
there should be nothing left to clean.

Change-Id: Ie30a3caf09ef4176bb36fffd17cde30c7538dba9
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 31cf699e69808403b6533b08b3194af24cac2eab)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-11 08:27:20 +00:00
Marc Mutz
894837577d QThread/Unix: fix normal exit/terminate() race
The QThreadPrivate::finish() cleanup code is not prepared to be
subjected to POSIX cancellation: if, like on glibc, thread
cancellation is implemented by stack ununwinding, we get exceptions in
dtors and therefore std::terminate(), and otherwise, we leak
resources.

It would be very hard to make the code robust against this, as it
would require all cleanup to be wrapped in pthread_cleanup_push/pop,
with the added problem that these functions need to appear in the same
lexical scope. Another alternative would be to move all cleanup code
into a thread_local destructor, but it's not clear whether code
running as part of thread_local destruction would be exempt from
cancellation, and it would be a major rewrite.

The simplest method is to disable cancellation for the remainder of
the thread lifetime in the shutdown code, just like the startup code
only enables cancellation after initial setup, so do that.

[ChangeLog][Important Behavior Changes][QThread] On Unix,
fixed a race of QThread::terminate() with normal thread exit (running
off the end of run()) which could corrupt QThread's internal cleanup
code. The fix involves disabling thread cancellation for the remainder
of the thread's lifetime once control reaches QThread's cleanup
code. If you rely on a PTHREAD_CANCELED return status, be aware that
this change may mask late cancellations. Likewise, slots connected to
QThread::finished() using Qt::DirectConnection are now run in a regime
where thread cancellation is already disabled. If you need
cancellation in that situation to work, you need to define your own
finished()-like signal and emit that at the end of run().

Fixes: QTBUG-127008
Change-Id: I23030eefdfcebf0a6d6796db5cbbbf0812ae12c0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 01d4be4a8327458a3242804594b498f840480289)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-11 08:27:17 +00:00
Alexandru Croitor
9f331f89ea CMake: Fix SBOM error for corelib
The siphash qt_attribution.json file was moved to the 3rd party
directory out of corelib, without adjusting the attribution file dir
path.

Amends da2d3e914c1b3f9da17c40502c8e7c1463d35612

Change-Id: I25cf9b9f19bc596898d51449ef9561eb9882a046
Reviewed-by: Orkun Tokdemir <orkun.tokdemir@qt.io>
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 0b0b30f7cf900ea0463f4073f0e82d014920fd1d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-10 12:45:12 +00:00
Alexey Edelev
ee1e1b2aae Ensure that we make case-insensitive comparison of CMAKE_SYSTEM_PROCESSOR
In windows CMAKE_SYSTEM_PROCESSOR can be set to both arm64 and ARM64.
Make the comparison case-insensitive when defining mkspec.

Pick-to: 6.7 6.5
Fixes: QTBUG-127044
Change-Id: Id0c8f04bc0ec6b70993e400f9c285168d4c1499b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 7ae19cee1c782fadfbd0c617568fdad8aba9a493)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-10 12:45:12 +00:00
Kai Köhne
5b2fda4357 Doc: Replace mentioning of non-existing Qt permissions API
\l is your friend to detect incorrect links.

Pick-to: 6.7
Change-Id: I347cb3c80664c89183523b683d3f988a1f4ab978
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit d05399c9932e3f00a2f4137a373552b1e781102d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-10 09:53:33 +00:00
Marc Mutz
1c53afb774 tst_QThread: add a test for self-cancellation
Doesn't test anything, just that it doesn't crash.

Turns out we have a race between thread cancellation and normal exit
(filed as QTBUG-127008). Worked around by adding an infinite loop to
run(), after terminate().

Android doesn't support cancellation at all, and our Windows
implementation hits QTBUG-127050, so skip the test on those
platforms.

Pick-to: 6.7 6.5 6.2 5.15
Change-Id: I47a635a31caaf116d3688f31b9b5c5875e9765f5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit a9f7e75a2647732ff998f1c0d112682dbd5c4e28)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-10 07:37:03 +00:00
Volker Hilsheimer
0d7b42d92b HTTP2: refactor setting of temporary key chain into helper
Remove duplicated comment and code that sets and resets the environment
variable. As a side effect, restore the environment variable to the
value that was set before overwriting it, instead of un-setting it
bluntly.

Pick-to: 6.7 6.5
Change-Id: Ife0b2631aff27dbcb23079c2162ffed797b351dc
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit f984a6ab7a99ace65e0d73c3f37ef6ad79dd0aa0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-10 01:50:21 +00:00
Volker Hilsheimer
e25f619663 HTTP2: use temporary keychain in the abortOnEncrypted test function
On macOS with secure transport, set QT_SSL_USE_TEMPORARY_KEYCHAIN
environment variable to avoid the permission UI, which fails the test.

Amends b1e75376cc3adfc7da5502a277dfe9711f3e0536, and makes the test pass
reliably on a local machine.

Pick-to: 6.7 6.5 6.2 5.15 5.12
Change-Id: Id70ceaecfa523d5183236464fe6cfaf4cdbadf4a
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 14a61026216d20eb3a2893420b7d51374e820b44)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-10 01:50:17 +00:00
Thiago Macieira
1ef5911d28 QPluginLoader: set an errorString if resolving qt_plugin_instance fails
We're getting load() == false but errorString() == "Unknown error".

Not backporting past 6.8 because of a new translatable string.

Change-Id: Ic0adfa808d28487a8303fffd17d9ee19ce074e4b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 2be44b57da951007ecab4d6c9e4bc2f3b5cd067a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-09 14:24:35 +00:00
Volker Hilsheimer
d383391990 Rename target of the BSTR test in QtCore to avoid conflict
ActiveQt already has a tst_bstr, so configure fails for top-level builds
with both Core and ActiveQt.

Amends 93686386c078e2be03fb8bc42dee60a9e36fc23f.

Task-number: QTBUG-126530
Change-Id: I4a3d67d72be14202fe487f241ecd3d7c97936e29
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Pavel Dubsky <pavel.dubsky@qt.io>
(cherry picked from commit 43a54cbe82a59a32ae666ddd0cc54e5edd0ccf50)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-09 14:10:16 +00:00
Ivan Solovev
0c3ebbc037 QUuid: extend test coverage for version() and variant()
... to make sure that the follow-up patch does not change the behavior.

Pick-to: 6.7
Change-Id: I4a1898ce0987940622ff38fd70819a83d62515db
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 27fe14cf430980b133694bc86d1224bd56e3faeb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-09 12:32:35 +00:00
Edward Welbourne
eaa78fb2b1 Fix sameLocale() assertions in qlocale.cpp
The assertion is about entries at the same index having matching
language, script and territory tags. I forgot that the system locale
has its m_index set to match the closest-matching CLDR data table, so
might not have the same tags as the locale_data[] entry at its given
index.

Fixes: QTBUG-126390
Change-Id: Icb8cc09cc2a9d66a0af301a300f44923d7400ce9
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 1df1c0b6fdc40a3cb9e89c4d07adc89c37c7582b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-09 10:13:08 +00:00
Giuseppe D'Angelo
159d63edb5 PDF: add a way to customize the output intent
PDF/A-1 and PDF/X-4 require the use of an output intent. Insofar this
has been hardcoded to be sRGB. Instead, expose the relevant setting so
that the user can choose another colorspace, and set the metadata
about the intent.

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

[ChangeLog][QtGui][QPdfOutputIntent] New class.

Change-Id: Ib3f0620477ddcc8b294a7039c120e89cc318f513
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit e8fcdf9bb6318e75d64179a6682481154cdef14f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-09 07:58:24 +00:00
Kai Köhne
e309f0b013 Core: Move SipHash implementation into separate file
Isolate the code inspired by the SipHash reference C implementation
in a separate file. This makes it clearer what code is available
under the CC0 license, and which not.

[ChangeLog][Third-Party Code] Adapted copyright information for the
SipHash Algorithm (used in Qt Core).

Change-Id: I9b8fc27a4e791c0f1ccbdfa6244d4fa47c7a219b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit da2d3e914c1b3f9da17c40502c8e7c1463d35612)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-09 07:58:23 +00:00
Friedemann Kleint
0925c2d80a uic: Relax property name checks
Use an approximation of the "Unicode Standard Annex #31"
for checking the property names and enumerations.

Remove check for dynamic properties and use character literal
formatting for them instead, which will escape offending characters.

As a drive-by, use QStringView parameters for the check function.

Amends 53c8d1fe7c59f3462b85193b688d02ff353b51d5.

Task-number: QTBUG-126265
Task-number: QTBUG-126860
Pick-to: 6.7 6.5 6.2 5.15
Change-Id: I90fe555e64327e4164a17c1af0a734e4b1d834db
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
(cherry picked from commit aae20da52a11e0ebb8c4f5fcfb95ce6744f659a3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-09 05:41:05 +00:00
Edward Welbourne
bc28d6d48c Kludge round macOS 15 knowing more about offsets than transitions
Darwin turns out to know about offset changes a million years into the
future, but to not admit to there being any transitions more than (a
bit over) half a million years into the future. It thus failed the
non-ShortData part of tst_QDateTime::timeZones(), thanks to using
correct offsets that showed there must be a transition in the
interval, but not believing in that transition.

The discrepancy leads to QTimeZonePrivate::stateAtZoneTime() getting
valid data for before and after the transition, with different
offsets, so amend its "no later transitions" early return to check the
offsets do in fact match. If they don't fall back on the code that
handles the case where we don't know about transitions but do have
offset data.

Pick-to: 6.7
Fixes: QTBUG-126391
Change-Id: Iefda439377ebc3025f2b754e2ec686fcc6361a1b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit cb870adad612018e7007f4a1b6066b49d0f2dc4a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-08 20:19:08 +00:00
Tor Arne Vestbø
1407e54f34 qmake: Use utimensat on macOS when propagating mtime during install
macOS only claims to conform to POSIX.1-2001, but has had utimensat
since macOS 10.13.

By enabling the utimensat code path, using stat.st_mtimespec as input,
we get nanosecond precision when qmake installs files.

Without this the tst_qmake::install_files tests fails due to the source
file having a sub second timestamp -- 2023-07-31 15:58:12.468 -- while the
installed does not: 2023-07-31 15:58:12.000.

The reason this test passes in the CI right now is probably because
the source file archive we use to pass test sources to the test
machines does not support the same level of precision.

Change-Id: I6ca7a2a2f9e71981814cbf496aa55717b3a3f74f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit a2779192eec649a15b909cd9becade7eb0bda34e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-08 20:19:07 +00:00
Giuseppe D'Angelo
9cc291fe94 PDF: code tidies: sort includes
Change-Id: I78764e2517b39d0ca7ec8fdb41f8344ed876ee27
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit d69a1e8e626c33d9e8eb5c62fc13ead51ceb49bf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-08 19:44:38 +00:00
Giuseppe D'Angelo
a30591603b PDF: add support for PDF/X-4
PDF/X-4 is a subset of PDF 1.6, aimed at printing fidelity. We can
support it with a few refactorings of the existing code in
QPdfEngine.

* Add the new PDF version to QPagedPaintDevice / QPdfEngine.

* Always write the XMP metadata, no matter what's the PDF version
  used. XMP used to be written only for PDF/A-1b, but it's supported
  by PDF 1.4 and 1.6 so there's little reason not to write it.

* While at it, ditch the search&replace approach for the metadata
  and use QXmlStreamWriter instead, since it gives us extra
  flexibility that we need (emit different tags depending on the
  PDF version in use).

* The old code had a bug where the timestamps in the XMP metadata
  and the document information dictionary could fall out of sync.
  Just use one datetime object in both places.

* Add /ModDate and xmp:ModifyDate (required).

* Add the required attributes in the xmpMM namespace.

* Add a way to set the document ID to a custom UUID, and use it
  in the XMP metadata as well as in the /ID in the trailer. Emit
  the ID unconditionally, as it's been available since PDF 1.1.

* Emit the output intent for both PDF/A-1b and /X-4. This will be
  amended in a future commit to let the user choose the colorspace.

The only missing bit is §6.5.4 of the PDF/X-4 spec. This imposes that
all symbolic TrueType fonts shall *not* specify an Encoding, and have
exactly one encoding in the cmap table. This is basically requiring what
§5.5.5 in PDF 1.6 only suggests (page 400). However it seems that we are
not embedding a cmap table when extracting a font subset, and that's
already violating PDF/A-1b anyhow. This is tracked by QTBUG-125405.

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

[ChangeLog][QtGui][QPdfWriter] Support for PDF/X-4 has been
added.

Task-number: QTBUG-125405
Change-Id: Ia81f29b07b819eca5767c9f17692d92a3010f5ad
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 2fbece8a73cb2d2692c78c38e1576c0c9c62fce7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-08 12:46:00 +00:00
Tor Arne Vestbø
5397e0ddd1 Blacklist tst_Http2::duplicateRequestsWithAborts on macOS ARM
Task-number: QTBUG-119616
Change-Id: Ic02d423ef8a0cb9ab71d293428cb7d66ced19cdf
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit c4249b0f1477597c0ae9b56df5f893bd1b337d83)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-08 11:30:37 +00:00
Marc Mutz
19fbb338b8 Long live Q_DECLARE_SHARED_NS!
We used to mark Q_DECLARE_SHARED all our value classes in Qt 4 times,
but since many Qt types these days live in nested namespaces that
macro, which only works in the QT_NAMESPACE, has become less useful.

As we use it in more and more places and eventually add more
responsibilities to it, we don't want every module to define its
version by hand, like QT3D_DECLARE_SHARED did in 2016 already.

So add two namespace-aware versions of Q_DECLARE_SHARED, to be used
inside or outside nested namespaces.

Extend the test.

Despite the name, this is not a public macro.

Found missing Q_D_S in API-review, so picking this to 6.8 to aid with
fixing the 6.8 API.

Change-Id: I367ca0d5b005b64090de44f7b7541d8639f9a4e0
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 37b2b2ea4ef3cf494d23885de186a9519763e744)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-08 11:29:50 +00:00
Joerg Bornemann
dc3b7d2203 configure: Fix --foo=bar arguments
Commit ae64c54f8cc2491988241a7433f5e8cfc6016ab4 broke configure
arguments like
    --webengine-jumbo-build=20.

That commit transforms the argument to
    -webengine-jumbo-build=20
but single-hyphen arguments take values without an equal sign.

We need to store the unaltered argument (with the two hyphens) for
further handling instead of the single-hyphen variant.

Fixes: QTBUG-126872
Change-Id: I243eb072dfe5535a648bd78bb3aeb3b9e0e4ede0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 76d5bceba7f1c553b02def689f2010db671ec60f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-08 09:02:35 +00:00
Nicolas Fella
f57d5c492d FileChooser portal: Store directory as QUrl instead of QString
Otherwise we lose the scheme when reading it back as QUrl

Pick-to: 6.7 6.5
Change-Id: Ice6e083611c93641ef33f00fa48f1b32dc25f718
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 46ffca13fb0705c54ad05bc2c1a37f7d5fb5132d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-07 23:00:39 +00:00
Tor Arne Vestbø
79370e0b4c qmake: Don't _debug-suffix libraries in single config framework builds
On Apple platforms we no longer _debug suffix libraries (and plugins)
in single config framework builds. This is a follow-up for logic in
qmake that didn't get adjusted in d3be87ff1d558f05309b1f29f7e71f291498584f.

Change-Id: I6461fca9da5c3ac1382ffc46e63409ef0150ad46
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 20d89a2710488ca5f9f6674c4c6d167f3a193383)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-07 11:32:24 +00:00
Tor Arne Vestbø
705dbea2a9 Call QWidget::setVisible, not QWidgetPrivate, when showing children
As part of 5ba0982b2879a1a4c13bf97467b8e5ad296e57a2 we started calling
QWidgetPrivate::setVisible instead of QWidget::setVisible when showing
children, to avoid setting ExplicitShowHide.

Unfortunately some widget subclasses wrongly override setVisible to do
initialization, which resulted in these widgets not running their init
code. The documentation clearly specifies to use showEvent or Polish
for this use case, but to avoid a regression we temporarily set a flag
that prevents QWidget::setVisible from setting the ExplicitShowHide
attribute.

We can not rely on simply unsetting ExplicitShowHide after our call
to QWidget::setVisible, as the call might recurse into logic that
checks ExplicitShowHide and wrongly determines that the show is
explicit.

Fixes: QTBUG-126721
Fixes: QTBUG-126218
Pick-to: 6.7
Change-Id: Ibf88340b68cb4fcb20ce3d8ec5b76de0fd2d2551
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit fc4c6fb5f6bd6bd63b13f1f8b5b7a7289a5fd230)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-07 09:03:17 +00:00
Tor Arne Vestbø
7b53e87bd7 tst_QWindow: Remove data for positioning test
We no longer support fake fullscreen mode on macOS, and haven't for
a long time.

Pick-to: 6.7 6.5
Change-Id: Ic2eb6065239c4e5be5ab2011a6da50272c77460a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 4079ecfb9b3dc794212a81154e18145256741cfd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-07 09:03:07 +00:00
Tor Arne Vestbø
f31e7385c1 macOS: Respect QWindow frame positioning on first show
When the QCocoaWindow is created it picks up the QWindow geometry,
and applies that to the NSWindow it creates. But since we haven't
created an NSWindow yet for the first step, our logic to adjust the
window geometry when the positionPolicy is WindowFrameInclusive is
a noop. As a result the NSWindow gets a client geometry corresponding
to what the user requested as the frame geometry.

To fix this we hook into [QNSWindow setContentView:], where we apply
QWindow properties to the NSWindow after creation.

The tst_QWindow::positioning test has been split out into a separate
framePositioning test.

Pick-to: 6.7 6.5
Change-Id: I85fe6ad10aee8346202de3d55d6b2cd89915c5df
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 31ec108dd08d6381a15e49b6fbec9337705c3b2a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-07 09:02:39 +00:00
Friedemann Kleint
8fc29f208b uic: Fix some clang-tidy warnings
- Repeated return types
- Make member functions static
- narrowing int conversions
- Use auto *
- Use list.isEmpty()
- Use modern includes
- Remove redundant access specifiers
- minor fixes

Change-Id: I14ddf1add667536739fbb5fabb357dbaa7ef35c3
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
(cherry picked from commit 6346c5b426935a767575ea758e99749bc6544f54)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-06 11:53:00 +00:00
Marc Mutz
03f2dfca7c QString: de-pessmize QString(QLatin1StringView)
Instead of default-construction followed by move-assignment, delegate
to the move ctor instead.

We can't expect the optimizer to do this transformation for us, since
fromLatin1() is out-of-line and compilers are not, yet, known for
optimizing atomics (ref-count) around out-of-line function calls.

Amends 6abdbb65e59779af56ae25372a853efca19eac59.

Pick-to: 6.7 6.5
Change-Id: I75b747c4d5269ae125bf12cda57a1f718aa7a467
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit f7853680ef68ce2495662ffc7c7a933655436f22)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-06 11:52:57 +00:00
Marc Mutz
8a17835180 Long live QT_DEFINE_TAG(_STRUCT)!
We seem to be using more and more of these, and their definition is a
bit subtle (need to have an explicit default ctor to avoid {} being
an initializer for the type).

Port the existing tag structs over to the new macro and add a test,
even though we found two users of QT_DEFINE_TAG in QtBase alone, one
of which is actually widely used (Disambiguated_t). There are more in
other modules.

Change-Id: I046bb2b70a2c7e79be2315d91c43e5fd2f0968a0
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 74a87a329498422db0dea3e469fb84704accbb2b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-06 10:17:55 +00:00
Marc Mutz
377b4df13b [doc] Q(Persistent)ModelIndex: document behavior of data() on invalid Q(P)MIs
We return a default-constructed QVariant. What else could we possibly
return? Right: nothing else.

So document it and add a test.

Pick-to: 6.7 6.5 6.2 5.15
Change-Id: If9808703b8ddfd15ceb013996741af8cd4efea12
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit d1a5e602df5978cee6bd263db77745f8047e508e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-06 10:17:53 +00:00
Marc Mutz
072316ccc4 tst_QGlobal: add a check for Q_DECLARE_SHARED
Check that it marks types are Q_RELOCATABLE_TYPE and adds the ADL
swap().

Pick-to: 6.7 6.5
Change-Id: Ibde0f4ad594e4a6b3636357da2fd211507293b60
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 91a96ea8fb100fca08b37eb3ba644083b3316e6d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-06 10:17:51 +00:00
Marc Mutz
9ef785082a tst_QtConcurrentThreadEngine: fix UB (uninitialized boolean)
Says ubsan:

    tst_qtconcurrentthreadengine.cpp:96:17: runtime error: load of value 190, which is not a valid value for type 'bool'
    PASS   : tst_QtConcurrentThreadEngine::stresstest()

Initialize the variable using NSDMI.

Amends the start of the public history.

Reported-by: Even Oscar Andersen <even.oscar.andersen@qt.io>
Pick-to: 6.7 6.5 6.2 5.15
Task-number: QTBUG-115264
Change-Id: Ie55bc0a697a71074066294d64821c8a7a0d1f467
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Even Oscar Andersen <even.oscar.andersen@qt.io>
(cherry picked from commit 32442c2b52381f5e4164ae217453a8e8391d9349)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-06 10:17:50 +00:00
Marc Mutz
056c89e95d QRestAccessManager: don't leak slot objects when no QNAM was set
We try to pass QSlotObjectBase as raw pointer through the ABI
boundary, because we hope to have the template-wrapper tail-call the
out-of-line helper¹. But that means that the out-of-line helper needs
to ensure that it deletes the slot object on every possible exit from
the function. The old code didn't do that e.g. when the qnam check
failed, or, theoretically, if requestOperation() threw an exception.

The new code places the slot object under SlotObjUniquePtr guard as
soon as possible (but, due to amount of callers, not before
executeRequest()). Port createActiveRequest() to receive the slot
object already in a smart pointer. Tail-calling isn't required here,
because caller and callee are part of the same TU so the optimizer can
do whatever it wants. Unique_ptr passing shouldn't be that hard to
optimize.

¹ If we were to pass by SlotObjUniquePtr, tail-calling would be
  impossible due to the need to run the unique_ptr's dtor after he
  call to the helper.

Amends 9ba5c7ff6aa42c5701cf950d2137467a2d178833, but
e560adef213301318dcc13d4db155624846e0420 already had the
requestOperation() problem.

Pick-to: 6.7
Change-Id: I2ab5eadb35625393f274e3391d7b7c393ed8f08a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 11725d46344105325a1dec8628708ab88483ca12)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-06 10:17:48 +00:00
Ahmad Samir
e37832cc37 QDirListing: const_iterator: mark the relational operators noexcept
Pointed out in code review.

Change-Id: I7754f510f4cca5e9fc695a26caaf124133602f32
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 9a8768c7159869aa216b7328c69f4b80f26f467e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 20:22:06 +00:00
Marc Mutz
e6fc32a9c5 QArrayDataOps: fix appendUninitialized()
... to be strongly exception-safe and call placement new correctly.

The old code could call user-provided overloads of new, because it
didn't cast the pointer to void* before calling placement-new. It
would also "randomly" stop when an exception was thrown. It correctly
updated the size of the container only after successful construction
of the element, but that's just weak exception-safety. There's no
reason this operation shouldn't be strongly exception-safe.

So instead of a raw loop around raw placement-new, use the
corresponding raw memory STL algorithms. They handle exceptions and
call placement-new correctly, and the code is both simpler as a
consequence, and more efficient, as it updates this->size only once.

Found in API-review.

Amends 73bf1c1a9bcc2615370d6a199420da0c6f380a44.

Change-Id: I535f393a3c378e1eea104bd3a05a274b9ec17964
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f699248c0f3ad44f09a422304870f40c1998a1a5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 20:22:05 +00:00
Tor Arne Vestbø
ea1978c7f9 visionOS: Report size of root view as screen size
Even though we've decoupled QIOSScreen from managing UIWindows, we still
have one UIWindow per screen, so we can pull out the bounds of that root
view to determine Qt's screen geometry.

Change-Id: I05993ad6d629dd2158681dd17355b7e216bfbb49
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 16483487c4e37546cf296a72e137d49d28b55e05)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 20:22:02 +00:00
Mate Barany
63ad52d991 Add the nodiscard qualifier to the constructor of NetlinkSocket
This is a RAII class the result of the constructor call should never be
discarded.

As a drive-by made the constructor explicit.

Task-number: QTBUG-125026
Pick-to: 6.7 6.5
Change-Id: I651dda87b5191d50e111732d11bab8d5aa58e9af
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit b9511f582a37b6dfc58d7ce9c2526565cda655c5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 20:12:04 +00:00
Tor Arne Vestbø
02fd2c19fd macOS: Add missing product names for QSysInfo::prettyProductName()
And restructure the logic a bit for easier maintenance in the future.

Pick-to: 6.7 6.5
Change-Id: I6ff7396378bf02e177a4fb06978683474a79ad2f
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 61b70bd7de91a2aab8609e1f878043d2aceb6bfd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 15:55:32 +00:00
Mate Barany
16b0042dc6 Use non static data member initialization on errorcode in QSslContext
Address the "A constructor must initialize all data members of the
class" warning.

Found by an Axivion scan.

Task-number: QTBUG-125026
Pick-to: 6.7 6.5
Change-Id: I46a7dd358d107670846fa35c0b02d2591258438d
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 69bf95e2e05fb1ded0d74a7ebc5fa112e0854a5c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 15:55:32 +00:00
Alexey Edelev
d3e686c562 Remove the QT_KNOWN_PLUGINS property definition
It doesn't seem the property was ever used even at the times it was
introduced.

Pick-to: 6.7 6.5
Change-Id: I55d8b558e548908306178827c4149728ce35d0e8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 3bfd1c4ded8cb4a7d1d501401a82e812fc631fc2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 15:55:32 +00:00
Alexey Edelev
9bf92f9a5a Use add_compile_definitions instead of add_definitions
add_compile_definitions allows having the generator expressions as
the items in the definition list. add_definitions do not support pure
$<...> without the prescending macro name with the assignment.

Pick-to: 6.7 6.5
Change-Id: I1e79f1cf395b62b1e481eb0f3c74f93c61f06381
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 032fdcbcc00380e9a181f5adf2be767194bb35d3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 15:55:31 +00:00
Mate Barany
16f95639a1 Initialize the ssl variable in QHttpNetworkRequestPrivate
Address the "A constructor must initialize all data members of the
class" warning.

Found by an Axivion Scan.

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

Found in API review.

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

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

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

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

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

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

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

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

Found by an Axivion scan.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Amends ecb0878cbc3bc677d0f440950d2d1e304bcea495.

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

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

Amends 1697fbdf05ff643d617a9ba1614454926e86a3d9.

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

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

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

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

Amends ed6d1fa71a79a70b7e6a20fbbc737ed9f6c287b1.

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

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

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

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

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

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

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

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

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

This patch amends 81984807b30b1865a98fbd928a29d5ab6d8f5375

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

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

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

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

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

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

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

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

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

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

Amends 675b4f63feab7c81c75e49f6dea82a39dd18f489.

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

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

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

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

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

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

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

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

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

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

Task-number: QTBUG-126530
Change-Id: I815c22f21b4a9b174d0d49ceb014bbffe41b6e82
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit d7edf2894c94271c3794a85ecf24a24ce92d2fcd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-01 23:23:47 +00:00
Jøger Hansegård
89ba182737 Use Microsoft::WRL::ComPtr to manage lifetime of QWindowsUiaMainProvider
Using smart pointers for managing COM object lifetimes reduces risk of
introducing reference counting regressions.

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

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

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

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

Change-Id: I536497da1938131298c1198db85dab74d6157e35
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit bcfa0102e5910d99263ebb73515cc9d35b818b5c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-01 20:55:49 +00:00
Tor Arne Vestbø
a68f5a12ce Apple: Don't _debug-suffix libraries in single config framework builds
As part of fee15182949e88682131399c50b679be83a75385 we enabled framework
debug builds, which left us with an inconsistent library naming. The
framework libraries are always unsuffixed, e.g. QtGui.framework/QtGui,
while we were adding _debug suffixes to the plugins and static libs.

This was confusing macdeployqt, as it uses simple string matching logic
for "_debug_" to detect that a Qt build is a debug build, and since
the framework library didn't have a suffix it then failed to deploy
the suffixed plugins.

We now follow the requirement from the framework naming and skip the
suffixing for all libraries in this configuration.

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

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

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

Task-number: QTBUG-125859
Change-Id: I2b12d2b80614f627c1aca514a10e1e86a2c5b24d
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 5e9212c1069604dd88fef9f0877459abeb87ad27)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-01 20:55:48 +00:00
Alexandru Croitor
1c633d68b4 CMake: Add IMPORTED_LINK_DEPENDENT_LIBRARIES for versionless targets
When creating non-aliased versionless targets, make sure we also add
the config-specific IMPORTED_LINK_DEPENDENT_LIBRARIES properties, so
that for older CMake versions, we still get the -rpath-link handling
of the dependent libraries.

Amends 173164cd477211e574c0d04abef51aa0f4c3f78d

Task-number: QTBUG-126727
Change-Id: I22618a51bd98cc851ec1a01a27086e0b878bee8d
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 16f49f6a1c58919fb15c82d8381d7fc0ff5557ad)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-01 20:55:48 +00:00
Alexandru Croitor
bc4459ee31 CMake: Write link dependencies into AdditionalTargetInfo.cmake file
When a shared library target has private dependencies to another
shared library, they are exported by CMake into the target's
IMPORTED_LINK_DEPENDENT_LIBRARIES_<CONFIG> property.

This property then is read by the consuming project to determine which
file paths need to be added to the -rpath-link linker option.

Due to the simple logic that CMake uses to process this property,
if the project CMAKE_BUILD_TYPE does not match the _<CONFIG> part of
the property, the dependent libraries will not be added to
-rpath-link, causing link failures.

Make sure we explicitly set all the possible variants of the property
in our custom Qt6FooAdditionalTargetInfo.cmake file, to ensure we
always pick up the relevant dependent libraries for processing.

In conjunction with 173164cd477211e574c0d04abef51aa0f4c3f78d and
1c287cea291d2a88770ff02771845d2a34e80964 in qtbase, this should
hopefully avoid most -rpath-linking issues for QNX and Yocto builds.

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

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

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

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

Fixes: QTBUG-125160
Change-Id: I6303d76bc437f7eee806e4429bef81b5fbeb1e27
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit abfeb4542c9107fa40511209d25bc7d0b5db1a8c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-01 20:55:48 +00:00
Eirik Aavitsland
a721428478 Add a few improvements to the baseline testing framework
1) Add a QBASELINETEST_MAIN macro as a replacement for QTEST_MAIN,
relieving the clients of reproducing the kludgy workaround

2) Add a -server command line option to baseline tests, as an
alternative to specifying the server in an environment variable

3) Fix command line parsing so that it exits on syntax errors.

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

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

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

Amends b49211c12543c3369b286b507c4277c66ef9fdef.

Fixes: QTBUG-126043
Pick-to: 6.7 6.5
Change-Id: Ia9bc07a41daeb9e5b5b3306df08e5d97fa38f96f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 2fcab872bc28b39b549d941ec6bb71bd25f20593)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-01 17:57:41 +00:00
Topi Reinio
e880bf86fe Doc: Add macros for generating a grid structure of items
These macros generate a a three-column grid of items in online
documentation.

These make for a clutter-free and more visually pleasing result
in many cases, compared to a standard \table layout.

For compatibility reasons, these macros continue to output a table
structure in offline documentation builds.

Task-number: QTWEBSITE-1144
Change-Id: Iab994b383f488dbd225c6a04d64cf41e2dbb20e9
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit a65314d5da0176224279c11398ff3c76b4cf6878)
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2024-07-01 11:44:37 +00:00
Andreas Eliasson
199f06e31b Doc: Link to QRhiColorAttachment after 'resolve texture'
After mentioning 'resolve texture', link to the QRhiColorAttachment
class to provide more information.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Add the test from the bugreport to tst_QHashFunctions.

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

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

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

Change-Id: I68d1fd2f9952ec3bf54b1ba27461bf1751c9d301
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
(cherry picked from commit b950ec2525af789b3d447218ae62906c2f78f5a5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-28 06:15:16 +00:00
Marc Mutz
954e7b623b tst_QSettings: port to QTEST_THROW_ON_FAIL
Dogfooding the new QtTest 6.8 feature. Allows to get rid of a wrapper
macro.

Rename the underlying lambda to use imperative mood.

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

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

Thanks to Thiago for pointing this out in code review.

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

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

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

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

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

Amends 1a0da3ae69964142b3a31d87ecc88a925006a4de.

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 675b4f63feab7c81c75e49f6dea82a39dd18f489.

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

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
Łukasz Matysiak
8fd1bbd2db Blacklist tests requiring parsing text > 255 chars on VxWorks
The "many-0 max dec" tests check if a large number (512) of leading zeros
interferes with parsing the number.

The std::from_chars implementation available on VxWorks cannot handle
strings longer than 255 characters.
The number is properly parsed, but the ptr returned as a part of the
std::from_chars_result does not contain the correct result.
It should point to the end of the string (as there is nothing left after the
number), but it wraps and starts to point to other places.
This leads to a wrong value returned by qstrnto(u)ll and to a failing
test.

The issue has been acknowledged by WindRiver. For now, blacklist the
"many-0 max dec" tests.

Pick-to: 6.7
Task-number: QTBUG-115777
Change-Id: I0a897728c71503e6817c69f8ced8ebb0a45295af
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit aea27282b783059ef52e928e811029cedb98ebf9)
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
Tatiana Borisova
1ecd3b8858 tst_QAnyStringView: remove unused ONLY_3WAY() macro
Amends 2bc9ad0e5dd75cf69f4a8bf94a6a917de2b4e8c4.

Change-Id: I57a99fa82f1740405e2a8f8571ac2c6ba073ae91
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit a7fdc926558981c99cb9fcc80074621b8af4968c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-26 22:52:29 +00:00
Alexandru Croitor
c2845f9eed CMake: Make ninja 'sbom' work for top-level builds
We need to pass all dirs where sboms will be generated, for external
document referencing.

We also need to set up dependencies between the repo sbom custom
targets, so that qtsvg sbom is only run after qtbase sbom.
We use the dependencies.yaml info to set up the dependencies.

Task-number: QTBUG-122899
Change-Id: Id3331e11742bc2c86e7ed52ce26b3ff21eace359
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 31126b2b775ae52a0d74aadf1aff8f6d79d0c6be)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-26 16:49:31 +00:00
Alexandru Croitor
803aae2f6c CMake: Rework Python interpreter finding for SBOM
Repositories like qtwebengine and qtinterfaceframework might search
for a Python interpreter earlier than _qt_internal_sbom_find_python is
called and might find an older version of Python that is not
sufficient for SBOM purposes.

In that case Python3_EXECUTABLE would have been set, we would not try
to look for Python 3.9 and then fail trying to find python
dependencies or when executing one of the SBOM steps.

Rework the lookup process to be contained in a function rather than a
macro, make sure we temporarily reset any found python executable so
far and explicitly look for Python 3.9 after which we cache it into
custom cache var.

This allows finding and using a Python interpreter for SBOM purposes,
without interference from a possibly older version already found for a
different purpose.

Because the macro is now a function, we can get rid of some of the
backup state management code.

Task-number: QTBUG-122899
Change-Id: Ia846843a4e5cc8c91963ea76557639fc19e25913
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit e7bfdb976a2478c0d6d33cffa40b475ca106a28f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-26 16:49:28 +00:00
Alexandru Croitor
cbc03bd5ba CMake: Skip handling binary files in SBOM for excluded targets
If a target has the _qt_internal_excluded_from_default_target property
set, don't try to add file SBOM information for the target, because
the file will not be built nor installed by default.

We check for a new custom _qt_internal_excluded_from_default_target
property instead of EXCLUDE_FROM_ALL, because EXCLUDE_FROM_ALL might
be set to a genex that excludes all configs except the main one, but
we are interested whether the target is entirely excluded.

Task-number: QTBUG-122899
Change-Id: I79d6a4b0c65356da14f7ff50ee3639705f5fabbd
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 34b5dc041b0d34a76c081719fafa8f48265e34ae)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-26 16:49:25 +00:00
Alexandru Croitor
62f86062d4 CMake: Allow force disabling generation of SBOM
We need it to disable generation for certain repos like qtqa, even
if the platform config says that SBOMs should be enabled.

We can't just set QT_GENERATE_SBOM to OFF, because the general SBOM
CI instructions are added later that module specific ones, and thus
would override the value back to ON.

Providing a separate internal variable allows us to disable it with a
higher priority.

Task-number: QTBUG-122899
Change-Id: If7803ae4aac0886d605a542e3f05ad9533bb8108
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 0ea3164969bbc7eda71bcf77e716e2a8ec23c8c4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-26 16:49:23 +00:00
Alexandru Croitor
e73b10bf4f CMake: Handle system alias targets when recording them for the SBOM
Un-alias system target names before processing them for the SBOM,
otherwise we'll get errors about trying to set properties on alias
targets.

Amends 37a5e001277db9e1392a242171ab2b88cb6c3049

Task-number: QTBUG-122899
Change-Id: Ifef2108be123549505ed67f0b9c258a10431c84e
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 089111aee0d4a98900aa35fa24d1a9cbbb03b905)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-26 16:49:20 +00:00
Alexandru Croitor
da4308ba6a CMake: Only record existing system library targets for SBOM
In certain cases the qt_find_package(PROVIDED_TARGETS) might not
exist, so we shouldn't record the targets for SBOM spdx id
registration in that case.

Amends 37a5e001277db9e1392a242171ab2b88cb6c3049

Task-number: QTBUG-122899
Change-Id: Iada6b5a20a3e7526f18ae4385db8a29fee68ab36
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 0f5699ee3ddb2ec426f1b9c51484ec96241db8bf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-26 16:49:17 +00:00
Alexandru Croitor
8735182dc6 CMake: Fix escaping in recording of provided targets
In diff of below change, patch set 4 to 5, the list(APPEND) was
replaced with a string(APPEND), but the escaping of semicolons was not
removed. This caused an issue with packages that provide multiple
targets when configuring qtsvg in a static qt build.

Remove the unnecessary escaping.

Amends 58eefbd0b6169d0749b312268c1ae1e594e04362

Change-Id: I1755f31b333e7cf76722cff490349bcc159d7e93
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 9279a2f60e15ae02eb74f12db74a83cf3c1848d4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-26 16:49:15 +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
Ahmad Samir
ce99ae49b9 tst_QLineEdit: de-duplicate test row names
Pick-to: 6.7 6.5
Change-Id: Iad02fc6c42b2223fbfba60262926ff94c43cc38e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit ea4a9488db038f7af2a0df53e41efc08c303ddab)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-24 20:44:00 +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
Alexandru Croitor
72e07e1c0f CMake: Fix rebuilds when reconfiguring due to qconfig.cpp changes
Previously when configuring on the first run,
when qt_configure_process_path was called with the default "./plugins"
for INSTALL_PLUGINS, we would write that value directly to
qconfig.cpp.

After a build, if we reconfigured qtbase, the function would then
canonicalize the path via file(RELATIVE_PATH), and write 'plugins' to
qconfig.cpp, which would cause unnecessary rebuilds.

Make sure we canonicalize the path on the first configuration as well,
to avoid the rebuilds.

Simplify the code a bit, and fix a drive-by where we set rel_path to
"." before, but never actually set the cache variable in that case.

Amends 48dbcefe57860f70e9bc4859983d2596634ea8f3
Amends c269d8f0862fd2c581d57584e8d7e2493f387ee7

Change-Id: I8749a85946e93cdf8672113638b499d0d3a31e5c
Pick-to: 6.7
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 0856387f5a6b3b928400045054b60cfd896ee06b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-24 11:58:10 +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 27239f4fcfa6f64d60e7b79185ff413878152ebd, 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 7044409c878f100c005b76fc90717b4f71667f04 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
27239f4fcfa6f64d60e7b79185ff413878152ebd.

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 18afb3bcd0471082101f8813a017b0444942cc4c.

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
Ulf Hermann
262c7853a3 QIcon: Fix test plugin
The plugin was built into the base directory of any build that included
its CMakeLists.txt. Subsequently it was required by any project built
against this version of Qt and linked against QtGui. Since it couldn't
be found in the usual places to look for plugins, all those builds
failed.

Amends commit 87896c03c1baccff0049b582dcbf512716aeb8bc

Task-number: QTBUG-126393
Change-Id: I4c577c60459d5f6cb654714ce6e97f87c1f6f640
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
(cherry picked from commit b01dd59d764cf5787b36075cc273a9a56be55a8e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-21 11:22:53 +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 6675e8c942c2f9797d66269368c729c5556528c2.

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
Marc Mutz
53d9f99a08 Port tst_QFormDataBuilder to new style [5/6]: specifyMimeType()
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 specifyMimeType(), too.

Requires to actually open the QBuffer and to revert the needles from
QString back to QByteArray.

Also anchor the needle between two CRLFs, because they each represent
one full header field. This is like anchoring a regex with ^~~~$.

As a drive-by, use QVERIFY2().

Task-number: QTBUG-125985
Change-Id: I8f7830e49d05044ef7388338498c96334a489c90
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit 9bcf320fc1d3b484a39d692fd2c69c96f05e63e4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 23:10:55 +00:00
Marc Mutz
1fc54987d4 Port tst_QFormDataBuilder to new style [4/6]: setHeadersDoesNotAffectHeaderFieldsManagedByBuilder()
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 setHeadersDoesNotAffectHeaderFieldsManagedByBuilder(), too.

Requires to actually open the QBuffer and to revert the needles from
QString back to QByteArray.

Also anchor the needles with a CRLF on each side, because they each
represent one full header field. This is like anchoring a regex using
^~~~$.

As a drive-by, fix indentation and brace placement of initializer_list
QList consruction and rely on CTAD to deduce QByteArrayList from QList{}.

Task-number: QTBUG-125985
Change-Id: I405b5d67212e906a3b914d9e5b815835bdee5bc6
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit ab859d5f96855eeec50f3b39c925203ba7def73f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 23:10:47 +00:00
Marc Mutz
a8f7a59b07 tst_QFormDataBuilder: give \r\n a symbolic name
... CRLF, what else?

Change-Id: Ibefb83495c34034a6727a0eaa42d8b312e0594ac
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit aeb1b9b48746395fc6680aa3fdda3469826b7ae8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 23:10:41 +00:00
Marc Mutz
df6a26d9f0 Port tst_QFormDataBuilder to new style [3/6]: picksUtf8FilenameEncodingIfAsciiDontSuffice()
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 picksUtf8FilenameEncodingIfAsciiDontSuffice(), too.

Requires to actually open the QBuffer and to revert the needles from
QString back to QByteArray.

Task-number: QTBUG-125985
Change-Id: I13c41e8df86296ae8652c460039798eb529d4628
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit 2541f1945d2a64de7b2c13465a178ef70d96da89)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 23:10:35 +00:00
Marc Mutz
95590adb55 Port tst_QFormDataBuilder to new style [2/6]: escapesBackslashAndQuotesInFilenameAndName()
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 escapesBackslashAndQuotesInFilenameAndName(), too.

Requires to actually open dummy_file (so make it a QBuffer, because
there's no file of that name in the filesystem) and to revert the
needles from QString back to QByteArray.

Task-number: QTBUG-125985
Change-Id: I888b3cac45ed24b2e877dc1642a95e3f1d64f2ff
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit 14f68c9d44472966a66b5cf3b16f4fc7f60068ca)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 23:10:28 +00:00
Marc Mutz
7c9e8b1613 Port tst_QFormDataBuilder to new style [1/6]: generateQHttpPartWithDevice()
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 generateQHttpPartWithDevice(), too.

Requires to actually open data_file and to revert the needles from
QString back to QByteArray.

Task-number: QTBUG-125985
Change-Id: Ie4518fedb58530ae98b44f1ba9e000e6f088ba86
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit 4b21146ded83badfeb9f2c905f6602ff460adc63)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 23:10:22 +00:00
Marc Mutz
ac1e88f58a tst_QFormDataBuilder: DRY the moveSemantics() test
Packages everything needed to build the actual serialization into a
helper function that's parametrized with a function_ref. Said helper
provides the function_ref with a default-constructed QFormDataBuilder
as an argument to the function, but since we're checking move
semantics here, it also expects to receive, via the return type, the
builder object to eventually use for building. This need not be the
same as the one it originally supplied.

If this looks a bit complicated, it's a necessary evil for
conveniently rolling out this way of performing the test to the rest
of the test functions, to eventually, finally get rid of using QDebug
to introspect individual QHttpParts when, in reality, we're only
interested in the QHttpMultiPart's wire serialization (iow: the
observable behavior).

Centralize the QSKIP in the helper function. This increases compile
coverage of the rest of the code, but requires QTEST_THROW_ON_SKIP,
so add a check for that alongside the QTEST_THROW_ON_FAIL one.

Task-number: QTBUG-125985
Change-Id: Ib6217a02159c79f48f0036e90d7bbbf43e69d0ba
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit 9fcafa715ecb1c6e45fc51d599178bbde3cc1b12)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 23:10:15 +00:00
Marc Mutz
511e7fc9e8 tst_QFormDataBuilder: QVERIFY that QIODevice::open() succeeded
... so we don't have to guess around when the follow-up
checkBodyPartsAreEquivalent() fails.

Task-number: QTBUG-125985
Change-Id: I008eb7a1fa1c5457a5405838730d9e98b1cc20b4
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit 4da130838ba0a0f4f7c659f8c58f7bb4304b032c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 23:10:08 +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
9512f44b46 CMake: disable the GCC -Wstringop-overread warning-error everywhere
We were doing it only for MinGW, but it's now showing up everywhere.

Pick-to: 6.7
Change-Id: Ic0adfa808d28487a8303fffd17d9deab60f6cd0a
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit ae71a00c611ce07965d6a4e54e7a5aee3105da5e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 22:59:09 +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 dc2ae08e02730ab795445bc047221aa56914f723.

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 6343caae25179b5895b4169d7b97d61293e49b0f.

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
Łukasz Matysiak
5b5d6dfa49 Skip tst_QFuture::whenAllDifferentTypes and whenAnyDifferentTypes on VxWorks
The VxWorks implementation of std::variant is broken.
std::visit throws std::bad_variant_access when called on a variant with
duplicated types.

Skip the tests that are affected by it.

Pick-to: 6.7
Task-number: QTBUG-115777
Change-Id: I45227cc543ef7db2217b1d53313c2e2b140988d6
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 0e9c0c0847bd09c8a2b5166a2bafc103db0d3abc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 19:30:41 +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 a5953d20e27ab73774058dd06ac514f9310a41e8.

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
Oliver Wolff
679807b506 tst_qfuture::signalConnect: Fix failure condition for MSVC
The test failure seems to be related to code optimizations and not
to the c++ standard that is used. With a recent version of MSVC
(>=19.40) the test fails on both x64 as well as ARM64 if the build
configuration does code optimizations (aka we have a release
build).

Pick-to: 6.7
Fixes: QTBUG-126349
Change-Id: I01781ea5b20f80a6cbd7ccb284d30b5d078ad958
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit d8cb2044e3e86633c732f1f1b28926062b08b76c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 19:30:11 +00:00
Volker Hilsheimer
5c17246188 JNI: add test coverage to confirm assumptions about array validity
When the Java array that we hold a reference to is changed on the Java
side, then our reference continues to be valid, and references a
different object than the new array in Java.

Change-Id: If8743cc1b2fabb254b9c0009f41377455719ec3e
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 37bb00d8507a4def05b5d85a6ef4ea23cca70ab6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 19:30:08 +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
Alexandru Croitor
7e831c3b66 coin: CMake: Add instructions to generate JSON and verify the SBOM
If the VerifySBOM feature is enabled, pass additional options to
CMake configuration:
- runs syntactic verification of the SBOM
- so it converts the generated SBOM files into JSON files (and
  installs them). This does additional useful validations.
- runs the NTIA SBOM verifier
- shows some of the content in the SBOM in a more user-friendly table
  format via the sbom2doc python app
- runs sbomaudit to show things like packages without a license
  expression, doesn't exit with errors if issues are found.

To ensure the tables are wide enough in the log on the CI, we set
an explicit value for COLUMNS env var, which is used by sbom2doc
to determine the table size.

To ensure the sbom2doc and sbomaudit python applications are found,
we supply additional locations where they can be found, via the
env vars that coin python provisioning sets.

We also make sure to pass the found application paths when executing
the python apps, because they might not be in PATH by default.

Task-number: QTBUG-122899
Change-Id: I0baef8b9c949209b15ab304e1e840b4dcdf5a61c
Reviewed-by: Toni Saario <toni.saario@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 83ff34d1c626759224a95f39bca8337a8390ed52)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 19:29:55 +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
Marc Mutz
44a94e03dd tst_QSharedPointer: check QWeakPointer vs. virtual bases
This fell out of my tracking of a failure of the new QPointer
conversion feature, and it would be a waste to throw it away unused.

Pick-to: 6.7 6.5 6.2 5.15
Change-Id: Ie255b4a6432b4763071e5712d92e9ccd57927052
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit 0e40a3f6645a684458cbb09bef1353df2eec5e0b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 19:05:31 +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
Morten Sørvig
74f8f0102e wasm: remove DEMANGLE_SUPPORT
This linker option is now deprecated (and not needed,
since stack traces always contain demangled symbols).

Change-Id: If42c692c006b214fa3df418c09680aaa07ea2bbd
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
(cherry picked from commit a8b7da59cba56b535393f50cd7432a412021d8d2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 12:51:27 +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 8c18a245b0245de20c064cd53d03498088bd57df

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
Marc Mutz
ada5f8b646 tst_QSpan: port to QTEST_THROW_ON_FAIL
Dogfooding the new QtTest 6.8 feature, and greatly simplifiying the
source code.

Change-Id: I0731d7291048e6bbed19666d1b6672e5cccaf27a
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 157fcdf5afbe4e6b421713947ccdb4ee35116ee4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 01:55:26 +00:00
Marc Mutz
9a86dba130 tst_QRegularExpression: port to QTEST_THROW_ON_FAIL
Dogfooding the new QtTest 6.8 feature.

Change-Id: I530814c0858565b46f462d5c66038a37140c0617
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 7885d5cb220cee04f892ecdba46a1fc3dc65eeae)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-19 23:32:05 +00:00
Marc Mutz
7e021ab891 tst_QAbstractProxyModel: port to QTEST_THROW_ON_FAIL
Dogfooding the new QtTest 6.8 feature.

This not only helps with the sourceModelBinding() test with its manual
currentTestFailed() calls, but also the old verifySubSetOf() helper
function that's there from Qt 4 times.

Use Ye Olde Scope Guard Trick™ to replace the qDebug() messages
recording where failures occurred.

Change-Id: I4d1460bde5315dfcc3b261b6e09c7293bbd9ff89
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 32fc8b936d1d036ba5b70ec1cac7681e1c9359c8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-19 23:31:58 +00:00
Marc Mutz
a9ebd2d64e tst_QAnyStringView: port to QTEST_THROW_ON_FAIL
Dogfooding the new QtTest 6.8 feature.

Change-Id: Ied115f33990040b92f49b319c36d20f7510e6eac
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 757e3d77ac186988a3fe8bed9706c5792caa2666)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-19 23:31:51 +00:00
Marc Mutz
df055c0256 tst_QCborValue: port to QTEST_THROW_ON_FAIL
Dogfooding the new QtTest 6.8 feature.

Change-Id: I1415e6af94eab3bb47d3f8d319f84554faa52d45
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit c8e33fc4fd1151edb3df4815f5fbae03eb1ea353)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-19 23:31:45 +00:00
Marc Mutz
5ba8e27800 tst_QCborStreamWriter: port to QTEST_THROW_ON_FAIL
Dogfooding the new QtTest 6.8 feature.

Change-Id: Ie197dc94fb9dfebd5f730c7ca4ef5ce0ed07e9f3
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit eec0a30e5e0c64a8f373b59290b8e6c0bc88c17c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-19 23:31:29 +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
Toni Saario
9e5759cd2a Coin: Add a way to disable test upload
The use case is where blocking test building is wanted but they cannot
be uploaded due to being static or they would simply be unused.

Pick-to: 6.7
Change-Id: I32ad20fea2ec032fb1f1a9b86025b34f192e0ed2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 6a0c94b62d948d3da0da241cf1e6c15188069169)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-19 13:14:45 +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
Alexandru Croitor
aea52288d6 CMake: Improve license handling for SBOMs
Add a NO_ATTRIBUTION_LICENSE_ID option to allow to skip including
license references from qt_attribution.json files.

Add a QT_LICENSE_ID option that can take an "id" value and return one
of the common license expressions we use throughout Qt repositories:
- GPL3 with exception for tools / apps
- GFDL for documentation
- GPL3 only modules
etc.

Add a QT_SBOM_DEFAULT_QT_LICENSE_ID_LIBRARIES variable that can be set
at directory scope (or root repo scope) to use a specific license id
for all qt modules / plugins created within that repo, e.g. the
Commercial + GPL3 variant. These can be opted out, to fallback to the
"default" license by passing NO_DEFAULT_QT_LICENSE_ID_LIBRARIES.

Add a similar variable  QT_SBOM_DEFAULT_QT_LICENSE_ID_EXECUTABLES
for tools / apps, including a NO_DEFAULT_QT_LICENSE_ID_EXECUTABLES
option.

Modify the logic for setting licenses for qt targets:
- use whatever is set in QT_SBOM_DEFAULT_QT_LICENSE_EXECUTABLES
  for tools and apps
- or use the 'GPL3 with exception' variant for tools and apps
- use whatever is set in QT_SBOM_DEFAULT_QT_LICENSE_LIBARRIES for
  modules ands plugins
- or use the default Commercial + LGPL3 + GPL variant for
  modules and plugins

Amends 37a5e001277db9e1392a242171ab2b88cb6c3049

Task-number: QTBUG-122899
Change-Id: I3a8abac62b9f4b342f91ef139064884f02aa935e
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit fe90ba704168d47cf88d0c6512380b525f38f5d3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-19 08:15:40 +00:00
Alexandru Croitor
9be3d7a7a0 CMake: Allow specifying most SBOM options to qt_internal_add_foo
Previously, only a very short subset of options related to attribution
files could be specified to qt_internal_add_module /
qt_internal_extend_target.

It is more convenient to allow specifying most (safe) options, instead
of calling another function.

Unsafe are considered paths like INSTALL_PATH and derivatives, TYPE
which is too generic, and some other ones like LIBRARIES which would
be duplicated, and causes warnings in cmake_parse_arguments if
duplicated.

Change the code to allow specifying most SBOM options and forwarding
them to _qt_internal_extend_sbom.

Task-number: QTBUG-122899
Change-Id: I6eb723e165edf59973d83c66eace43acdce237de
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 81162cc8b6931c8659dc722be97eb788e344812a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-19 08:15:39 +00:00
Alexandru Croitor
ba08a2fb17 CMake: Fix assigning per-directory variable license in SBOM
The value should be taken from the QT_SBOM_LICENSE_EXPRESSION
variable. The '_qt_internal_sbom_get_default_qt_license_id' was a copy
paste error.

Amends 37a5e001277db9e1392a242171ab2b88cb6c3049

Task-number: QTBUG-122899
Change-Id: I4bcfaaf06af8903af7081130ba3c8285a53d8f4f
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 8f04225c5af2a5cb31d2452342b4ec35a10bf77b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-19 08:15:39 +00:00
Alexandru Croitor
9c04794cd8 CMake: Fix _qt_internal_forward_function_args to evaluate its args
We were comparing the variable name of single and multi arg options,
rather than the value.

This accidentally worked when the variables were set, but forwarding
empty values if the variables were not set.

Explicitly evaluate the variable values to compare them against the
empty string.

Amends 96abceb64e5dc0570ca7c3419f401cfafe946ba0

Change-Id: I1a701c681f5af5e665601972687024ce734aa014
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 6f475a05a1a035b07ed66f93aa92d0e8b2396047)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-19 08:15:39 +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 3e6b42ae9dbf4f90ba890d78a4c49f9936f4976b

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 a6a56814702612d8981f594a6158d70a7928cb99 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 010952a55ee9ca9731f8ad15f2773d0bae645840 and
9ec1de2528b871099d416d15592fcc5ef9242a64 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
0a57b0e542 Refactor test cases in tst_qformdatabuilder
Hide the construction details of QFormDataPartBuilder, change
the verification to be QString based instead of QByteArray based,
and use raw string literals (where useful) for readability.

Task-number: QTBUG-114647
Change-Id: I16fb6c943cf6fd7385e78bbffe3b2780ab0a6ac8
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit cb8abb718da4e18232de525ef1bb611f3a5dd929)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-18 17:08:21 +00:00
Tor Arne Vestbø
b14c1c1824 tst_QPlugin: Be specific when looking for plugins
The pattern "*debug*" also matches libinvalidplugin_debug.dylib
on macOS. As the CMake target for the plugins include the 'plugin'
part, let's look for that as well when finding matching plugins.

Change-Id: Icf3177d42c104829890a8c404a6b9782bf190bb4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 087ace615a6399f6bf7a020bce07365689bd4784)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-18 09:28:46 +00:00
Marc Mutz
34ac282a1e tst_QProcess: silence -Wunused-result
We can't do anything about a failed write at these code locations. In
particular, we can't QVERIFY() their success, so suppress the warning
with the idiomatic cast to void.

Amends 13a1995e9dc987d1560b38d16b76442261b4aa8d,
bd32c7d7055b436b8c33486a5b5ce1c29db77fd4 and
c5221f6be00c16187e0abf008b33c230fea56c29.

Pick-to: 6.7
Change-Id: Ia7ef57f01eeb8608079a12724c0b4f03a59081c9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 97f31a68795e1d492f98a9942cce5228cbe64cf8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-18 08:09:23 +00:00
Marc Mutz
beabc63598 tst_QGlobal: fix -Wmaybe-uninitialized
GCC 14 doesn't understand that neither q_check_ptr() nor
qCompare<int*> dereference the pointer.

Since the missing initialization isn't part of the test (except,
maybe, to provoke this warning if the implementation indeed changed to
dereference the pointer), fix by initializing the int, like we do for
the string a few lines below.

Amends the start of the public history.

Pick-to: 6.7 6.5 6.2 5.15
Change-Id: I6033e026f041b03821b776daa8e65586b8054136
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 8e914e07fbac8b40e51d0e6da764fa13a6af8181)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-18 08:09:17 +00:00
Marc Mutz
2ec36e7ebe tst_QEventDispatcher: port to QTEST_THROW_ON_FAIL
Dogfooding the new QtTest 6.8 feature.

Change-Id: I4ded1fabac25fb283eb26b5eef341892b4459e96
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 7a93e815d2489b97510a1ab7aaf6a140e2e2c587)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-18 08:09:13 +00:00
Marc Mutz
161996d1da tst_QDir: fix -Wunused-result
We've been ignoring the result of symlink(2) and GCC 14 complained.

Fix by QCOMPARE()ing to 0, ie. verifying sucesss.

Amends 23d08ce2edab09562ad283dac5d46c09efec63ca.

Pick-to: 6.7 6.5 6.2 5.15
Change-Id: If58267e3883c77cd62aa72a42410c837b32d9c0b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit c880a3867a85c0efdc6773ad6b446a318198585a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-18 08:09:11 +00:00
Marc Mutz
f3007e8624 tst_moc: fix 'inline function used but never defined' GCC warning
GCC doesn't have a specific warning flag for this warning, so we can't
add a GCC case to the existing Clang suppression in the header.

Hovever, the issue can be fixed by including the moc file into
tst_moc.cpp, so that the compiler sees the definition of the inline
signal provided by the said moc file. This means we can also drop the
Clang warning suppressions.

To prevent duplicate definition linker errors, remove the header file
from JSON_FILES, and the forced separate compilation that entails.

I'm pretty sure that some cmake magic could preserve the JSON test
coverage, but a) the file doesn't emit anything special in its json
(certainly nothing about the inline'ness of the signals) and b) the
presence of mySlot() and mySignal() as slot and signal on these
classes is already tested by singleFunctionKeywordSignalAndSlot().

Amends the start of the public history, but not picking back far,
because a) a prequel commit to this commit wasn't picked further,
either, and b) this has been such a long-standing issue that it's
clear no-one cares and so it's just not worth the risk, however small
that may be, to backport.

On GCC, the only remaining warnings thrown by tst_moc are now
moc-generated ones.

Task-number: QTBUG-119042
Change-Id: Icde1eee6c97bd48d72e15461b6ec80c50c044eaa
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit b1b3af02c0fb8084d2eb984b1f7ae68f1861f9a4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-18 08:09:09 +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
Tor Arne Vestbø
f399eff35e tst_qt_cmake_create: Skip test if CMake is not found
Change-Id: Ifd84135c756d5140bea1952e069f82854afe1ecd
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 4cb492e14a31b6497b81bfbbcbec09f94595698a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-18 01:34:51 +00:00
Michał Łoś
4afbfa8626 Exclude VxWorks from test for leaking objects
tst_QCoreApplication test fails due to leaking object. Investigation
about the reason of this issues was started, but no conclusion was made
and reason for object leak is still unknown. To prevent this test from
crashing exclude this check for VxWorks as well.

Pick-to: 6.7
Task-number: QTBUG-115777
Change-Id: I2c543a3b8320e2d96b2e7cd7e14c1980e500ce0d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 92e420aefb373c2dc1dd39a05ff43037edb2a145)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-18 01:34:51 +00:00
Marc Mutz
f7f19961c4 tst_QCompareHelpers: port to QTEST_THROW_ON_FAIL
Dogfooding the new QtTest 6.8 feature.

Removes a lot of manual currentTestFailed() calls.

Change-Id: Id8bb0bad9b90b0a51315e9a9677d7009ebc090e4
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 561a1cae9df85a7a03f73ce77948ef235fff7c5d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-17 23:17:50 +00:00
Marc Mutz
6f3d68e590 tst_QCborStreamReader: port to QTEST_THROW_ON_FAIL
Dogfooding the new QtTest 6.8 feature.

Change-Id: I381af59b005433453fe8dbd982fe44ab93b9417d
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit f8cef74aeee5eb6852a32a69a36fea8dc945f2b1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-17 23:17:50 +00:00
Marc Mutz
2b8cf058f1 Fix misspelled QTEST_THROW_ON_FAILURE
Amends e769cf026e328ed7fff660c204ce6e55b80114e3.

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
9d89e28f1c tst_moc: fix -Wvolatile
Suppress the warning. Found that moc doesn't like QT_WARNING macros in
Q_SIGNALS section and filed QTBUG-126395 to track the issue.

Amends the start of the public history, but not picking back far,
since older GCC could reject the suppression, and it's such a
long-standing issue that fixing it in LTS branches is not worth the
risk of breaking compilation.

Task-number: QTBUG-119042
Task-number: QTBUG-126395
Change-Id: I15ba9ed3b83cce0f4c2a1536317e5167d56f3a57
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 4111059b2ee3818ab68033198fb1dd057e6d09eb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-17 23:17:49 +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 ef964c254c7a72bc05b1f4f0c6f270f9ad21fecd.

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
Marc Mutz
8bc09e9db3 tst_QNetworkReply: port _WITH_TIMEOUT calls to chrono literals
Dogfooding the new 6.8 feature.

Change-Id: Ic4c371896fcab0c94cef76341a6ef97763127968
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 34089abeeac14a6437851530aa25f8b31a22acf1)
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 54c373faa4f9582fd09a802727821fd544a7b2c5 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
Tor Arne Vestbø
eb397a2ce9 Skip some build system tests if Xcode is not installed
We rely on a valid Xcode (command line tools) installation to run qmake.

Change-Id: I8d6746942507680dd585a41f32cbe4e4d34822e4
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 06b33134b38ffabdf0c0d80c2c3b9581294ff715)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-16 20:48:34 +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 05b84673045a5f4432a6caa9bea08d8fba1e1a03

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 6c72080f26e9b70041434c6d762f7d601a2bf19c.

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
Łukasz Matysiak
45d87f7bab Skip tst_QNetworkReply::contentEncodingBigPayload on 32b arch
The test requires allocating 4GB of memory to handle a big file.
On a 32b architecture, this leads to a std::bad_alloc exception and
abort in result (tested on VxWorks 24.03 on an imx6 board).
Because of that, the test can't work properly and it can't be
blacklisted.

Work around the issue by skipping the test.

Pick-to: 6.7
Task-number: QTBUG-115777
Change-Id: I46002a27aed09706cd61d2e2c8d4bd1e12a16c36
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 4d2744e4345193cdf7ec2bbf06b0a0d169827d8b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-14 14:59:03 +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
1603373bc0 AssetDownloader: Add manual test
Task-number: QTBUG-122550
Fixes: QTBUG-126020
Change-Id: Ide7c68ca46d7edd39d966f53e892bcd8b3fa88f4
Reviewed-by: Ali Kianian <ali.kianian@qt.io>
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit d0a58028daf0a33e27c1a5cfe5b8422bc6b0bc98)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-14 13:44:17 +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
Alexandru Croitor
fc3ac85db9 coin: Add instructions for generating an SBOM when installing Qt
The instructions will only run if a coin platform config has the
'GenerateSBOM' feature.

The -sbom configure option is not sticky across repos,
similar to -headersclean, so that if a user wants to build another
qt repo against a prebuilt qt, it won't try to generate the sbom
automatically.
That's why we append -sbom to all the repos configure args, and not
just the qtbase one.

Task-number: QTBUG-122899
Change-Id: Ice91cbc430826838119ce3085cbd52c0909f2746
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit d940399b3e6e9403f94190ffc71a5f5db68f51f3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-14 11:02:59 +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
Liang Qi
f9d33433f3 tests: skip most functions in tst_qx11info on offscreen
Task-number: QTBUG-125446
Change-Id: I6749357df8ac9cd8798fafe2cb5df4f5d40d1633
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 7407161212c56378529427adfe95627677a95cf9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-14 11:02:50 +00:00
Marc Mutz
dc385b5c0f tst_QUuid: add basic comparison tests
This is far from complete, as per path coverage, but it should at
least have 100% statement coverage now.

Pick-to: 6.7
Change-Id: If2a9a3d61695cca253a4e12c33a505b5afe50aa4
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 171ff57be1b8fd1c1b33cffbffa389790f239b5c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-14 08:41: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
Marc Mutz
d519743926 configure: accept -c++std c++17 again
When 2cf66d49ef926ee53b6c394d8be0b8e8bcf148e8 removed support for
c++14, it incorrectly also removed support for explicitly setting the
default, C++17. This broke build scripts for no good reason, and made
it impossible to undo an earlier -c++std c++20 again.

Accept C++17 and C++1z again, as an explicit disabler for C++20 and
C++23 features.

Amends 2cf66d49ef926ee53b6c394d8be0b8e8bcf148e8.

Fixes: QTBUG-125015
Change-Id: I99b80cd5f41fa5a23259630eae85ef807982f526
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 68e6406623afe5aaaa79e116cbd6b07e8f295e8b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-13 20:40:06 +00:00
Liang Qi
217d2839be tests: skip tst_QSharedMemory::useTooMuchMemory() on Linux arm64
This amends d8cd56df6b3bde89a59cd25db359a0bbea9449d2 .

Task-number: QTBUG-119321
Task-number: QTBUG-126225
Change-Id: Ie252367bde453f1892f5791aa0b20398106b592e
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 1943183282defdbc846813e4ceb66c1eec28fec5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-13 20:35:08 +00:00
Viktor Arvidsson
3d28089f9a QWindowsMime: Fix loading of CF_DIB (non-v5) followup
5b7422f74d73822aeab76163811ea1fcaafabc12 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 eb4cb719257d3b57cd801273d4011579d8c81714

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
Mate Barany
885a49548d Add some missing tests for QFormDataBuilder
Test the setHeaders method and the option of manually setting the mime
type.

Task-number: QTBUG-114647
Change-Id: I86644b243830259156e60239adf370e5894450dc
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit 132498a69a626be6feaf1855cf63dd79d1ac9445)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-13 20:34:42 +00:00
Alexandru Croitor
65bf57ce7c CMake: Generate an SPDX v2.3 SBOM file for each built repository
This change adds a new -sbom configure option to allow generating and
installing an SPDX v2.3 SBOM file when building a qt repo.

The -sbom-dir option can be used to configure the location where
each repo sbom file will be installed.

By default it is installed into

 $prefix/$archdatadir/sbom/$sbom_lower_project_name.sdpx

which is basically ~/Qt/sbom/qtbase-6.8.0.spdx

The file is installed as part of the default installation rules, but
it can also be installed manually using the "sbom" installation
component, or "sbom_$lower_project_name" in a top-level build. For
example: cmake install . --component sbom_qtbase

CMake 3.19+ is needed to read the qt_attribution.json files for
copyrights, license info, etc. When using an older cmake version,
configuration will error out. It is possible to opt into using an
older cmake version, but the generated sbom will lack all the
attribution file information.
Using an older cmake version is untested and not officially supported.

Implementation notes.

The bulk of the implementation is split into 4 new files:

- QtPublicSbomHelpers.cmake - for Qt-specific collecting, processing
  and dispatching the generation of various pieces of the SBOM document
  e.g. a SDPX package associated with a target like Core, a SDPX
  file entry for each target binary file (per-config shared library,
  archive, executable, etc)

- QtPublicSbomGenerationHelpers.cmake - for non-Qt specific
  implementation of SPDX generation. This also has some code that was
  taken from the cmake-sbom 3rd party project, so it is dual licensed
  under the usual Qt build system BSD license, as well as the MIT
  license of the 3rd party project

- QtPublicGitHelpers.cmake - for git related features, mainly to embed
  queried hashes or tags into version strings, is dual-licensed for
  the same reasons as QtPublicSbomGenerationHelpers.cmake

- QtSbomHelpers.cmake - Qt-specific functions that just forward
  arguments to the public functions. These are meant to be used in our
  Qt CMakeLists.txt instead of the public _qt_internal_add_sbom ones
  for naming consistency. These function would mostly be used to
  annotate 3rd party libraries with sbom info and to add sbom info
  for unusual target setups (like the Bootstrap library), because most
  of the handling is already done automatically via
  qt_internal_add_module/plugin/etc.

The files are put into Public cmake files, with the future hope of
making this available to user projects in some capacity.

The distinction of Qt-specific and non-Qt specific code might blur a
bit, and thus the separation across files might not always be
consistent, but it was best effort.

The main purpose of the code is to collect various information about
targets and their relationships and generate equivalent SPDX info.

Collection is currently done for the following targets: Qt modules,
plugins, apps, tools, system libraries, bundled 3rd party libraries
and partial 3rd party sources compiled directly as part of Qt targets.

Each target has an equivalent SPDX package generated with information
like version, license, copyright, CPE (common vulnerability
identifier), files that belong to the package, and relationships on
other SPDX packages (associated cmake targets), mostly gathered from
direct linking dependencies.

Each package might also contain files, e.g. libQt6Core.so for the Core
target. Each file also has info like license id, copyrights, but also
the list of source files that were used to generate the file and a
sha1 checksum.

SPDX documents can also refer to packages in other SPDX documents, and
those are referred to via external document references. This is the
case when building qtdeclarative and we refer to Core.

For qt provided targets, we have complete information regarding
licenses, and copyrights.

For bundled 3rd party libraries, we should also have most information,
which is usually parsed from the
src/3rdparty/libfoo/qt_attribution.json files.
If there are multiple attribution files, or if the files have multiple
entries, we create a separate SBOM package for each of those entries,
because each might have a separate copyright or version, and an sbom
package can have only one version (although many copyrights).

For system libraries we usually lack the information because we don't
have attribution files for Find scripts. So the info needs to be
manually annotated via arguments to the sbom function calls, or the
FindFoo.cmake scripts expose that information in some form and we
can query it.

There are also corner cases like 3rdparty sources being directly
included in a Qt library, like the m4dc files for Gui, or PCRE2 for
Bootstrap.
Or QtWebEngine libraries (either Qt bundled or Chromium bundled or
system libraries) which get linked in by GN instead of CMake, so there
are no direct targets for them.
The information for these need to be annotated manually as well.

There is also a distinction to be made for static Qt builds (or any
static Qt library in a shared build), where the system libraries found
during the Qt build might not be the same that are linked into the
final user application or library.

The actual generation of the SBOM is done by file(GENERATE)-ing one
.cmake file for each target, file, external ref, etc, which will be
included in a top-level cmake script.

The top-level cmake script will run through each included file, to
append to a "staging" spdx file, which will then be used in a
configure_file() call to replace some final
variables, like embedding a file checksum.

There are install rules to generate a complete SBOM during
installation, and an optional 'sbom' custom target that allows
building an incomplete SBOM during the build step.

The build target is just for convenience and faster development
iteration time. It is incomplete because it is missing the installed
file SHA1 checksums and the document verification code (the sha1 of
all sha1s). We can't compute those during the build before the files
are actually installed.

A complete SBOM can only be achieved at installation time. The install
script will include all the generated helper files, but also set some
additional variables to ensure checksumming happens, and also handle
multi-config installation, among other small things.

For multi-config builds, CMake doesn't offer a way to run code after
all configs are installed, because they might not always be installed,
someone might choose to install just Release.
To handle that, we rely on ninja installing each config sequentially
(because ninja places the install rules into the 'console' pool which
runs one task at a time).
For each installed config we create a config-specific marker file.
Once all marker files are present, whichever config ends up being
installed as the last one, we run the sbom generation once, and then
delete all marker files.

There are a few internal variables that can be set during
configuration to enable various checks (and other features) on the
generated spdx files:

- QT_INTERNAL_SBOM_VERIFY
- QT_INTERNAL_SBOM_AUDIT
- QT_INTERNAL_SBOM_AUDIT_NO_ERROR
- QT_INTERNAL_SBOM_GENERATE_JSON
- QT_INTERNAL_SBOM_SHOW_TABLE
- QT_INTERNAL_SBOM_DEFAULT_CHECKS

These use 3rd party python tools, so they are not enabled by default.
If enabled, they run at installation time after the sbom is installed.
We will hopefully enable them in CI.

Overall, the code is still a bit messy in a few places, due to time
constraints, but can be improved later.

Some possible TODOs for the future:
- Do we need to handle 3rd party libs linked into a Qt static library
  in a Qt shared build, where the Qt static lib is not installed, but
  linked into a Qt shared library, somehow specially?
  We can record a package for it, but we can't
  create a spdx file record for it (and associated source
  relationships) because we don't install the file, and spdx requires
  the file to be installed and checksummed. Perhaps we can consider
  adding some free-form text snippet to the package itself?

- Do we want to add parsing of .cpp source files for Copyrights, to
  embed them into the packages? This will likely slow down
  configuration quite a bit.

- Currently sbom info attached to WrapFoo packages in one repo is
  not exported / available in other repos. E.g. If we annotate
  WrapZLIB in qtbase with CPE_VENDOR zlib, this info will not be
  available when looking up WrapZLIB in qtimageformats.
  This is because they are IMPORTED libraries, and are not
  exported. We might want to record this info in the future.

[ChangeLog][Build System] A new -sbom configure option can be used
to generate and install a SPDX SBOM (Software Bill of Materials) file
for each built Qt repository.

Task-number: QTBUG-122899
Change-Id: I9c730a6bbc47e02ce1836fccf00a14ec8eb1a5f4
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 37a5e001277db9e1392a242171ab2b88cb6c3049)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-13 14:55:07 +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 fff6562f8c074d75bda8b80f844dc63c6f2e64d5.

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
Alexandru Croitor
19c4c8e12d CMake: Assign FindWrapFoo_VERSION variable in QtFindWrapHelper.cmake
The QtFindWrapHelper.cmake file retrieves the version of the
underlying system package version or bundled package version, and
passes that to find_package_handle_standard_args to show which version
was found.
But it did not set a ${PACKAGE_NAME}_VERSION variable, which means
we didn't record the version in qt_find_package, and thus in the final
SBOM.

Make sure we set the variable.

Amends 7ad8c347feb5e336c3833d6d3ac021a0a14b714a

Change-Id: Ia0d5b895de36017949e6607d17093459dca302b3
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 0be79f14865c0a19fde0abad7d1722f0bac3b7c2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-13 14:55:01 +00:00
Alexey Edelev
a70a587f61 Fix the arg_HEADER_MODULE condition
Use the variable name but not the unwrapped value.

Pick-to: 6.7 6.5
Change-Id: Ie392a4875fe412b8eb273a457a83cd08cd9f5e15
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit e960fb136e77437e158367f86bc926504e0fdab6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-13 14:39:20 +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
Joerg Bornemann
5280f307a8 CMake: Yield error if a feature is ENABLEd and CONDITION is false
Consider a feature that has ENABLE and CONDITION expressions. For
example, system-libb2 on a Linux machine that does not have the
libb2-dev package installed:

qt_feature("system-libb2" PRIVATE
    LABEL "Using system libb2"
    CONDITION Libb2_FOUND
    ENABLE INPUT_libb2 STREQUAL 'system'
    DISABLE INPUT_libb2 STREQUAL 'no' OR INPUT_libb2 STREQUAL 'qt'
)

If the feature is enabled by the user by setting
FEATURE_system_libb2=ON, then there's an error:
    Feature "system_libb2": Forcing to "ON" breaks its condition...

This is expected.

If the feature is enabled by the user by triggering the ENABLE condition
via the -system-libb2 configure flag (that sets INPUT_libb2 to
"system"), we did not get an error message.

This was unexpected and inconsistent.

Now, we consider features that are enabled via their ENABLE condition as
set by the user and yield an error if the CONDITION doesn't match.

Fixes: QTBUG-126144
Change-Id: I249baf9ab4f434f5a96894f4ec055f70859ffca9
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit ad227368c3ab3a9dc68208bce2d075edefe7e6e0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-12 15:53:35 +00:00
Łukasz Matysiak
fff5c065bc Use /tmp in tst_qcompleter on VxWorks
The test checks if paths in /etc and /home are properly completed.
/etc and /home do not exist on VxWorks.
Use /tmp instead.

Pick-to: 6.7
Task-number: QTBUG-115777
Change-Id: I6203fabb003a9a81eb4cdb666a972f47a53f06d6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 843f8fb043a0812ab01f0a378be1a821f2e1534d)
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 7a374c38d288435b3c0a76b82a1c2ca53ea9c003 and
a3d50112e44bc42b310d9d3a8e6c7805ef31ef53.

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
Joerg Bornemann
3e320e45bf CMake: Build dbus tools when building dbus tests
This adds the build dependencies
tst_qdbuscpp2xml -> qdbuscpp2xml
tst_qdbusxml2cpp -> qdbusxml2cpp

Fixes: QTBUG-126115
Change-Id: I8a52568023743924fac67ce88ea446189b0328c0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 0f71a00357234b3cbd30b3d010ae8b10c5a25fec)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-12 12:23:45 +00:00
Marc Mutz
9eb670d8d7 tst_QStringBuilder: add more checks
- for const char[] with embedded NULs
  - incl consistency between QString and QByteArray targets
    (inconsistent, filed as QTBUG-117321)

- with QByteArrayView as LHS

Task-number: QTBUG-117321
Pick-to: 6.7 6.5 6.2
Change-Id: Ieef9a4cf917f737da53112f89a1d95c97ebade06
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 57a65735f25774d39214e2199916e9801ac69dd6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-12 12:23:43 +00:00
Marc Mutz
23013db675 QStringEn/Decoder: port (name, Flags) ctors to QAnyStringView
This reverts commit f8359084b948fd8f6027d23a869f1a0d50cc30c1.

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

Found in API-review.

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

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

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

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

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

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

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

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

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

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

Change-Id: I3000ea606b37714542916e105ebd50871dc42935
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 0ed039fd134fb8025236847295681f13f1775847)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-11 23:18:44 +00:00
Volker Hilsheimer
a53473052b Widget gallery example: set color scheme before constructing UI
On macOS, we see unexplained white flashes of the UI when
overriding the scheme in the widget's constructor. This only
happens when running the bundle, but not when running the
executable.

Work around that problem by setting the scheme immediately
after constructing QApplication.

Task-number: QTBUG-126248
Change-Id: I4a5fe467d628fca5e52e1e36f43af8143239c7fa
Reviewed-by: Doris Verria <doris.verria@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 88322f69a20fddedd9c45a1bb25f6c1d2dcf31f9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-11 19:35:30 +00:00
Volker Hilsheimer
ea8277dbf3 macOS: use QStyleHint to get color scheme in the style
That way, an override through QStyleHints::setColorScheme is
immediately respected by the style.

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

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

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

This removes the last usage of Q_DECLARE_JNI_TYPE in qtbase.

Change-Id: If872684c8b52bc7789e248cfc3046817c411903c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 909493bae27eeb55c985aa9522a57bc4e60d0893)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-11 19:35:30 +00:00
Jan Arve Sæther
77dd4bb142 Move AA_QtQuickUseDefaultSizePolicy out of Tech Preview
Change-Id: Ibdd23455c266af6748aca9de859ea21caac50634
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
(cherry picked from commit 8b0f56e99838f974a675ce557b8a5646519fd780)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-11 19:35:30 +00:00
Alexandru Croitor
e83de10922 CMake: Fix forwarding the '0' argument which is by default falsey
If the forward argument was meant to be 0, it was not forwarded
because it evaluated to false in if(condition).

To pass it along, instead check for empty strings.

Change-Id: Ia366df147de0c2d333017da43dc0643b56a89e9c
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 96abceb64e5dc0570ca7c3419f401cfafe946ba0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-11 19:35:30 +00:00
Shawn Rutledge
b1481a1663 Fix MouseButtonDblClick synthesis from touch double-tap
When QGuiApplicationPrivate::processTouchEvent() sees that the
touch event was not handled, and calls processMouseEvent(), the latter
uses the QEventPoint with pointId 0 regardless of the original
touchpoint ID. Now it updates the persistent QEventPoint from the
original touchpoint so that a double-click event will not be ruled out
because of the timestamp delta or position delta (movement since press)
being too large.

Fixes: QTBUG-125993
Pick-to: 6.7 6.5
Change-Id: I8e9b007818107ac2329454e0ccfb2ac9e506b617
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 2a0b907f11b9c0ad46322ba06482861423246d93)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-11 16:36:38 +00:00
Tor Arne Vestbø
c410163173 Report 2.x scale factor for UIView on visionOS
The docs claim that this is the default, but in practice it's not
the case.

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

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

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

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

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

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

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

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

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

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

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

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

Amends the start of the public history.

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

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

Amends the start of the public history.

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

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

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

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

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

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

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

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

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

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

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

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

Found in API review.

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

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

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

Amends 19258608e9ea02043ce9b53d4a9c99700ce49c1b.

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

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

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

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

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

works.

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

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

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

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

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

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

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

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

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

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

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

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

Amends c46ee7df57c30c94107df8506d30d8872ffa3baa.

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

Amends b347d487048cf36d609dd31952dbef1813b5b0e5.

Found in API review.

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

Found in API Review.

Amends dfe968e9702c740b3522715fa9f0e9a281c92885.

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

Found in API-review.

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

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

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

Amends 5ea4e27661e1805a6ed01c7a61643f9a50c15d62.

Found in API Review.

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

This code predates the public history.

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

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

Found in API Review.

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

This patch fixes it.

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

Found in API Review.

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

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

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

Found in API Review.

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

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

Found in API Review.

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

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

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

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

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

Amends f9035587b98ac5dc9491e642b8ec84470ec03f0e.

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

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

Task-number: QTBUG-118077
Change-Id: I5b9c7073801f0b1305237184bb2ab91678e1b1b1
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
(cherry picked from commit 6b105c54eee069f6ddeeac41d9f93ad533f24586)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-07 06:59:19 +00:00
Marc Mutz
1a833d82f4 [docs] Document QDBusObjectPath QDebug stream operator
Amends c89b1bbddc73b044762cabc67c1e5063a6ffee86.

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

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

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

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

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

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

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

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

Found in API-review.

Amends c89b1bbddc73b044762cabc67c1e5063a6ffee86.

Change-Id: I5163952e43abc1185b8f8f5c5fde2b4839e78e0d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Kai Uwe Broulik <kde@privat.broulik.de>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 9387ea21cd4ab26dc6a5cdc5d6a732be1fe8e429)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-07 06:59:18 +00:00
Marc Mutz
9a95c4ba4b tst_QString: extend unary arg() checks even further
Found more issues:

- quint8 and qint8 (signed and unsigned char) actually match an
  integral overload (probably int/uint), and _not_ (char),

- char8_t (only in C++20 builds) and (at least on non-Windows) wchar_t
  are incorrectly treated as numeric types,

- qfloat16 breaks if QFLOAT16_IS_NATIVE.

Created a few tasks to track these.

Task-number: QTBUG-126053
Task-number: QTBUG-126054
Task-number: QTBUG-126055
Pick-to: 6.7 6.5 6.2
Change-Id: Iaf64929e3fae257d5dd283f555bb71ea2908cc94
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 967736b96ba06bfdfdf553b2c3720d7adc4a921c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-07 06:59:18 +00:00
Paul Wicking
7c09687275 Doc: Document QApplicationStatic convenience header
Task-number: QTBUG-125097
Change-Id: Ib71dfe7696fb50759e43b0c8dee70860f1837d9b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 197a1f1a7716c9ddbdf9c458686bafa740f726cd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-07 06:59:18 +00:00
Volker Hilsheimer
dfdba712c8 Doc: fix warning from typo in type name
Amends 4d6721781806e4ce172f836d4b58df68acc4e4b0. qdoc using
LLVM 18.1.6 doesn't generate a warning for this, but the one
in CI does (but the warning limit is currently inactive).

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

Change-Id: Iebc611342ffe5baafb8469205e14afc41b55be5f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 1b3ae003e657074a9b3cc5a8e5212a40cf02c0fd)
Reviewed-by: Nodir Temirkhodjaev <nodir.temir@gmail.com>
2024-06-06 10:37:23 +00:00
Alexandru Croitor
92ffa3a7a5 CMake: Fix framework headers not being copied after rm-ing build dir
If a build dir is removed using rm -r *, this still leaves
dot files around, specifically the .ninja_log file.

Because of a possibly unspecified behavior of listing directories as
OUTPUTs in a add_custom_command call for the
${target}_copy_fw_sync_headers custom target, we end up with a
situation where the custom command is not rerun by ninja because the
directory OUTPUT was encountered in the .ninja_log file.

Make sure to specify an additional file as an OUTPUT, to ensure the
command does rerun, and thus copies all headers from the syncqt
staging directory.

Amends 103eca1070a75bfa97d0b72b94e0c759ef0bcd1c

Pick-to: 6.7 6.5
Fixes: QTBUG-126056
Change-Id: I5664cf074158199e0c7fd5e312ecf739133d7f2e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit c561bcceed0300a14e2062958afce62776be4b6f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-06 10:37:23 +00:00
Tor Arne Vestbø
3964d03f31 Return button index for deprecated QMessageBox APIs
The static QMessageBox APIs taking button texts instead of standard
buttons promises that the return value is 0, 1, or 2. After the change
in b30121041c07b1b8613eaf624c9aa55a51001aef the return value of exec
for custom buttons was changed (as the documentation says its an opaque
value), which unfortunately affected the deprecated functions.

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

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

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

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

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

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

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

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

Reverts 953f70179969b0beb797607c5454e36349319929

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

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

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

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

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

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

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

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

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

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

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

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

Found in API-Review.

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

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

This amends 373ae6cbd24cf0ddbed453e14b1f683e76c92bb5

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

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

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

Amends c39a0d1e8956e042139ce3065681e4c5d07412f3.

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

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

This amends f2dba1919427bcc0f510d7f60e3fafbd6f41430d and
993f31801446c1d851c7c8d54c9b55216acd0993

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

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

Task-number: QTBUG-114647
Change-Id: Ie85cdcf40bd4333d06ead3f5b8dfabd799d2a9ab
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 8e4f1d9636bd9baf807b42e7c89453109e420b9c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-05 04:17:25 +00:00
Volker Hilsheimer
dfab25e18b PaintDeviceMetric: add missing trailing comma
Task-number: QTBUG-125859
Change-Id: Ic02cf9d021649a20b92a8fbb148c80c5913651d4
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 8218f79c40e73cf69aaed248d2802ddbd3ab9629)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-05 04:17:17 +00:00
Volker Hilsheimer
f74f66d59f QPageLayout::OutOfBoundsPolicy: add missing trailing comma
Task-number: QTBUG-125859
Change-Id: I7834a5bd0884ab23f83813a87e9c51ab34c10797
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 68ee140d17233ae17d9728dc5967ddf125c21018)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-05 04:17:09 +00:00
Shawn Rutledge
4c686817ec systray example: if there is no system tray, allow waiting for one
Demonstrate that QSystemTrayIcon can wait for a tray to become
available. For example QDBusTrayIcon::init() connects to
QDBusServiceWatcher::serviceRegistered to detect the StatusNotifier
service becoming available. So instead of unconditionally quitting
if there is no tray, allow the user to choose to "Ignore" its absence,
or "Close" the application. Realistically, applications in which a tray
icon is an optional feature should not quit just because there's no
tray.

Task-number: QTBUG-94871
Change-Id: Ia8efd95fcfb9ff7c915ee8e259e9a0903fa7bcb3
Pick-to: 6.7 6.5
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Ilya Fedin <fedin-ilja2010@ya.ru>
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
(cherry picked from commit 82cba0ca5c575d86accc02defd9c449e272ec1d0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-05 01:40:21 +00:00
Thiago Macieira
34533705b2 Entrypoint/Win32: just use __argc and __argv if available
We were splitting the Unicode command-line using CommandLineToArgvW(),
then converting to 8-bit for argv. That was practically always the same
as what the runtime had already stored in __argv. But not always: it
looks like the runtime splits the 8-bit command-line (GetCommandLineA())
and there are certain Unicode characters that WideCharToMultiByte()
converts to a quote ("), which causes the command-line splitter to
differ from what Qt is doing.

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

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

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

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

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

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

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

Task-number: QTBUG-97601
Change-Id: Ied96113f38c1232fef3ec79847ee62f06c68f268
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit b2eb422699118f4ae8370519b4c7bb3fe121beb2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-04 13:42:16 +00:00
Oliver Wolff
ea588a8a2b tst_qprocess: Add crash helper for MSVC ARM64
The ud2 intrinsic isn't available for ARM64

Fixes: QTBUG-125436
Pick-to: 6.7
Change-Id: I3f71252c570cf9795de7907fea68f46ffc81211a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 1fd965cd2be5e73ab7ab8d1e9b44d77f32182744)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-04 11:19:01 +00:00
Tuomas Vaarala
8f50ece5fa [QNX] Return Qt::Key_Clear when numpad key 5 is pressed without num lock
Based on the documentation, the numeric keypad key 5 is commonly mapped
to Qt::Key_Clear, when Num Lock is off. Previously the number 5 was
returned also when the Num Lock is off which caused an ui application
being unable to disable the numpad key number 5 when numlock is off.

Fixes: QTBUG-125958
Pick-to: 6.7 6.5
Change-Id: I62f7521376890a201cd11abf78847bcb0eb1752a
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
(cherry picked from commit cc89c4c76567184b2887952dfe44375ff3ebd28d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-04 10:38:50 +00:00
Ivan Solovev
31e247f9f8 tst_QCompareHelpers::compareWithAttributes(): do not generate deprecation warnings
Some compilers do not respect the

  QT_WARNING_PUSH
  QT_WARNING_DISABLE_DEPRECATED
  ...
  QT_WARNING_POP

incantation, so rewrite the test to use `template <typename X>` as
an Attribute parameter of the macros.
This allows to get rid of annoying warnings when compiling
tst_qcomparehelpers.

Amends de16185068a08e0cab8bf588c574899a19392410.

Change-Id: I0b3a0f4ad3189d39f5662ce128d5e5f427543393
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit c6feed7e1d8b8ed991a81878c78bb361f038eaf6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-03 19:07:48 +00:00
Ali Kianian
98ecccba8d Add AssetDownloader to QtBase as a static library
Task-number: QTBUG-122550
Change-Id: I97419f27079475784ae05e1150493abc87e1b119
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit cbb2493cf76eaad23315ad1a4676d44d396fafc3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-03 19:07:48 +00:00
Tor Arne Vestbø
6d95a07af0 coin: Make macOS 12 and 13 Tart ARM VMs significant
The last 30 days shows that these configs are stable, so we can
make them significant:

 http://testresults.qt.io/grafana/goto/jBYi1JsSR?orgId=1

The tst_qheif::writeImage test has been blacklisted separately.

Change-Id: Ibe7981bce2db1ec90781d3ea33fe7d4541990aea
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 70ace7ae78d6637c21a646e726caffb36a1968a6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-03 12:57:01 +00:00
Juha Vuolle
52a91ac5b0 Fix JNI Types doc link
Fixes warning: Can't link to 'QJniObject::JNI Types'

Amends: aad13ef59c7d75abdab5cc4a5fc8c594b988dbf5

Change-Id: I9361afe4745ef33908ea9a29f4543cfe044500d3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 5bc1bca2dd390180a3af214e82076228be42a4e5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-03 10:28:04 +00:00
1825 changed files with 66713 additions and 30030 deletions

View File

@ -38,15 +38,15 @@ set(QT_MAX_NEW_POLICY_CMAKE_VERSION "3.21")
# These should be updated together with the documentation in
# qtdoc/doc/src/platforms/supported-platforms.qdocinc
set(QT_SUPPORTED_MIN_MACOS_SDK_VERSION "13")
set(QT_SUPPORTED_MAX_MACOS_SDK_VERSION "14")
set(QT_SUPPORTED_MIN_MACOS_XCODE_VERSION "14")
set(QT_SUPPORTED_MIN_MACOS_SDK_VERSION "14")
set(QT_SUPPORTED_MAX_MACOS_SDK_VERSION "15")
set(QT_SUPPORTED_MIN_MACOS_XCODE_VERSION "15")
set(QT_SUPPORTED_MIN_IOS_SDK_VERSION "16")
set(QT_SUPPORTED_MAX_IOS_SDK_VERSION "17")
set(QT_SUPPORTED_MIN_IOS_XCODE_VERSION "14")
set(QT_SUPPORTED_MIN_IOS_SDK_VERSION "17")
set(QT_SUPPORTED_MAX_IOS_SDK_VERSION "18")
set(QT_SUPPORTED_MIN_IOS_XCODE_VERSION "15")
set(QT_SUPPORTED_MIN_VISIONOS_SDK_VERSION "1")
set(QT_SUPPORTED_MAX_VISIONOS_SDK_VERSION "1")
set(QT_SUPPORTED_MAX_VISIONOS_SDK_VERSION "2")
set(QT_SUPPORTED_MIN_VISIONOS_XCODE_VERSION "15")

View File

@ -34,5 +34,5 @@ echo "$arg" >> "$optfile"
done
cmake_script_path="$script_dir_path/@__relative_path_to_cmake_scripts_dir@/QtProcessConfigureArgs.cmake"
qt_cmake_private_path="$script_dir_path/../libexec"
qt_cmake_private_path="$script_dir_path/../@INSTALL_LIBEXECDIR@"
"$qt_cmake_private_path/qt-cmake-private" -DOPTFILE=$optfile -DMODULE_ROOT="$module_root" -DCMAKE_COMMAND="$qt_cmake_private_path/qt-cmake-private" -P "$cmake_script_path"

View File

@ -80,7 +80,9 @@ if(GLESv2_FOUND AND NOT TARGET GLESv2::GLESv2)
IMPORTED_LOCATION "${GLESv2_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${GLESv2_INCLUDE_DIR}")
if(EGL_LIBRARY)
if(TARGET EGL::EGL)
target_link_libraries(GLESv2::GLESv2 INTERFACE "EGL::EGL")
elseif(EGL_LIBRARY)
target_link_libraries(GLESv2::GLESv2 INTERFACE "${EGL_LIBRARY}")
endif()
endif()

View File

@ -23,13 +23,13 @@
find_path(Interbase_INCLUDE_DIR
NAMES ibase.h
HINTS ${Interbase_INCLUDEDIR}
HINTS "${Interbase_INCLUDEDIR}" "${Interbase_ROOT}/include"
PATH_SUFFIXES firebird
)
find_library(Interbase_LIBRARY
NAMES firebase_ms fbclient gds
HINTS ${Interbase_LIBDIR}
NAMES firebase_ms fbclient_ms fbclient gds
HINTS "${Interbase_LIBDIR}" "${Interbase_ROOT}/lib"
)
include(FindPackageHandleStandardArgs)

View File

@ -48,7 +48,7 @@ if(PkgConfig_FOUND AND NOT DEFINED MySQL_ROOT)
set(MySQL_library_hints ${PC_MySQL_LIBDIR})
set(MySQL_library_hints_debug "")
else()
set(MySQL_include_dir_hints "")
set(MySQL_include_dir_hints "${MySQL_ROOT}" "${MySQL_ROOT}/include")
if(NOT DEFINED MySQL_LIBRARY_DIR)
set(MySQL_LIBRARY_DIR "${MySQL_ROOT}/lib")
endif()

View File

@ -23,13 +23,16 @@
find_path(Oracle_INCLUDE_DIR
NAMES oci.h
HINTS ${Oracle_INCLUDE_DIR})
HINTS ${Oracle_INCLUDE_DIR} "${Oracle_ROOT}" "${Oracle_ROOT}/include" "${Oracle_ROOT}/sdk/include"
)
set(ORACLE_OCI_NAMES clntsh ociei oraociei12 oci)
find_library(Oracle_LIBRARY
NAMES ${ORACLE_OCI_NAMES}
HINTS ${Oracle_LIBRARY_DIR})
HINTS ${Oracle_LIBRARY_DIR} "${Oracle_ROOT}" "${Oracle_ROOT}/lib" "${Oracle_ROOT}/sdk/lib"
PATH_SUFFIXES msvc
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Oracle DEFAULT_MSG Oracle_LIBRARY Oracle_INCLUDE_DIR)

View File

@ -135,18 +135,22 @@ endfunction()
#
function(qt_internal_add_3rdparty_library target)
qt_internal_get_add_library_option_args(library_option_args)
set(option_args
EXCEPTIONS
INSTALL
SKIP_AUTOMOC
)
${__qt_internal_sbom_optional_args}
)
set(single_args
OUTPUT_DIRECTORY
QMAKE_LIB_NAME
${__qt_internal_sbom_single_args}
)
set(multi_args
${__default_private_args}
${__default_public_args}
${__qt_internal_sbom_multi_args}
)
cmake_parse_arguments(PARSE_ARGV 1 arg
@ -193,7 +197,6 @@ function(qt_internal_add_3rdparty_library target)
qt_internal_add_qt_repo_known_module(${target})
qt_internal_add_target_aliases(${target})
_qt_internal_apply_strict_cpp(${target})
qt_skip_warnings_are_errors_when_repo_unclean("${target}")
@ -253,6 +256,12 @@ function(qt_internal_add_3rdparty_library target)
)
if(NOT BUILD_SHARED_LIBS OR arg_INSTALL)
set(will_install TRUE)
else()
set(will_install FALSE)
endif()
if(will_install)
qt_generate_3rdparty_lib_pri_file("${target}" "${arg_QMAKE_LIB_NAME}" pri_file)
if(pri_file)
qt_install(FILES "${pri_file}" DESTINATION "${INSTALL_MKSPECSDIR}/modules")
@ -327,6 +336,57 @@ function(qt_internal_add_3rdparty_library target)
INTERPROCEDURAL_OPTIMIZATION OFF
)
endif()
if(QT_GENERATE_SBOM)
set(sbom_args "")
list(APPEND sbom_args TYPE QT_THIRD_PARTY_MODULE)
if(NOT will_install)
list(APPEND sbom_args NO_INSTALL)
endif()
qt_get_cmake_configurations(configs)
foreach(config IN LISTS configs)
_qt_internal_sbom_append_multi_config_aware_single_arg_option(
RUNTIME_PATH
"${INSTALL_BINDIR}"
"${config}"
sbom_args
)
_qt_internal_sbom_append_multi_config_aware_single_arg_option(
LIBRARY_PATH
"${INSTALL_LIBDIR}"
"${config}"
sbom_args
)
_qt_internal_sbom_append_multi_config_aware_single_arg_option(
ARCHIVE_PATH
"${INSTALL_LIBDIR}"
"${config}"
sbom_args
)
endforeach()
_qt_internal_forward_function_args(
FORWARD_APPEND
FORWARD_PREFIX arg
FORWARD_OUT_VAR sbom_args
FORWARD_OPTIONS
${__qt_internal_sbom_optional_args}
FORWARD_SINGLE
${__qt_internal_sbom_single_args}
FORWARD_MULTI
${__qt_internal_sbom_multi_args}
)
_qt_internal_extend_sbom(${target} ${sbom_args})
endif()
qt_add_list_file_finalizer(qt_internal_finalize_3rdparty_library ${target})
endfunction()
function(qt_internal_finalize_3rdparty_library target)
_qt_internal_finalize_sbom(${target})
endfunction()
function(qt_install_3rdparty_library_wrap_config_extra_file target)
@ -368,9 +428,11 @@ function(qt_internal_add_3rdparty_header_module target)
_qt_internal_validate_all_args_are_parsed(arg)
qt_internal_add_module(${target}
IS_QT_3RD_PARTY_HEADER_MODULE
INTERNAL_MODULE
HEADER_MODULE
NO_CONFIG_HEADER_FILE
NO_GENERATE_CPP_EXPORTS
EXTERNAL_HEADERS ${arg_EXTERNAL_HEADERS}
EXTERNAL_HEADERS_DIR ${arg_EXTERNAL_HEADERS_DIR}
)

View File

@ -4,10 +4,28 @@
# This function creates a CMake target for a Qt internal app.
# Such projects had a load(qt_app) command.
function(qt_internal_add_app target)
set(option_args
NO_INSTALL
INSTALL_VERSIONED_LINK
EXCEPTIONS
NO_UNITY_BUILD
${__qt_internal_sbom_optional_args}
)
set(single_args
${__default_target_info_args}
${__qt_internal_sbom_single_args}
INSTALL_DIR
)
set(multi_args
${__default_private_args}
${__qt_internal_sbom_multi_args}
PUBLIC_LIBRARIES
)
cmake_parse_arguments(PARSE_ARGV 1 arg
"NO_INSTALL;INSTALL_VERSIONED_LINK;EXCEPTIONS;NO_UNITY_BUILD"
"${__default_target_info_args};INSTALL_DIR"
"${__default_private_args};PUBLIC_LIBRARIES"
"${option_args}"
"${single_args}"
"${multi_args}"
)
_qt_internal_validate_all_args_are_parsed(arg)
@ -76,7 +94,6 @@ function(qt_internal_add_app target)
# qt_set_target_info_properties knows how to process them
)
qt_internal_add_target_aliases("${target}")
_qt_internal_apply_strict_cpp("${target}")
qt_internal_adjust_main_config_runtime_output_dir("${target}" "${output_directory}")
# To mimic the default behaviors of qt_app.prf, we by default enable GUI Windows applications,
@ -96,6 +113,43 @@ function(qt_internal_add_app target)
TARGETS ${target})
endif()
if(QT_GENERATE_SBOM)
set(sbom_args "")
list(APPEND sbom_args TYPE QT_APP)
qt_get_cmake_configurations(cmake_configs)
foreach(cmake_config IN LISTS cmake_configs)
qt_get_install_target_default_args(
OUT_VAR unused_install_targets_default_args
OUT_VAR_RUNTIME runtime_install_destination
RUNTIME "${arg_INSTALL_DIR}"
CMAKE_CONFIG "${cmake_config}"
ALL_CMAKE_CONFIGS ${cmake_configs})
_qt_internal_sbom_append_multi_config_aware_single_arg_option(
RUNTIME_PATH
"${runtime_install_destination}"
"${cmake_config}"
sbom_args
)
endforeach()
_qt_internal_forward_function_args(
FORWARD_APPEND
FORWARD_PREFIX arg
FORWARD_OUT_VAR sbom_args
FORWARD_OPTIONS
NO_INSTALL
${__qt_internal_sbom_optional_args}
FORWARD_SINGLE
${__qt_internal_sbom_single_args}
FORWARD_MULTI
${__qt_internal_sbom_multi_args}
)
_qt_internal_extend_sbom(${target} ${sbom_args})
endif()
qt_add_list_file_finalizer(qt_internal_finalize_app ${target})
endfunction()
@ -143,4 +197,5 @@ function(qt_internal_finalize_app target)
# set after a qt_internal_add_app call.
qt_apply_rpaths(TARGET "${target}" INSTALL_PATH "${INSTALL_BINDIR}" RELATIVE_RPATH)
qt_internal_apply_staging_prefix_build_rpath_workaround()
_qt_internal_finalize_sbom(${target})
endfunction()

View File

@ -333,6 +333,137 @@ function(qt_auto_detect_cyclic_toolchain)
endif()
endfunction()
# Gets output of running 'uname -m', finding uname in path, and caching its location in QT_UNAME.
# Usually returns an architecture string like 'arch64' or 'x86_64'.
# Returns an empty string in case of an error.
# Does not pierce Rosetta, so will not always return the actual physical architecture.
# Usually that is based on the architecture of the parent process that invokes cmake.
function(qt_internal_get_uname_m_output out_var)
# This caches by default.
find_program(QT_UNAME NAMES uname PATHS /bin /usr/bin /usr/local/bin)
execute_process(COMMAND ${QT_UNAME} -m
OUTPUT_VARIABLE output
RESULT_VARIABLE result
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET)
if(result EQUAL 0)
set(value "${output}")
else()
set(value "")
endif()
set(${out_var} "${value}" PARENT_SCOPE)
endfunction()
# Sets out_var to TRUE if running on a host machine with an Apple silicon arm64 CPU.
# This is TRUE even when running under Rosetta, aka it pierces Rosetta, unlike the result of
# 'uname -m'.
# Same as the logic in Modules/Platform/Darwin-Initialize.cmake
# Or https://github.com/Homebrew/brew/pull/7995/files
function(qt_internal_is_apple_physical_cpu_arm64 out_var)
execute_process(
COMMAND sysctl -q hw.optional.arm64
OUTPUT_VARIABLE sysctl_stdout
ERROR_VARIABLE sysctl_stderr
RESULT_VARIABLE sysctl_result)
if(sysctl_result EQUAL 0 AND sysctl_stdout MATCHES "hw.optional.arm64: 1")
set(value TRUE)
else()
set(value FALSE)
endif()
set(${out_var} "${value}" PARENT_SCOPE)
endfunction()
# Mirror CMake's logic of detecting the CMAKE_HOST_SYSTEM_PROCESSOR, including handling of Apple
# silicon, before project() is actually called.
# Honors whatever architecture Rosetta reports.
# Similar to the code in Modules/CMakeDetermineSystem.cmake
# and thus allows override via CMAKE_APPLE_SILICON_PROCESSOR.
function(qt_internal_get_early_apple_host_system_arch out_var_processor)
# If we are running on Apple Silicon, honor CMAKE_APPLE_SILICON_PROCESSOR.
if(DEFINED CMAKE_APPLE_SILICON_PROCESSOR)
set(processor "${CMAKE_APPLE_SILICON_PROCESSOR}")
elseif(DEFINED ENV{CMAKE_APPLE_SILICON_PROCESSOR})
set(processor "$ENV{CMAKE_APPLE_SILICON_PROCESSOR}")
else()
set(processor "")
endif()
if(processor)
# Handle case when CMAKE_APPLE_SILICON_PROCESSOR is passed on an Intel x86_64 machine, in
# that case we unset the given value, instead relying on the output of 'uname -m'.
if(";${processor};" MATCHES "^;(arm64|x86_64);$")
qt_internal_is_apple_physical_cpu_arm64(is_arm64)
if(NOT is_arm64)
set(processor "")
endif()
endif()
endif()
if(processor)
set(output "${processor}")
else()
qt_internal_get_uname_m_output(output)
endif()
set(${out_var_processor} "${output}" PARENT_SCOPE)
endfunction()
# Detect whether the user intends to cross-compile to arm64 on an x86_64 macOS host, or vice versa,
# based on the passed-in CMAKE_OSX_ARCHITECTURES and the real physical host architecture.
#
# CMake doesn't handle this properly by default, unless one explicitly passes
# -DCMAKE_SYSTEM_NAME=Darwin, which people don't really know about and is somewhat unintuitive.
#
# If a cross-compilation is detected, a host Qt will be required for tools.
function(qt_auto_detect_macos_single_arch_cross_compilation)
# Skip on non-Apple platforms.
if(NOT APPLE
# If CMAKE_SYSTEM_NAME is explicitly specified, it means CMake will implicitly
# do `set(CMAKE_CROSSCOMPILING TRUE)`, so we don't need to do anything extra.
OR CMAKE_SYSTEM_NAME OR CMAKE_CROSSCOMPILING
# Opt out just in case this breaks something
OR QT_NO_HANDLE_APPLE_SINGLE_ARCH_CROSS_COMPILING
# Exit early if check was previously done, so we don't need to do extra process calls.
OR QT_INTERNAL_MACOS_SINGLE_ARCH_CROSS_COMPILING_DETECTION_DONE)
return()
endif()
list(LENGTH CMAKE_OSX_ARCHITECTURES arch_count)
# We only consider cross-compilation the case where arch count is exactly 1.
if(NOT arch_count EQUAL 1)
return()
else()
set(target_arch "${CMAKE_OSX_ARCHITECTURES}")
endif()
qt_internal_get_early_apple_host_system_arch(host_arch)
if(NOT "${host_arch}" STREQUAL "${target_arch}" AND
NOT ("${host_arch}" STREQUAL "x86_64" AND "${target_arch}" STREQUAL "x86_64h"))
message(
STATUS "Detected implicit macOS cross-compilation. "
"Host arch: ${host_arch} Target arch: ${target_arch}. "
"Setting CMAKE_CROSSCOMPILING to TRUE."
)
# Setting these tells CMake we are cross-compiling. This gets set in the correct scope
# for top-level builds as well, because it is included via
# qt_internal_top_level_setup_autodetect -> include() -> qt_internal_setup_autodetect()
# all of which are macros that don't create a new scope.
set(CMAKE_SYSTEM_NAME "Darwin" PARENT_SCOPE)
set(CMAKE_CROSSCOMPILING "TRUE" PARENT_SCOPE)
endif()
set(QT_INTERNAL_MACOS_SINGLE_ARCH_CROSS_COMPILING_DETECTION_DONE TRUE CACHE BOOL "")
endfunction()
function(qt_auto_detect_pch)
set(default_value "ON")
@ -476,6 +607,7 @@ macro(qt_internal_setup_autodetect)
qt_auto_detect_cyclic_toolchain()
qt_auto_detect_cmake_config()
qt_auto_detect_apple()
qt_auto_detect_macos_single_arch_cross_compilation()
qt_auto_detect_android()
qt_auto_detect_pch()
qt_auto_detect_wasm()

View File

@ -68,7 +68,7 @@ qt_internal_create_toolchain_file()
## Library to hold global features:
## These features are stored and accessed via Qt::GlobalConfig, but the
## files always lived in Qt::Core, so we keep it that way
add_library(GlobalConfig INTERFACE)
qt_internal_add_platform_internal_target(GlobalConfig)
target_include_directories(GlobalConfig INTERFACE
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include/QtCore>
@ -121,9 +121,8 @@ qt_generate_qmake_and_qtpaths_wrapper_for_target()
# Depends on the global features being evaluated.
qt_internal_create_wrapper_scripts()
add_library(Qt::GlobalConfig ALIAS GlobalConfig)
add_library(GlobalConfigPrivate INTERFACE)
qt_internal_add_platform_internal_target(GlobalConfigPrivate)
target_link_libraries(GlobalConfigPrivate INTERFACE GlobalConfig)
target_include_directories(GlobalConfigPrivate INTERFACE
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include/QtCore/${PROJECT_VERSION}>
@ -131,8 +130,6 @@ target_include_directories(GlobalConfigPrivate INTERFACE
$<INSTALL_INTERFACE:${INSTALL_INCLUDEDIR}/QtCore/${PROJECT_VERSION}>
$<INSTALL_INTERFACE:${INSTALL_INCLUDEDIR}/QtCore/${PROJECT_VERSION}/QtCore>
)
add_library(Qt::GlobalConfigPrivate ALIAS GlobalConfigPrivate)
add_library(${QT_CMAKE_EXPORT_NAMESPACE}::GlobalConfigPrivate ALIAS GlobalConfigPrivate)
qt_internal_setup_public_platform_target()

View File

@ -166,6 +166,22 @@ macro(qt_internal_qtbase_build_repo)
## Build System tests:
include(QtBaseCMakeTesting)
## Include CoreMacros() for qt6_generate_meta_types()
## Also needed for the QtBaseGlobalTargets creation.
set(QT_DEFAULT_MAJOR_VERSION 6)
include(src/corelib/Qt6CoreMacros.cmake)
# Needed when building qtbase for android.
if(ANDROID)
include(src/corelib/Qt6AndroidMacros.cmake)
endif()
# Needed when building for WebAssembly.
if(WASM)
include(cmake/QtWasmHelpers.cmake)
include(src/corelib/Qt6WasmMacros.cmake)
endif()
## Targets for global features, etc.:
include(QtBaseGlobalTargets)
@ -173,20 +189,11 @@ macro(qt_internal_qtbase_build_repo)
## feature variables are available.
qt_set_language_standards()
#include CoreMacros() for qt6_generate_meta_types()
set(QT_DEFAULT_MAJOR_VERSION 6)
include(src/corelib/Qt6CoreMacros.cmake)
# Needed when building qtbase for android.
if(ANDROID)
include(src/corelib/Qt6AndroidMacros.cmake)
_qt_internal_create_global_android_targets()
endif()
if(WASM)
# Needed when building for WebAssembly.
include(cmake/QtWasmHelpers.cmake)
include(src/corelib/Qt6WasmMacros.cmake)
qt_internal_setup_wasm_target_properties(Platform)
endif()
@ -205,7 +212,7 @@ macro(qt_internal_qtbase_build_repo)
endif()
if(NOT QT_INTERNAL_BUILD_STANDALONE_PARTS)
if(QT_WILL_BUILD_TOOLS AND QT_FEATURE_settings)
if(QT_FEATURE_settings)
add_subdirectory(qmake)
endif()

View File

@ -71,6 +71,10 @@ macro(qt_internal_include_qt_platform_android)
endif()
endmacro()
macro(qt_internal_include_qt_properties)
include(QtProperties)
endmacro()
macro(qt_internal_set_compiler_optimization_flags)
include(QtCompilerOptimization)
endmacro()
@ -192,10 +196,12 @@ function(qt_internal_get_qt_build_private_helpers out_var)
QtPrecompiledHeadersHelpers
QtPriHelpers
QtPrlHelpers
QtProperties
QtQmakeHelpers
QtResourceHelpers
QtRpathHelpers
QtSanitizerHelpers
QtSbomHelpers
QtScopeFinalizerHelpers
QtSeparateDebugInfo
QtSimdHelpers
@ -278,7 +284,10 @@ function(qt_internal_get_qt_build_public_helpers out_var)
QtPublicExternalProjectHelpers
QtPublicFinalizerHelpers
QtPublicFindPackageHelpers
QtPublicGitHelpers
QtPublicPluginHelpers
QtPublicSbomGenerationHelpers
QtPublicSbomHelpers
QtPublicTargetHelpers
QtPublicTestHelpers
QtPublicToolHelpers
@ -417,6 +426,8 @@ macro(qt_internal_setup_build_and_global_variables)
qt_internal_include_qt_platform_android()
qt_internal_include_qt_properties()
# Depends on qt_internal_setup_default_install_prefix
qt_internal_setup_paths_and_prefixes()

View File

@ -3,7 +3,16 @@
# Includes QtSetup and friends for private CMake API.
set(QT_INTERNAL_IS_STANDALONE_TEST TRUE)
# Checks minimum CMake version and upgrades policies.
qt_internal_project_setup()
# Look for the Qt6 package before trying to call qt_build_internals_set_up_private_api,
# otherwise it will fail when using a cross-compiled Qt, because QT_HOST_PATH will not be set.
# QT_HOST_PATH is set by Qt6Dependencies.cmake.
find_package(Qt6 REQUIRED)
# Includes QtSetup.cmake.
qt_build_internals_set_up_private_api()
# Find all StandaloneTestsConfig.cmake files, and include them

View File

@ -116,35 +116,42 @@ function(qt_configure_process_path name default docstring)
endif()
# No value provided, set the default.
# Make sure to process the paths even for the defaults to ensure we have canonicalized paths
# on the first configure run and thus don't regenerate qconfig.cpp on a subsequent
# configure run when the paths might become different if we didn't do it on first run.
# e.g. './plugins' would get turned to 'plugins'.
if(NOT DEFINED "${name}")
set("${name}" "${default}" CACHE STRING "${docstring}")
else()
get_filename_component(given_path_as_abs "${${name}}" ABSOLUTE BASE_DIR
"${CMAKE_INSTALL_PREFIX}")
file(RELATIVE_PATH rel_path "${CMAKE_INSTALL_PREFIX}"
"${given_path_as_abs}")
# If absolute path given, check that it's inside the prefix (error out if not).
# TODO: Figure out if we need to support paths that are outside the prefix.
#
# If relative path given, it's relative to the install prefix (rather than the binary dir,
# which is what qmake does for some reason).
# In both cases, store the value as a relative path.
if("${rel_path}" STREQUAL "")
# file(RELATIVE_PATH) returns an empty string if the given absolute paths are equal
set(rel_path ".")
elseif(rel_path MATCHES "^\.\./")
# INSTALL_SYSCONFDIR is allowed to be outside the prefix.
if(NOT name STREQUAL "INSTALL_SYSCONFDIR")
message(FATAL_ERROR
"Path component '${name}' is outside computed install prefix: ${rel_path} ")
return()
endif()
set("${name}" "${${name}}" CACHE STRING "${docstring}" FORCE)
else()
set("${name}" "${rel_path}" CACHE STRING "${docstring}" FORCE)
endif()
set("${name}" "${default}")
endif()
get_filename_component(given_path_as_abs "${${name}}" ABSOLUTE BASE_DIR
"${CMAKE_INSTALL_PREFIX}")
file(RELATIVE_PATH rel_path "${CMAKE_INSTALL_PREFIX}"
"${given_path_as_abs}")
# If absolute path given, check that it's inside the prefix (error out if not).
# If relative path given, it's relative to the install prefix (rather than the binary dir,
# which is what qmake does for some reason).
# In both cases, store the value as a relative path, unless we're processing INSTALL_SYSCONFDIR
# which should stay abslute.
if("${rel_path}" STREQUAL "")
# file(RELATIVE_PATH) returns an empty string if the given absolute paths are equal,
# so manually set it to '.'
set(new_value ".")
elseif(rel_path MATCHES "^\.\./")
# INSTALL_SYSCONFDIR is allowed to be outside the prefix.
if(NOT name STREQUAL "INSTALL_SYSCONFDIR")
message(FATAL_ERROR
"Path component '${name}' is outside computed install prefix: ${rel_path} ")
endif()
# Keep the absolute path.
set(new_value "${${name}}")
else()
# Use the canonicalized path.
set(new_value "${rel_path}")
endif()
set("${name}" "${new_value}" CACHE STRING "${docstring}" FORCE)
endfunction()
macro(qt_internal_setup_configure_install_paths)
@ -193,6 +200,8 @@ macro(qt_internal_setup_configure_install_paths)
qt_configure_process_path(INSTALL_DESCRIPTIONSDIR
"${INSTALL_ARCHDATADIR}/modules"
"Module description files directory")
qt_configure_process_path(INSTALL_SBOMDIR "${INSTALL_ARCHDATADIR}/sbom"
"SBOM [PREFIX/sbom]")
endmacro()
macro(qt_internal_set_cmake_install_libdir)

View File

@ -28,6 +28,8 @@ macro(qt_examples_build_begin)
qt_internal_find_standalone_parts_config_files()
endif()
string(TOLOWER ${PROJECT_NAME} project_name_lower)
if(arg_EXTERNAL_BUILD AND QT_BUILD_EXAMPLES_AS_EXTERNAL)
# Examples will be built using ExternalProject.
# We depend on all plugins built as part of the current repo as well as current repo's
@ -50,7 +52,6 @@ macro(qt_examples_build_begin)
set(QT_IS_EXTERNAL_EXAMPLES_BUILD TRUE)
string(TOLOWER ${PROJECT_NAME} project_name_lower)
if(NOT TARGET examples)
if(QT_BUILD_EXAMPLES_BY_DEFAULT)
add_custom_target(examples ALL)
@ -120,6 +121,28 @@ macro(qt_examples_build_begin)
# files are installed into the original install prefix.
set(_qt_internal_examples_cmake_install_prefix_backup \"\${CMAKE_INSTALL_PREFIX}\")
")
# Backup the DESTDIR and unset it, so that example installation is not affected by DESTDIR.
# This is activated by our CI when QT_INTERNAL_EXAMPLES_INSTALL_PREFIX is set.
if(QT_INTERNAL_EXAMPLES_INSTALL_PREFIX)
set(_qt_examples_should_unset_destdir TRUE)
else()
set(_qt_examples_should_unset_destdir FALSE)
endif()
set_property(GLOBAL PROPERTY
_qt_examples_should_unset_destdir_${project_name_lower}
"${_qt_examples_should_unset_destdir}")
if(_qt_examples_should_unset_destdir)
install(CODE "
# Temporarily unset DESTDIR while examples are being installed.
set(_qt_internal_examples_destdir_backup \"\$ENV{DESTDIR}\")
unset(ENV{DESTDIR})
")
endif()
unset(_qt_examples_should_unset_destdir)
unset(project_name_lower)
endmacro()
macro(qt_examples_build_end)
@ -145,6 +168,21 @@ set(CMAKE_INSTALL_PREFIX \"\${_qt_internal_examples_cmake_install_prefix_backup}
")
set(CMAKE_UNITY_BUILD ${QT_UNITY_BUILD})
string(TOLOWER ${PROJECT_NAME} project_name_lower)
get_property(_qt_examples_should_unset_destdir
GLOBAL PROPERTY _qt_examples_should_unset_destdir_${project_name_lower})
if(_qt_examples_should_unset_destdir)
install(CODE "
# Restore the DESTDIR env var after examples have been installed.
set(ENV{DESTDIR} \"\${_qt_internal_examples_destdir_backup}\")
unset(_qt_internal_examples_destdir_backup)
")
endif()
unset(_qt_examples_should_unset_destdir)
unset(project_name_lower)
endmacro()
# Allows building an example either as an ExternalProject or in-tree with the Qt build.
@ -345,7 +383,7 @@ function(qt_internal_add_example_external_project subdir)
list(TRANSFORM glob_prefixes APPEND "/${INSTALL_LIBDIR}/cmake/${QT_CMAKE_EXPORT_NAMESPACE}Qml")
set(qml_plugin_cmake_config_file_glob_prefixes "")
foreach(glob_prefix IN LISTS glob_prefix)
foreach(glob_prefix IN LISTS glob_prefixes)
if(EXISTS "${glob_prefix}")
list(APPEND qml_plugin_cmake_config_file_glob_prefixes "${glob_prefix}")
endif()

View File

@ -11,7 +11,6 @@ macro(qt_internal_project_setup)
# Check for the minimum CMake version.
qt_internal_require_suitable_cmake_version()
qt_internal_upgrade_cmake_policies()
qt_internal_promote_platform_targets_to_global()
endmacro()
macro(qt_build_internals_set_up_private_api)
@ -252,6 +251,7 @@ macro(qt_build_repo_begin)
qt_internal_read_repo_dependencies(qt_repo_deps "${PROJECT_SOURCE_DIR}")
if(qt_repo_deps)
set_property(GLOBAL PROPERTY _qt_repo_deps_${project_name_lower} ${qt_repo_deps})
foreach(qt_repo_dep IN LISTS qt_repo_deps)
if(TARGET qt_plugins_${qt_repo_dep})
message(DEBUG
@ -308,6 +308,12 @@ macro(qt_build_repo_begin)
if(QT_INTERNAL_SYNCED_MODULES)
set_property(GLOBAL PROPERTY _qt_synced_modules ${QT_INTERNAL_SYNCED_MODULES})
endif()
_qt_internal_sbom_begin_project(
INSTALL_PREFIX "${QT_STAGING_PREFIX}"
INSTALL_SBOM_DIR "${INSTALL_SBOMDIR}"
QT_CPE
)
endmacro()
# Runs delayed actions on some of the Qt targets.
@ -371,6 +377,8 @@ macro(qt_build_repo_end)
set(QT_INTERNAL_FRESH_REQUESTED "FALSE" CACHE INTERNAL "")
endif()
_qt_internal_sbom_end_project()
if(NOT QT_SUPERBUILD)
qt_internal_qt_configure_end()
endif()
@ -556,14 +564,17 @@ macro(qt_build_repo_impl_tests)
message(FATAL_ERROR
"Can't build both standalone tests and standalone examples at once.")
endif()
option(QT_BUILD_TESTS_PROJECT_${PROJECT_NAME} "Configure tests for project ${PROJECT_NAME}" TRUE)
string(TOLOWER "${PROJECT_NAME}" __qt_repo_project_name_lowercase)
option(QT_BUILD_TESTS_PROJECT_${__qt_repo_project_name_lowercase}
"Configure tests for project ${__qt_repo_project_name_lowercase}" TRUE)
if (QT_BUILD_TESTS_PROJECT_${PROJECT_NAME})
if (QT_BUILD_TESTS_PROJECT_${__qt_repo_project_name_lowercase})
add_subdirectory(tests)
if(NOT QT_BUILD_TESTS_BY_DEFAULT)
set_property(DIRECTORY tests PROPERTY EXCLUDE_FROM_ALL TRUE)
endif()
endif()
unset(__qt_repo_project_name_lowercase)
endif()
endmacro()
@ -577,8 +588,10 @@ macro(qt_build_repo_impl_examples)
message(STATUS "Configuring examples.")
option(QT_BUILD_EXAMPLES_PROJECT_${PROJECT_NAME} "Configure examples for project ${PROJECT_NAME}" TRUE)
if(QT_BUILD_EXAMPLES_PROJECT_${PROJECT_NAME})
string(TOLOWER "${PROJECT_NAME}" __qt_repo_project_name_lowercase)
option(QT_BUILD_EXAMPLES_PROJECT_${__qt_repo_project_name_lowercase}
"Configure examples for project ${__qt_repo_project_name_lowercase}" TRUE)
if(QT_BUILD_EXAMPLES_PROJECT_${__qt_repo_project_name_lowercase})
# Set this before any examples subdirectories are added, to warn about examples that are
# added via add_subdirectory() calls instead of qt_internal_add_example().
@ -589,6 +602,7 @@ macro(qt_build_repo_impl_examples)
add_subdirectory(examples)
endif()
unset(__qt_repo_project_name_lowercase)
endif()
endmacro()

View File

@ -3,7 +3,13 @@
set(@INSTALL_CMAKE_NAMESPACE@_FOUND FALSE)
set(__qt_platform_requires_host_info_package "@platform_requires_host_info_package@")
if(DEFINED QT_REQUIRE_HOST_PATH_CHECK)
set(__qt_platform_requires_host_info_package "${QT_REQUIRE_HOST_PATH_CHECK}")
elseif(DEFINED ENV{QT_REQUIRE_HOST_PATH_CHECK})
set(__qt_platform_requires_host_info_package "$ENV{QT_REQUIRE_HOST_PATH_CHECK}")
else()
set(__qt_platform_requires_host_info_package "@platform_requires_host_info_package@")
endif()
set(__qt_platform_initial_qt_host_path "@qt_host_path_absolute@")
set(__qt_platform_initial_qt_host_path_cmake_dir "@qt_host_path_cmake_dir_absolute@")
@ -15,7 +21,7 @@ _qt_internal_find_host_info_package(${__qt_platform_requires_host_info_package})
# note: _third_party_deps example: "ICU\\;FALSE\\;1.0\\;i18n uc data;ZLIB\\;FALSE\\;\\;"
set(__qt_third_party_deps "@third_party_deps@")
@third_party_deps_extra_info@
@third_party_extra@
# Don't propagate REQUIRED so we don't immediately FATAL_ERROR, rather let the find_dependency calls

View File

@ -34,6 +34,9 @@ function(qt_internal_add_executable name)
if(ANDROID)
_qt_internal_android_executable_finalizer(${name})
endif()
if(WASM)
qt_internal_wasm_add_finalizers(${name})
endif()
if(arg_QT_APP AND QT_FEATURE_debug_and_release AND CMAKE_VERSION VERSION_GREATER_EQUAL "3.19.0")
set_property(TARGET "${name}"
@ -148,10 +151,6 @@ function(qt_internal_add_executable name)
qt_internal_set_exceptions_flags("${name}" ${arg_EXCEPTIONS})
if(WASM)
qt_internal_wasm_add_finalizers("${name}")
endif()
# Check if target needs to be excluded from all target. Also affects qt_install.
# Set by qt_exclude_tool_directories_from_default_target.
set(exclude_from_all FALSE)
@ -160,7 +159,10 @@ function(qt_internal_add_executable name)
string(FIND "${CMAKE_CURRENT_SOURCE_DIR}" "${absolute_dir}" dir_starting_pos)
if(dir_starting_pos EQUAL 0)
set(exclude_from_all TRUE)
set_target_properties("${name}" PROPERTIES EXCLUDE_FROM_ALL TRUE)
set_target_properties("${name}" PROPERTIES
EXCLUDE_FROM_ALL TRUE
_qt_internal_excluded_from_default_target TRUE
)
break()
endif()
endforeach()
@ -207,6 +209,23 @@ function(qt_internal_add_executable name)
ADDITIONAL_INSTALL_ARGS ${additional_install_args})
qt_internal_install_pdb_files(${name} "${arg_INSTALL_DIRECTORY}")
endif()
if(QT_GENERATE_SBOM)
set(sbom_args "")
_qt_internal_forward_function_args(
FORWARD_APPEND
FORWARD_PREFIX arg
FORWARD_OUT_VAR sbom_args
FORWARD_OPTIONS
${__qt_internal_sbom_optional_args}
FORWARD_SINGLE
${__qt_internal_sbom_single_args}
FORWARD_MULTI
${__qt_internal_sbom_multi_args}
)
_qt_internal_extend_sbom(${name} ${sbom_args})
endif()
endfunction()
# This function compiles the target at configure time the very first time and creates the custom

View File

@ -401,7 +401,9 @@ function(qt_evaluate_feature feature)
qt_evaluate_config_expression(auto_detect ${arg_AUTODETECT})
if(${disable_result})
set(computed OFF)
elseif((${enable_result}) OR (${auto_detect}))
elseif(${enable_result})
set(computed ON)
elseif(${auto_detect})
set(computed ${condition})
else()
# feature not auto-detected and not explicitly enabled

View File

@ -1,21 +1,6 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
# This function recursively walks transitive link libraries of the given target
# and promotes those targets to be IMPORTED_GLOBAL if they are not.
#
# This is required for .prl file generation in top-level builds, to make sure that imported 3rd
# party library targets in any repo are made global, so there are no scoping issues.
#
# Only works if called from qt_find_package(), because the promotion needs to happen in the same
# directory scope where the imported target is first created.
#
# Uses __qt_internal_walk_libs.
function(qt_find_package_promote_targets_to_global_scope target)
__qt_internal_walk_libs("${target}" _discarded_out_var _discarded_out_var_2
"qt_find_package_targets_dict" "promote_global")
endfunction()
# As an optimization when using -developer-build, qt_find_package records which
# packages were found during the initial configuration. Then on subsequent
# reconfigurations it skips looking for packages that were not found on the
@ -182,6 +167,19 @@ macro(qt_find_package)
set(qt_find_package_target_name ${aliased_target})
endif()
if("${qt_find_package_target_name}" MATCHES "${QT_CMAKE_EXPORT_NAMESPACE}::"
AND QT_FEATURE_developer_build
)
message(AUTHOR_WARNING
"qt_find_package() should NOT be used to look up Qt packages. "
"It should only be used to look up 3rd party packages. "
"Please remove the "
"qt_find_package(${ARGV0} PROVIDED_TARGETS "
"${qt_find_package_target_name}) call and contact the build tools team "
"in case the removal is causing issues."
)
endif()
set_target_properties(${qt_find_package_target_name} PROPERTIES
INTERFACE_QT_PACKAGE_NAME ${ARGV0}
INTERFACE_QT_PACKAGE_IS_OPTIONAL ${arg_MARK_OPTIONAL})
@ -224,27 +222,43 @@ macro(qt_find_package)
)
endif()
get_property(is_global TARGET ${qt_find_package_target_name} PROPERTY
IMPORTED_GLOBAL)
qt_internal_should_not_promote_package_target_to_global(
"${qt_find_package_target_name}" should_not_promote)
if(NOT is_global AND NOT should_not_promote)
__qt_internal_promote_target_to_global(${qt_find_package_target_name})
qt_find_package_promote_targets_to_global_scope(
"${qt_find_package_target_name}")
_qt_internal_promote_3rd_party_provided_target_and_3rd_party_deps_to_global(
"${qt_find_package_target_name}")
set(_qt_find_package_sbom_args "")
if(_qt_find_package_found_version)
list(APPEND _qt_find_package_sbom_args
PACKAGE_VERSION "${_qt_find_package_found_version}"
)
endif()
# Work around: QTBUG-125371
if(NOT "${ARGV0}" STREQUAL "Qt6")
_qt_internal_sbom_record_system_library_usage(
"${qt_find_package_target_name}"
TYPE SYSTEM_LIBRARY
FRIENDLY_PACKAGE_NAME "${ARGV0}"
${_qt_find_package_sbom_args}
)
endif()
endif()
endforeach()
if(arg_MODULE_NAME AND arg_QMAKE_LIB
AND (NOT arg_QMAKE_LIB IN_LIST QT_QMAKE_LIBS_FOR_${arg_MODULE_NAME}))
set(QT_QMAKE_LIBS_FOR_${arg_MODULE_NAME}
${QT_QMAKE_LIBS_FOR_${arg_MODULE_NAME}};${arg_QMAKE_LIB} CACHE INTERNAL "")
set(QT_TARGETS_OF_QMAKE_LIB_${arg_QMAKE_LIB} ${arg_PROVIDED_TARGETS} CACHE INTERNAL "")
set(${arg_QMAKE_LIB}_existing_targets "")
foreach(provided_target ${arg_PROVIDED_TARGETS})
set(QT_QMAKE_LIB_OF_TARGET_${provided_target} ${arg_QMAKE_LIB} CACHE INTERNAL "")
if(TARGET ${provided_target})
list(APPEND ${arg_QMAKE_LIB}_existing_targets "${provided_target}")
set(QT_QMAKE_LIB_OF_TARGET_${provided_target}
${arg_QMAKE_LIB} CACHE INTERNAL "")
endif()
endforeach()
set(QT_TARGETS_OF_QMAKE_LIB_${arg_QMAKE_LIB}
"${${arg_QMAKE_LIB}_existing_targets}" CACHE INTERNAL "")
endif()
endif()
endmacro()
@ -635,9 +649,3 @@ function(qt_register_target_dependencies target public_libs private_libs)
set_target_properties("${target}" PROPERTIES _qt_target_deps "${target_deps}")
endfunction()
# Sets out_var to to TRUE if the target was marked to not be promoted to global scope.
function(qt_internal_should_not_promote_package_target_to_global target out_var)
get_property(should_not_promote TARGET "${target}" PROPERTY _qt_no_promote_global)
set("${out_var}" "${should_not_promote}" PARENT_SCOPE)
endfunction()

View File

@ -102,8 +102,11 @@ macro(qt_find_package_system_or_bundled _unique_prefix)
endif()
if(_qfwrap_${_unique_prefix}_package_version)
set(Wrap${_qfwrap_${_unique_prefix}_FRIENDLY_PACKAGE_NAME}_VERSION
"${_qfwrap_${_unique_prefix}_package_version}"
)
set(_qfwrap_${_unique_prefix}_package_version_option
VERSION_VAR "_qfwrap_${_unique_prefix}_package_version"
VERSION_VAR "Wrap${_qfwrap_${_unique_prefix}_FRIENDLY_PACKAGE_NAME}_VERSION"
)
endif()

View File

@ -27,6 +27,7 @@
# IMPLICIT_LINK_DIRECTORIES: list of implicit linker search paths
cmake_policy(SET CMP0007 NEW)
cmake_policy(SET CMP0057 NEW)
include("${CMAKE_CURRENT_LIST_DIR}/QtGenerateLibHelpers.cmake")
file(STRINGS "${IN_FILE}" lines)
@ -50,10 +51,14 @@ foreach(line ${lines})
qt_internal_path_is_relative_to_qt_lib_path(
"${lib}" "${QT_LIB_DIRS}" lib_is_a_qt_module relative_lib)
if(NOT lib_is_a_qt_module)
# It's not a Qt module, extract the library name and prepend an -l to make
# it relocatable.
# It's not a Qt module, extract linker flags from the library path.
qt_transform_absolute_library_paths_to_link_flags(lib_with_link_flag "${lib}")
list(APPEND adjusted_libs "${lib_with_link_flag}")
foreach(flag ${lib_with_link_flag})
# Linker flags started with "-L" shouldn't be added duplicately.
if(NOT flag MATCHES "^-L" OR NOT flag IN_LIST adjusted_libs)
list(APPEND adjusted_libs "${flag}")
endif()
endforeach()
else()
# Is a Qt module.
# Transform Qt framework paths into -framework flags.

View File

@ -87,6 +87,12 @@ function(qt_internal_add_linker_version_script target)
get_target_property(target_type ${target} TYPE)
if(NOT target_type STREQUAL "INTERFACE_LIBRARY")
# Export all specializations of the QExplicitlySharedDataPointer
# and QSharedDataPointer destructors; due to use of the
# QT_DECLARE_Q{,E}SDP_SPECIALIZATION_DTOR_WITH_EXPORT macros
string(APPEND contents "\n _ZN*18QSharedDataPointerI*D?Ev;")
string(APPEND contents "\n _ZN*28QExplicitlySharedDataPointerI*D?Ev;")
set(genex_prefix "\n ")
set(genex_glue "$<SEMICOLON>\n ")
set(genex_suffix "$<SEMICOLON>")
@ -235,6 +241,7 @@ function(qt_internal_apply_gc_binaries target visibility)
endif()
endfunction()
# Only applied to Bootstrap and BundledPCRE2.
function(qt_internal_apply_intel_cet target visibility)
if(NOT QT_FEATURE_intelcet)
return()
@ -254,10 +261,36 @@ function(qt_internal_apply_intel_cet target visibility)
">:-mshstk>")
endif()
if(flags)
set(opt_out_condition "$<NOT:$<BOOL:$<TARGET_PROPERTY:_qt_no_intel_cet_harderning>>>")
set(flags "$<${opt_out_condition}:${flags}>")
target_compile_options("${target}" ${visibility} "${flags}")
endif()
endfunction()
# Meant to be applied to PlatformCommonInternal.
function(qt_internal_apply_intel_cet_harderning target)
if(NOT QT_FEATURE_intelcet)
return()
endif()
set(opt_out_condition "$<NOT:$<BOOL:$<TARGET_PROPERTY:_qt_no_intel_cet_harderning>>>")
if(MSVC)
set(intel_cet_flag "-CETCOMPAT")
set(condition "$<${opt_out_condition}:${intel_cet_flag}>")
qt_internal_platform_link_options("${target}" INTERFACE "${condition}")
else()
set(intel_cet_flag "-fcf-protection=full")
set(condition "$<${opt_out_condition}:${intel_cet_flag}>")
target_compile_options("${target}" INTERFACE "${condition}")
endif()
endfunction()
# Allow opting out of the Intel CET hardening on a per-target basis.
function(qt_internal_skip_intel_cet_hardening target)
set_target_properties("${target}" PROPERTIES _qt_no_intel_cet_harderning TRUE)
endfunction()
# Sets the exceptions flags for the given target according to exceptions_on
function(qt_internal_set_exceptions_flags target exceptions_on)
set(_defs "")

View File

@ -117,18 +117,32 @@ function(qt_copy_framework_headers target)
"${output_dir}/${fw_versioned_header_dir}"
)
set(copy_fw_sync_headers_marker_file
"${CMAKE_CURRENT_BINARY_DIR}/${target}_fw_sync_headers_marker_file"
)
set(copy_fw_sync_headers_marker_file_command
"${CMAKE_COMMAND}" -E touch "${copy_fw_sync_headers_marker_file}"
)
if(CMAKE_GENERATOR MATCHES "^Ninja")
add_custom_command(
OUTPUT "${output_dir}/${fw_versioned_header_dir}"
OUTPUT
"${output_dir}/${fw_versioned_header_dir}"
"${copy_fw_sync_headers_marker_file}"
DEPENDS ${target}_sync_headers
COMMAND ${copy_fw_sync_headers_command}
COMMAND ${copy_fw_sync_headers_marker_file_command}
VERBATIM
)
add_custom_target(${target}_copy_fw_sync_headers
DEPENDS "${output_dir}/${fw_versioned_header_dir}")
else()
add_custom_target(${target}_copy_fw_sync_headers
COMMAND ${copy_fw_sync_headers_command})
COMMAND ${copy_fw_sync_headers_command}
COMMAND ${copy_fw_sync_headers_marker_file_command}
DEPENDS ${target}_sync_headers
)
endif()
if(out_files)

View File

@ -1,14 +1,19 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
# Given "/usr/lib/x86_64-linux-gnu/libcups.so"
# Returns "cups" or an empty string if the file is not an absolute library path.
# Aka it strips the "lib" prefix, the .so extension and the base path.
# Given "/usr/lib/x86_64-linux-gnu/libcups.so", returns "cups".
# Given "libavcodec.a", returns "avcodec".
# Given "ws2_32", returns "ws2_32".
# Returns an empty string if not given a linkable library (most likely a linker flag).
function(qt_get_library_name_without_prefix_and_suffix out_var file_path)
set(out_value "")
if(IS_ABSOLUTE "${file_path}")
if(NOT file_path MATCHES "^-") # not a linker flag
get_filename_component(basename "${file_path}" NAME_WE)
get_filename_component(ext "${file_path}" EXT)
if(NOT ext) # seems like a library name without prefix and suffix
set(${out_var} "${file_path}" PARENT_SCOPE)
return()
endif()
string(TOLOWER "${ext}" ext_lower)
foreach(libsuffix ${LIBRARY_SUFFIXES})
# Handle weird prefix extensions like in the case of
@ -45,8 +50,10 @@ function(qt_get_library_name_without_prefix_and_suffix out_var file_path)
set(${out_var} "${out_value}" PARENT_SCOPE)
endfunction()
# Given "/usr/lib/x86_64-linux-gnu/libcups.so"
# Returns "-lcups" or an empty string if the file is not an absolute library path.
# Given "/usr/lib/x86_64-linux-gnu/libcups.so", returns "-lcups".
# Given "libavcodec.a", returns "-lavcodec".
# Given "ws2_32", returns "-lws2_32".
# Returns an empty string if not given a linkable library (most likely a linker flag).
function(qt_get_library_with_link_flag out_var file_path)
qt_get_library_name_without_prefix_and_suffix(lib_name "${file_path}")
@ -70,11 +77,14 @@ function(qt_transform_absolute_library_paths_to_link_flags out_var library_path_
if(lib_name_with_link_flag)
string(TOLOWER "${IMPLICIT_LINK_DIRECTORIES}" IMPLICIT_LINK_DIRECTORIES_LOWER)
get_filename_component(dir "${library_path}" DIRECTORY)
string(TOLOWER "${dir}" dir_lower)
# If library_path isn't in default link directories, we should add it to link flags.
list(FIND IMPLICIT_LINK_DIRECTORIES_LOWER "${dir_lower}" index)
if(${index} EQUAL -1)
list(APPEND out_list "-L\"${dir}\"")
if(dir)
string(TOLOWER "${dir}" dir_lower)
# If library_path isn't in default link directories, we should add it to link flags.
# But we shouldn't add it duplicately.
list(FIND IMPLICIT_LINK_DIRECTORIES_LOWER "${dir_lower}" index)
if(index EQUAL -1 AND NOT "-L\"${dir}\"" IN_LIST out_list)
list(APPEND out_list "-L\"${dir}\"")
endif()
endif()
list(APPEND out_list "${lib_name_with_link_flag}")
else()

View File

@ -46,13 +46,11 @@ function(qt_internal_set_warnings_are_errors_flags target target_scope)
endif()
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "11.0.0")
# Ditto
list(APPEND flags -Wno-error=stringop-overread)
# We do mixed enum arithmetic all over the place:
list(APPEND flags -Wno-error=deprecated-enum-enum-conversion -Wno-error=deprecated-enum-float-conversion)
# GCC has some false positive, and it specifically comes through in MINGW
if (MINGW)
list(APPEND flags -Wno-error=stringop-overread)
endif()
endif()
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "11.0.0" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "11.2.0")
@ -135,29 +133,25 @@ function(qt_internal_add_global_definition definition)
endif()
endfunction()
add_library(PlatformCommonInternal INTERFACE)
qt_internal_add_target_aliases(PlatformCommonInternal)
qt_internal_add_platform_internal_target(PlatformCommonInternal)
target_link_libraries(PlatformCommonInternal INTERFACE Platform)
add_library(PlatformModuleInternal INTERFACE)
qt_internal_add_target_aliases(PlatformModuleInternal)
qt_internal_add_platform_internal_target(PlatformModuleInternal)
target_link_libraries(PlatformModuleInternal INTERFACE PlatformCommonInternal)
add_library(PlatformPluginInternal INTERFACE)
qt_internal_add_target_aliases(PlatformPluginInternal)
qt_internal_add_platform_internal_target(PlatformPluginInternal)
target_link_libraries(PlatformPluginInternal INTERFACE PlatformCommonInternal)
add_library(PlatformAppInternal INTERFACE)
qt_internal_add_target_aliases(PlatformAppInternal)
qt_internal_add_platform_internal_target(PlatformAppInternal)
target_link_libraries(PlatformAppInternal INTERFACE PlatformCommonInternal)
add_library(PlatformToolInternal INTERFACE)
qt_internal_add_target_aliases(PlatformToolInternal)
qt_internal_add_platform_internal_target(PlatformToolInternal)
target_link_libraries(PlatformToolInternal INTERFACE PlatformAppInternal)
qt_internal_add_global_definition(QT_NO_JAVA_STYLE_ITERATORS)
qt_internal_add_global_definition(QT_NO_QASCONST)
qt_internal_add_global_definition(QT_NO_QEXCHANGE)
qt_internal_add_global_definition(QT_NO_QSNPRINTF)
qt_internal_add_global_definition(QT_NO_NARROWING_CONVERSIONS_IN_CONNECT)
qt_internal_add_global_definition(QT_EXPLICIT_QFILE_CONSTRUCTION_FROM_PATH)
qt_internal_add_global_definition(QT_USE_QSTRINGBUILDER SCOPE PLUGIN TOOL MODULE)
@ -318,13 +312,8 @@ if (GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "9.2")
endif()
# Hardening options
if(QT_FEATURE_intelcet)
if(MSVC)
qt_internal_platform_link_options(PlatformCommonInternal INTERFACE -CETCOMPAT)
else()
target_compile_options(PlatformCommonInternal INTERFACE -fcf-protection=full)
endif()
endif()
qt_internal_apply_intel_cet_harderning(PlatformCommonInternal)
if(QT_FEATURE_glibc_fortify_source)
set(is_optimized_build "$<OR:$<NOT:$<CONFIG:Debug>>,$<BOOL:${QT_FEATURE_optimize_debug}>>")

View File

@ -33,11 +33,13 @@ macro(qt_internal_setup_platform_definitions_and_mkspec)
set(QT_DEFAULT_MKSPEC win32-clang-g++)
endif()
elseif(MSVC)
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64")
string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" cmake_system_processor_case_independent)
if(cmake_system_processor_case_independent STREQUAL "arm64")
set(QT_DEFAULT_MKSPEC win32-arm64-msvc)
else()
set(QT_DEFAULT_MKSPEC win32-msvc)
endif()
unset(cmake_system_processor_case_independent)
elseif(MINGW)
set(QT_DEFAULT_MKSPEC win32-g++)
list(APPEND QT_DEFAULT_PLATFORM_DEFINITIONS MINGW_HAS_SECURE_API=1)

View File

@ -58,7 +58,16 @@ if (NOT QT_NO_CREATE_TARGETS AND @INSTALL_CMAKE_NAMESPACE@@target@_FOUND)
if(NOT @QT_CMAKE_EXPORT_NAMESPACE@@target@_DEFINITIONS)
set(@QT_CMAKE_EXPORT_NAMESPACE@@target@_DEFINITIONS "")
else()
list(TRANSFORM @QT_CMAKE_EXPORT_NAMESPACE@@target@_DEFINITIONS PREPEND "-D")
set(updated_defs "")
foreach(def IN LISTS @QT_CMAKE_EXPORT_NAMESPACE@@target@_DEFINITIONS)
if(def MATCHES "^[A-Za-z_]")
list(APPEND updated_defs "-D${def}")
else()
list(APPEND updated_defs "${def}")
endif()
endforeach()
set(@QT_CMAKE_EXPORT_NAMESPACE@@target@_DEFINITIONS "${updated_defs}")
unset(updated_defs)
endif()
get_target_property(@QT_CMAKE_EXPORT_NAMESPACE@@target@_COMPILE_DEFINITIONS

View File

@ -16,9 +16,9 @@ macro(qt_internal_get_internal_add_module_keywords option_args single_args multi
NO_ADDITIONAL_TARGET_INFO
NO_GENERATE_METATYPES
NO_HEADERSCLEAN_CHECK
GENERATE_CPP_EXPORTS # deprecated
NO_GENERATE_CPP_EXPORTS
NO_UNITY_BUILD
${__qt_internal_sbom_optional_args}
)
set(${single_args}
MODULE_INCLUDE_NAME
@ -34,6 +34,7 @@ macro(qt_internal_get_internal_add_module_keywords option_args single_args multi
SSG_HEADER_FILTERS
HEADER_SYNC_SOURCE_DIRECTORY
${__default_target_info_args}
${__qt_internal_sbom_single_args}
)
set(${multi_args}
QMAKE_MODULE_CONFIG
@ -44,6 +45,7 @@ macro(qt_internal_get_internal_add_module_keywords option_args single_args multi
${__default_private_args}
${__default_public_args}
${__default_private_module_args}
${__qt_internal_sbom_multi_args}
)
endmacro()
@ -236,6 +238,10 @@ function(qt_internal_add_module target)
set_target_properties(${target} PROPERTIES _qt_is_internal_module TRUE)
set_property(TARGET ${target} APPEND PROPERTY EXPORT_PROPERTIES _qt_is_internal_module)
endif()
if(arg_HEADER_MODULE)
set_target_properties(${target} PROPERTIES _qt_is_header_module TRUE)
set_property(TARGET ${target} APPEND PROPERTY EXPORT_PROPERTIES _qt_is_header_module)
endif()
if(NOT arg_CONFIG_MODULE_NAME)
set(arg_CONFIG_MODULE_NAME "${module_lower}")
@ -306,7 +312,6 @@ function(qt_internal_add_module target)
qt_internal_add_target_aliases("${target}")
qt_skip_warnings_are_errors_when_repo_unclean("${target}")
_qt_internal_apply_strict_cpp("${target}")
# No need to compile Q_IMPORT_PLUGIN-containing files for non-executables.
if(is_static_lib)
@ -423,8 +428,7 @@ function(qt_internal_add_module target)
# We should not generate export headers if module is defined as pure STATIC.
# Static libraries don't need to export their symbols, and corner cases when sources are
# also used in shared libraries, should be handled manually.
if((NOT arg_NO_GENERATE_CPP_EXPORTS OR arg_GENERATE_CPP_EXPORTS) AND NOT arg_STATIC
AND NOT arg_HEADER_MODULE)
if(NOT arg_NO_GENERATE_CPP_EXPORTS AND NOT arg_STATIC AND NOT arg_HEADER_MODULE)
if(arg_CPP_EXPORT_HEADER_BASE_NAME)
set(cpp_export_header_base_name
"CPP_EXPORT_HEADER_BASE_NAME;${arg_CPP_EXPORT_HEADER_BASE_NAME}"
@ -440,7 +444,7 @@ function(qt_internal_add_module target)
set_source_files_properties("${module_depends_header}" PROPERTIES GENERATED TRUE)
set_target_properties(${target} PROPERTIES _qt_module_depends_header
"${module_depends_header}")
if(NOT ${arg_HEADER_MODULE})
if(NOT arg_HEADER_MODULE)
set(module_header "${module_build_interface_include_dir}/${module_include_name}")
set_property(TARGET "${target}" PROPERTY MODULE_HEADER
"${module_header}")
@ -911,6 +915,60 @@ set(QT_ALLOW_MISSING_TOOLS_PACKAGES TRUE)")
endif()
qt_describe_module(${target})
if(QT_GENERATE_SBOM)
set(sbom_args "")
# 3rd party header modules should not be treated as Qt modules.
if(arg_IS_QT_3RD_PARTY_HEADER_MODULE)
list(APPEND sbom_args TYPE QT_THIRD_PARTY_MODULE)
else()
list(APPEND sbom_args TYPE QT_MODULE)
endif()
qt_get_cmake_configurations(configs)
foreach(config IN LISTS configs)
_qt_internal_sbom_append_multi_config_aware_single_arg_option(
RUNTIME_PATH
"${INSTALL_BINDIR}"
"${config}"
sbom_args
)
_qt_internal_sbom_append_multi_config_aware_single_arg_option(
LIBRARY_PATH
"${INSTALL_LIBDIR}"
"${config}"
sbom_args
)
_qt_internal_sbom_append_multi_config_aware_single_arg_option(
ARCHIVE_PATH
"${INSTALL_LIBDIR}"
"${config}"
sbom_args
)
_qt_internal_sbom_append_multi_config_aware_single_arg_option(
FRAMEWORK_PATH
"${INSTALL_LIBDIR}/${fw_versioned_binary_dir}"
"${config}"
sbom_args
)
endforeach()
_qt_internal_forward_function_args(
FORWARD_APPEND
FORWARD_PREFIX arg
FORWARD_OUT_VAR sbom_args
FORWARD_OPTIONS
${__qt_internal_sbom_optional_args}
FORWARD_SINGLE
${__qt_internal_sbom_single_args}
FORWARD_MULTI
${__qt_internal_sbom_multi_args}
)
_qt_internal_extend_sbom(${target} ${sbom_args})
endif()
qt_add_list_file_finalizer(qt_finalize_module ${target} ${arg_INTERNAL_MODULE} ${arg_NO_PRIVATE_MODULE})
endfunction()
@ -960,6 +1018,7 @@ function(qt_finalize_module target)
qt_generate_module_pri_file("${target}" ${ARGN})
qt_internal_generate_pkg_config_file(${target})
qt_internal_apply_apple_privacy_manifest(${target})
_qt_internal_finalize_sbom(${target})
endfunction()
# Get a set of Qt module related values based on the target.

View File

@ -10,9 +10,7 @@ function(qt_internal_setup_public_platform_target)
)
## QtPlatform Target:
add_library(Platform INTERFACE)
add_library(Qt::Platform ALIAS Platform)
add_library(${INSTALL_CMAKE_NAMESPACE}::Platform ALIAS Platform)
qt_internal_add_platform_target(Platform)
target_include_directories(Platform
INTERFACE
$<BUILD_INTERFACE:${build_interface_definition_dir}>
@ -49,15 +47,6 @@ function(qt_internal_setup_public_platform_target)
target_compile_options(Platform INTERFACE "$<$<CXX_COMPILER_ID:Clang>:-fno-direct-access-external-data>")
endif()
# Qt checks if a given platform supports 128 bit integers
# by checking if __SIZEOF_128__ is defined
# VXWORKS doesn't support 128 bit integers
# but it uses clang which defines __SIZEOF_128__
# which breaks the detection mechanism
if(VXWORKS)
target_compile_definitions(Platform INTERFACE "-DQT_NO_INT128")
endif()
qt_set_msvc_cplusplus_options(Platform INTERFACE)
# Propagate minimum C++ 17 via Platform to Qt consumers (apps), after the global features
@ -72,6 +61,11 @@ function(qt_internal_setup_public_platform_target)
# Generate a pkgconfig for Qt::Platform.
qt_internal_generate_pkg_config_file(Platform)
qt_internal_add_sbom(Platform
TYPE QT_MODULE
IMMEDIATE_FINALIZATION
)
endfunction()
function(qt_internal_get_platform_definition_include_dir install_interface build_interface)

View File

@ -9,16 +9,19 @@ macro(qt_internal_get_internal_add_plugin_keywords option_args single_args multi
ALLOW_UNDEFINED_SYMBOLS
SKIP_INSTALL
NO_UNITY_BUILD
${__qt_internal_sbom_optional_args}
)
set(${single_args}
OUTPUT_DIRECTORY
INSTALL_DIRECTORY
ARCHIVE_INSTALL_DIRECTORY
${__default_target_info_args}
${__qt_internal_sbom_single_args}
)
set(${multi_args}
${__default_private_args}
${__default_public_args}
${__qt_internal_sbom_multi_args}
DEFAULT_IF
)
endmacro()
@ -157,7 +160,6 @@ function(qt_internal_add_plugin target)
qt_set_common_target_properties("${target}")
qt_internal_add_target_aliases("${target}")
qt_skip_warnings_are_errors_when_repo_unclean("${target}")
_qt_internal_apply_strict_cpp("${target}")
set_target_properties("${target}" PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${output_directory}"
@ -414,6 +416,36 @@ function(qt_internal_add_plugin target)
if(NOT arg_SKIP_INSTALL)
list(APPEND finalizer_extra_args INSTALL_PATH "${install_directory}")
endif()
if(QT_GENERATE_SBOM)
set(sbom_args "")
list(APPEND sbom_args TYPE QT_PLUGIN)
qt_get_cmake_configurations(configs)
foreach(config IN LISTS configs)
_qt_internal_sbom_append_multi_config_aware_single_arg_option(
INSTALL_PATH
"${install_directory}"
"${config}"
sbom_args
)
endforeach()
_qt_internal_forward_function_args(
FORWARD_APPEND
FORWARD_PREFIX arg
FORWARD_OUT_VAR sbom_args
FORWARD_OPTIONS
${__qt_internal_sbom_optional_args}
FORWARD_SINGLE
${__qt_internal_sbom_single_args}
FORWARD_MULTI
${__qt_internal_sbom_multi_args}
)
_qt_internal_extend_sbom(${target} ${sbom_args})
endif()
qt_add_list_file_finalizer(qt_finalize_plugin ${target} ${finalizer_extra_args})
if(NOT arg_SKIP_INSTALL)
@ -442,6 +474,8 @@ function(qt_finalize_plugin target)
qt_generate_plugin_pri_file("${target}")
endif()
endif()
_qt_internal_finalize_sbom(${target})
endfunction()
function(qt_get_sanitized_plugin_type plugin_type out_var)

View File

@ -105,9 +105,6 @@ function(qt_internal_collect_third_party_dep_packages_info
get_cmake_property(provided_targets _qt_find_package_${package_key}_provided_targets)
if(provided_targets)
set(key "__qt_${target}_third_party_package_${package_key}_provided_targets")
# Escape the semicolon, so it is preserved in the list(JOIN) below
string(REPLACE ";" "\;" provided_targets "${provided_targets}")
string(APPEND packages_info "set(${key} \"${provided_targets}\")\n")
endif()
endforeach()
@ -403,10 +400,22 @@ function(qt_internal_create_qt6_dependencies_file)
unset(depends)
unset(optional_public_depends)
set(third_party_deps "")
set(third_party_deps_seen "")
set(third_party_deps_package_components_ids "")
# We need to collect third party deps that are set on the public Platform target,
# like Threads::Threads.
# This mimics find_package part of the CONFIG += thread assignment in mkspecs/features/qt.prf.
qt_collect_third_party_deps(${actual_target})
qt_internal_collect_third_party_dep_packages_info("${INSTALL_CMAKE_NAMESPACE}"
"${third_party_deps_package_components_ids}"
packages_info)
set(third_party_deps_extra_info "")
if(packages_info)
string(APPEND third_party_deps_extra_info "${packages_info}")
endif()
# For Threads we also need to write an extra variable assignment.
set(third_party_extra "")
@ -574,7 +583,7 @@ function(qt_generate_install_prefixes out_var)
set(vars INSTALL_BINDIR INSTALL_INCLUDEDIR INSTALL_LIBDIR INSTALL_MKSPECSDIR INSTALL_ARCHDATADIR
INSTALL_PLUGINSDIR INSTALL_LIBEXECDIR INSTALL_QMLDIR INSTALL_DATADIR INSTALL_DOCDIR
INSTALL_TRANSLATIONSDIR INSTALL_SYSCONFDIR INSTALL_EXAMPLESDIR INSTALL_TESTSDIR
INSTALL_DESCRIPTIONSDIR)
INSTALL_DESCRIPTIONSDIR INSTALL_SBOMDIR)
foreach(var ${vars})
get_property(docstring CACHE "${var}" PROPERTY HELPSTRING)

View File

@ -35,12 +35,13 @@ function(qt_generate_qmake_libraries_pri_content module_name output_root_dir out
endif()
list(APPEND seen_targets ${lib_target})
get_target_property(lib_target_type ${lib_target} TYPE)
if(lib_target_type STREQUAL "INTERFACE_LIBRARY")
if(lib_target_type MATCHES "^(INTERFACE|UNKNOWN)_LIBRARY")
get_target_property(iface_libs ${lib_target} INTERFACE_LINK_LIBRARIES)
if(iface_libs)
list(PREPEND lib_targets ${iface_libs})
endif()
else()
endif()
if(NOT lib_target_type STREQUAL "INTERFACE_LIBRARY")
list(APPEND lib_libs "$<TARGET_LINKER_FILE:${lib_target}>")
endif()
list(APPEND lib_libdir "$<TARGET_PROPERTY:${lib_target},INTERFACE_LINK_DIRECTORIES>")
@ -57,7 +58,7 @@ function(qt_generate_qmake_libraries_pri_content module_name output_root_dir out
list(APPEND lib_defines "$<TARGET_PROPERTY:${lib_target},INTERFACE_COMPILE_DEFINITIONS>")
else()
if(lib_target MATCHES "/([^/]+).framework$")
list(APPEND lib_libs "-framework" "${CMAKE_MATCH_1}")
list(APPEND lib_libs "-framework ${CMAKE_MATCH_1}")
else()
list(APPEND lib_libs "${lib_target}")
endif()

View File

@ -150,6 +150,8 @@ while(NOT "${configure_args}" STREQUAL "")
elseif(arg STREQUAL "-no-prefix")
set(no_prefix_option TRUE)
push("-DFEATURE_no_prefix=ON")
elseif(arg STREQUAL "-sbom")
push("-DQT_GENERATE_SBOM=ON")
elseif(arg STREQUAL "-cmake-file-api")
set(cmake_file_api TRUE)
elseif(arg STREQUAL "-no-cmake-file-api")
@ -165,7 +167,7 @@ while(NOT "${configure_args}" STREQUAL "")
list(APPEND cmake_args "${configure_args}")
break()
else()
set_property(GLOBAL APPEND PROPERTY UNHANDLED_ARGS "${arg}")
set_property(GLOBAL APPEND PROPERTY UNHANDLED_ARGS "${raw_arg}")
endif()
endwhile()
@ -261,6 +263,11 @@ defstub(set_package_properties)
defstub(qt_qml_find_python)
defstub(qt_set01)
defstub(qt_internal_check_if_linker_is_available)
defstub(qt_internal_add_sbom)
defstub(qt_internal_extend_sbom)
defstub(qt_internal_sbom_add_license)
defstub(qt_internal_extend_sbom_dependencies)
defstub(qt_find_package_extend_sbom)
####################################################################################################
# Define functions/macros that are called in qt_cmdline.cmake files
@ -934,6 +941,7 @@ endforeach()
translate_path_input(headerdir INSTALL_INCLUDEDIR)
translate_path_input(plugindir INSTALL_PLUGINSDIR)
translate_path_input(translationdir INSTALL_TRANSLATIONSDIR)
translate_path_input(sbomdir INSTALL_SBOMDIR)
if(NOT "${INPUT_device}" STREQUAL "")
push("-DQT_QMAKE_TARGET_MKSPEC=devices/${INPUT_device}")

View File

@ -63,15 +63,6 @@ define_property(TARGET
for instance, which QPA should be linked."
)
define_property(GLOBAL
PROPERTY
QT_KNOWN_PLUGINS
BRIEF_DOCS
""
FULL_DOCS
""
)
define_property(TARGET
PROPERTY
QT_QML_MODULE_TARGET_PATH

View File

@ -499,6 +499,55 @@ function(_qt_internal_set_xcode_install_path target)
endif()
endfunction()
# Explicitly set the debug information format for each build configuration to match the values
# of a new project created via Xcode directly. This ensures debug information is included during
# archiving.
function(_qt_internal_set_xcode_debug_information_format target)
if(NOT DEFINED CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT
AND NOT QT_NO_SET_XCODE_DEBUG_INFORMATION_FORMAT)
get_target_property(existing "${target}" XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT)
if(NOT existing)
# The CMake Xcode generator searches for [variant=${config}], removes that substring,
# and generates the attribute only for the config that is specified as the "variant".
set_target_properties("${target}" PROPERTIES
"XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT[variant=Debug]" "dwarf")
set_target_properties("${target}" PROPERTIES
"XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT[variant=Release]" "dwarf-with-dsym")
set_target_properties("${target}" PROPERTIES
"XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT[variant=MinSizeRel]" "dwarf-with-dsym")
set_target_properties("${target}" PROPERTIES
"XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT[variant=RelWithDebInfo]"
"dwarf-with-dsym")
endif()
endif()
endfunction()
# Make sure to always generate debug symbols, to match the values of a new project created via
# Xcode directly.
function(_qt_internal_set_xcode_generate_debugging_symbols target)
if(NOT DEFINED CMAKE_XCODE_ATTRIBUTE_GCC_GENERATE_DEBUGGING_SYMBOLS
AND NOT QT_NO_SET_XCODE_GCC_GENERATE_DEBUGGING_SYMBOLS)
get_target_property(existing "${target}" XCODE_ATTRIBUTE_GCC_GENERATE_DEBUGGING_SYMBOLS)
if(NOT existing)
set_target_properties("${target}" PROPERTIES
"XCODE_ATTRIBUTE_GCC_GENERATE_DEBUGGING_SYMBOLS" "YES")
endif()
endif()
endfunction()
# CMake generates a project where this setting is set to an absolute path build dir.
# Provide an opt-in to work around an Xcode issue where archiving does not find the project dSYMs
# unless the configuration build dir starts with $(BUILD_DIR) or is set to $(inherited).
# It is an opt-in, because it breaks certain CMake behavior like $<TARGET_FILE:${target}> genex
# evaluation as well as ignoring the value of CMAKE_RUNTIME_OUTPUT_DIRECTORY.
# So projects have to do it at their own risk.
function(_qt_internal_set_xcode_configuration_build_dir target)
if(QT_USE_RISKY_DSYM_ARCHIVING_WORKAROUND)
set_target_properties("${target}" PROPERTIES
XCODE_ATTRIBUTE_CONFIGURATION_BUILD_DIR "$(inherited)")
endif()
endfunction()
function(_qt_internal_set_xcode_bundle_display_name target)
# We want the value of CFBundleDisplayName to be ${PRODUCT_NAME}, but we can't put that
# into the Info.plist.in template file directly, because the implicit configure_file(Info.plist)
@ -628,19 +677,31 @@ function(_qt_internal_set_apple_localizations target)
COMMANDS "print CFBundleLocalizations"
OUTPUT_VARIABLE existing_localizations
)
if(existing_localizations)
return()
if(NOT existing_localizations)
list(TRANSFORM supported_languages PREPEND
"Add CFBundleLocalizations: string ")
_qt_internal_plist_buddy("${plist_file}"
COMMANDS
"Add CFBundleLocalizations array"
${supported_languages}
"Delete CFBundleAllowMixedLocalizations"
)
endif()
list(TRANSFORM supported_languages PREPEND
"Add CFBundleLocalizations: string ")
_qt_internal_plist_buddy("${plist_file}"
COMMANDS
"Add CFBundleLocalizations array"
${supported_languages}
"Delete CFBundleAllowMixedLocalizations"
)
if(NOT "${QT_I18N_SOURCE_LANGUAGE}" STREQUAL "")
_qt_internal_plist_buddy("${plist_file}"
COMMANDS "print CFBundleDevelopmentRegion"
OUTPUT_VARIABLE existing_dev_region
)
if(NOT existing_dev_region)
_qt_internal_plist_buddy("${plist_file}"
COMMANDS
"Add CFBundleDevelopmentRegion string"
"Set CFBundleDevelopmentRegion ${QT_I18N_SOURCE_LANGUAGE}"
)
endif()
endif()
endfunction()
function(_qt_internal_set_ios_simulator_arch target)
@ -910,6 +971,9 @@ function(_qt_internal_finalize_apple_app target)
_qt_internal_set_xcode_code_sign_style("${target}")
_qt_internal_set_xcode_bundle_display_name("${target}")
_qt_internal_set_xcode_install_path("${target}")
_qt_internal_set_xcode_configuration_build_dir("${target}")
_qt_internal_set_xcode_debug_information_format("${target}")
_qt_internal_set_xcode_generate_debugging_symbols("${target}")
endif()
_qt_internal_set_xcode_bundle_name("${target}")

View File

@ -387,6 +387,10 @@ endfunction()
# It assigns the known properties from the versioned targets to the versionless created in this
# function. This allows versionless targets mimic the versioned.
function(_qt_internal_create_versionless_targets targets install_namespace)
set(known_imported_properties
IMPORTED_LINK_DEPENDENT_LIBRARIES
)
set(known_interface_properties
QT_MAJOR_VERSION
AUTOMOC_MACRO_NAMES
@ -434,6 +438,10 @@ function(_qt_internal_create_versionless_targets targets install_namespace)
_qt_package_name
_qt_package_version
_qt_private_module_target_name
_qt_sbom_spdx_id
_qt_sbom_spdx_repo_document_namespace
_qt_sbom_spdx_relative_installed_repo_document_path
_qt_sbom_spdx_repo_project_name_lowercase
)
set(supported_target_types STATIC_LIBRARY MODULE_LIBRARY SHARED_LIBRARY OBJECT_LIBRARY
@ -475,6 +483,15 @@ function(_qt_internal_create_versionless_targets targets install_namespace)
endif()
set_property(TARGET Qt::${target} PROPERTY
IMPORTED_LOCATION${config} "${target_imported_location}")
foreach(property IN LISTS known_imported_properties)
get_target_property(exported_property_value
${install_namespace}::${target} ${property}${config})
if(exported_property_value)
set_property(TARGET Qt::${target} APPEND PROPERTY
${property} "${exported_property_value}")
endif()
endforeach()
endforeach()
foreach(property IN LISTS known_qt_exported_properties)
@ -641,13 +658,13 @@ function(_qt_internal_forward_function_args)
endforeach()
foreach(option_name IN LISTS arg_FORWARD_SINGLE)
if(${arg_FORWARD_PREFIX}_${option_name})
if(NOT "${${arg_FORWARD_PREFIX}_${option_name}}" STREQUAL "")
list(APPEND forward_args "${option_name}" "${${arg_FORWARD_PREFIX}_${option_name}}")
endif()
endforeach()
foreach(option_name IN LISTS arg_FORWARD_MULTI)
if(${arg_FORWARD_PREFIX}_${option_name})
if(NOT "${${arg_FORWARD_PREFIX}_${option_name}}" STREQUAL "")
list(APPEND forward_args "${option_name}" ${${arg_FORWARD_PREFIX}_${option_name}})
endif()
endforeach()

View File

@ -70,3 +70,22 @@ function(__qt_internal_require_suitable_cmake_version_for_using_qt)
"Use at your own risk.")
endif()
endfunction()
function(__qt_internal_set_cmp0156)
if(POLICY CMP0156)
if(QT_FORCE_CMP0156_TO_NEW)
cmake_policy(SET CMP0156 "NEW")
else()
cmake_policy(GET CMP0156 policy_value)
if(NOT "${policy_value}" STREQUAL "OLD")
if("${policy_value}" STREQUAL "NEW" AND NOT QT_BUILDING_QT)
message(WARNING "CMP0156 is set to '${policy_value}'. Qt forces the 'OLD'"
" behavior of this policy by default. Set QT_FORCE_CMP0156_TO_NEW=ON to"
" force the 'NEW' behavior for the Qt commands that create either"
" library or executable targets.")
endif()
cmake_policy(SET CMP0156 "OLD")
endif()
endif()
endif()
endfunction()

View File

@ -35,6 +35,38 @@ macro(_qt_internal_find_third_party_dependencies target target_dep_list)
else()
find_dependency(${__qt_${target}_find_package_args})
endif()
_qt_internal_get_package_components_id(
PACKAGE_NAME "${__qt_${target}_pkg}"
COMPONENTS ${__qt_${target}_components}
OPTIONAL_COMPONENTS ${__qt_${target}_optional_components}
OUT_VAR_KEY __qt_${target}_package_components_id
)
if(${__qt_${target}_pkg}_FOUND
AND __qt_${target}_third_party_package_${__qt_${target}_package_components_id}_provided_targets)
set(__qt_${target}_sbom_args "")
if(${__qt_${target}_pkg}_VERSION)
list(APPEND __qt_${target}_sbom_args
PACKAGE_VERSION "${${__qt_${target}_pkg}_VERSION}"
)
endif()
foreach(__qt_${target}_provided_target
IN LISTS
__qt_${target}_third_party_package_${__qt_${target}_package_components_id}_provided_targets)
_qt_internal_promote_3rd_party_provided_target_and_3rd_party_deps_to_global(
"${__qt_${target}_provided_target}")
_qt_internal_sbom_record_system_library_usage(
"${__qt_${target}_provided_target}"
TYPE SYSTEM_LIBRARY
FRIENDLY_PACKAGE_NAME "${__qt_${target}_pkg}"
${__qt_${target}_sbom_args}
)
endforeach()
endif()
endforeach()
endmacro()
@ -233,6 +265,8 @@ macro(_qt_internal_setup_qt_host_path
# Requiredness can be overridden via variable.
if(DEFINED QT_REQUIRE_HOST_PATH_CHECK)
set(_qt_platform_host_path_required "${QT_REQUIRE_HOST_PATH_CHECK}")
elseif(DEFINED ENV{QT_REQUIRE_HOST_PATH_CHECK})
set(_qt_platform_host_path_required "$ENV{QT_REQUIRE_HOST_PATH_CHECK}")
else()
set(_qt_platform_host_path_required "${host_path_required}")
endif()

View File

@ -0,0 +1,153 @@
# Copyright (C) 2024 The Qt Company Ltd.
# Copyright (C) 2023-2024 Jochem Rutgers
# SPDX-License-Identifier: BSD-3-Clause AND MIT
macro(_qt_internal_find_git_package)
find_package(Git)
endmacro()
# Helper to set the various git version variables in the parent scope across multiple return points.
macro(_qt_internal_set_git_query_variables)
set("${arg_OUT_VAR_PREFIX}git_hash" "${version_git_hash}" PARENT_SCOPE)
set("${arg_OUT_VAR_PREFIX}git_hash_short" "${version_git_head}" PARENT_SCOPE)
set("${arg_OUT_VAR_PREFIX}git_version" "${git_version}" PARENT_SCOPE)
# git version sanitized for file paths.
string(REGEX REPLACE "[^-a-zA-Z0-9_.]+" "+" git_version_path "${git_version}")
set("${arg_OUT_VAR_PREFIX}git_version_path" "${git_version_path}" PARENT_SCOPE)
endmacro()
# Caches the results per working-directory in global cmake properties.
# Sets the following variables in the outer scope:
# - git_hash: Full git hash.
# - git_hash_short: Short git hash.
# - git_version: Git version string.
# - git_version_path: Git version string sanitized for file paths.
function(_qt_internal_query_git_version)
set(opt_args
EMPTY_VALUE_WHEN_NOT_GIT_REPO
)
set(single_args
WORKING_DIRECTORY
OUT_VAR_PREFIX
)
set(multi_args "")
cmake_parse_arguments(PARSE_ARGV 0 arg "${opt_args}" "${single_args}" "${multi_args}")
_qt_internal_validate_all_args_are_parsed(arg)
if(arg_EMPTY_VALUE_WHEN_NOT_GIT_REPO)
set(version_git_head "")
set(version_git_hash "")
set(version_git_branch "")
set(version_git_tag "")
set(git_version "")
else()
set(version_git_head "unknown")
set(version_git_hash "")
set(version_git_branch "dev")
set(version_git_tag "")
set(git_version "${version_git_head}+${version_git_branch}")
endif()
if(NOT Git_FOUND)
message(STATUS "Git not found, skipping querying git version.")
_qt_internal_set_git_query_variables()
return()
endif()
if(arg_WORKING_DIRECTORY)
set(working_directory "${arg_WORKING_DIRECTORY}")
else()
set(working_directory "${PROJECT_SOURCE_DIR}")
endif()
execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse --is-inside-work-tree
WORKING_DIRECTORY "${working_directory}"
OUTPUT_VARIABLE is_inside_work_tree_output
RESULT_VARIABLE is_inside_work_tree_result
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE
)
if((NOT is_inside_work_tree_result EQUAL 0) OR (NOT is_inside_work_tree_output STREQUAL "true"))
message(STATUS "Git repo not found, skipping querying git version.")
_qt_internal_set_git_query_variables()
return()
endif()
get_cmake_property(git_hash_cache _qt_git_hash_cache_${working_directory})
get_cmake_property(git_hash_short_cache _qt_git_hash_short_cache_${working_directory})
get_cmake_property(git_version_cache _qt_git_version_cache_${working_directory})
get_cmake_property(git_version_path_cache _qt_git_version_path_cache_${working_directory})
if(git_hash_cache)
set(git_hash "${git_hash_cache}")
set(git_hash_short "${git_hash_short_cache}")
set(git_version "${git_version_cache}")
set(git_version_path "${git_version_path_cache}")
_qt_internal_set_git_query_variables()
return()
endif()
execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
WORKING_DIRECTORY "${working_directory}"
OUTPUT_VARIABLE version_git_head
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE
)
execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse HEAD
WORKING_DIRECTORY "${working_directory}"
OUTPUT_VARIABLE version_git_hash
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE
)
execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
WORKING_DIRECTORY "${working_directory}"
OUTPUT_VARIABLE version_git_branch
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE
)
execute_process(
COMMAND ${GIT_EXECUTABLE} tag --points-at HEAD
WORKING_DIRECTORY "${working_directory}"
OUTPUT_VARIABLE version_git_tag
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE
)
string(REGEX REPLACE "[ \t\r\n].*$" "" version_git_tag "${version_git_tag}")
execute_process(
COMMAND ${GIT_EXECUTABLE} status -s
WORKING_DIRECTORY "${working_directory}"
OUTPUT_VARIABLE version_git_dirty
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(NOT "${version_git_dirty}" STREQUAL "")
set(version_git_dirty "+dirty")
endif()
if(NOT "${version_git_tag}" STREQUAL "")
set(git_version "${version_git_tag}")
if("${git_version}" MATCHES "^v[0-9]+\.")
string(REGEX REPLACE "^v" "" git_version "${git_version}")
endif()
set(git_version "${git_version}${version_git_dirty}")
else()
set(git_version
"${version_git_head}+${version_git_branch}${version_git_dirty}"
)
endif()
set_property(GLOBAL PROPERTY _qt_git_hash_cache_${working_directory} "${git_hash}")
set_property(GLOBAL PROPERTY _qt_git_hash_short_cache_${working_directory} "${git_hash_short}")
set_property(GLOBAL PROPERTY _qt_git_version_cache_${working_directory} "${git_version}")
set_property(GLOBAL PROPERTY _qt_git_version_path_cache_${working_directory}
"${git_version_path}")
_qt_internal_set_git_query_variables()
endfunction()

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -253,6 +253,53 @@ function(__qt_internal_collect_object_libraries_recursively out_var target initi
set(${out_var} "${object_libraries}" PARENT_SCOPE)
endfunction()
# Sets out_var to to TRUE if the target was marked to not be promoted to global scope.
function(_qt_internal_should_not_promote_package_target_to_global target out_var)
get_property(should_not_promote TARGET "${target}" PROPERTY _qt_no_promote_global)
set("${out_var}" "${should_not_promote}" PARENT_SCOPE)
endfunction()
# This function recursively walks transitive link libraries of the given target
# and promotes encountered 3rd party targets to be IMPORTED_GLOBAL if they are not.
#
# This is required for .prl file generation in top-level builds, to make sure that imported 3rd
# party library targets in any repo are made global, so there are no scoping issues.
#
# The promotion needs to happen in the same directory scope where the imported target is
# first created.
#
# Uses __qt_internal_walk_libs.
function(_qt_internal_promote_3rd_party_link_targets_to_global target)
__qt_internal_walk_libs("${target}" _discarded_out_var _discarded_out_var_2
"qt_find_package_targets_dict" "promote_3rd_party_global")
endfunction()
# Check if a target is an internal target (one added by qt_internal_* API, executables, libraries,
# etc).
function(_qt_internal_is_internal_target target out_var)
get_target_property(is_internal ${target} _qt_is_internal_target)
if(is_internal)
set(value TRUE)
else()
set(value FALSE)
endif()
set(${out_var} "${value}" PARENT_SCOPE)
endfunction()
# Check if a target should never be promoted to global.
# Some targets like the Platform target is public, and can't have _qt_is_internal_target set.
# But we still want to avoid promoting it to global. Setting this property achieves that.
function(_qt_internal_should_skip_3rd_party_global_promotion target out_var)
get_target_property(should_skip ${target} _qt_should_skip_3rd_party_global_promotion)
if(should_skip)
set(value TRUE)
else()
set(value FALSE)
endif()
set(${out_var} "${value}" PARENT_SCOPE)
endfunction()
# Tries to promote any non-global imported target to global scope.
function(__qt_internal_promote_target_to_global target)
get_property(is_global TARGET ${target} PROPERTY IMPORTED_GLOBAL)
if(NOT is_global)
@ -261,6 +308,48 @@ function(__qt_internal_promote_target_to_global target)
endif()
endfunction()
# Promotes a 3rd party provided target to global, which was found by qt_find_package or
# _qt_internal_find_third_party_dependencies.
# Only does it when building Qt, but not when building user projects.
function(_qt_internal_promote_3rd_party_provided_target_and_3rd_party_deps_to_global target)
# Return early if building a user project, and not Qt.
# QT_BUILDING_QT is set when building a qt repo, but we also check for QT_REPO_MODULE_VERSION,
# which is set in .cmake.conf, because _qt_internal_find_third_party_dependencies is called
# before QT_BUILDING_QT is set.
if(NOT (QT_BUILDING_QT OR QT_REPO_MODULE_VERSION))
return()
endif()
# Return early if the provided target does not exist, which can happen in the case of zstd,
# where we list multiple possible target names, but only some will be available.
if(NOT TARGET "${target}")
return()
endif()
get_property(is_global TARGET "${target}" PROPERTY IMPORTED_GLOBAL)
_qt_internal_should_not_promote_package_target_to_global("${target}" should_not_promote)
if(NOT is_global AND NOT should_not_promote)
_qt_internal_promote_3rd_party_target_to_global(${target})
_qt_internal_promote_3rd_party_link_targets_to_global("${target}")
endif()
endfunction()
# Tries to promote a non-global imported 3rd party target to global scope.
# 3rd party targets are usually system library targets.
# - targets that were not created by qt_internal_add_foo commands
# - targets that don't have the should_skip_global_promotion property
function(_qt_internal_promote_3rd_party_target_to_global target)
get_property(is_global TARGET ${target} PROPERTY IMPORTED_GLOBAL)
if(NOT is_global)
_qt_internal_is_internal_target("${target}" is_internal)
_qt_internal_should_skip_3rd_party_global_promotion("${target}" should_skip)
if(NOT is_internal AND NOT should_skip)
__qt_internal_promote_target_to_global("${target}")
endif()
endif()
endfunction()
function(__qt_internal_promote_target_to_global_checked target)
# With CMake version 3.21 we use a different mechanism that allows us to promote all targets
# within a scope.

View File

@ -74,7 +74,7 @@ endfunction()
# operation: a string to tell the function what additional behaviors to execute.
# 'collect_libs' (default) operation is to collect linker file paths and flags.
# Used for prl file generation.
# 'promote_global' promotes walked imported targets to global scope.
# 'promote_3rd_party_global' promotes walked 3rd party imported targets to global scope.
# 'collect_targets' collects all target names (discards framework or link flags)
# 'direct_targets' collects only the direct target names (discards framework or link
# flags)
@ -238,7 +238,7 @@ function(__qt_internal_walk_libs
__qt_internal_merge_libs(rcc_objects ${lib_rcc_objects_${target}})
endif()
endif()
if(operation STREQUAL "promote_global")
if(operation STREQUAL "promote_3rd_party_global")
set(lib_target_unaliased "${lib_target}")
get_target_property(aliased_target ${lib_target} ALIASED_TARGET)
if(aliased_target)
@ -249,15 +249,23 @@ function(__qt_internal_walk_libs
# Allow opting out of promotion. This is useful in certain corner cases
# like with WrapLibClang and Threads in qttools.
qt_internal_should_not_promote_package_target_to_global(
_qt_internal_should_not_promote_package_target_to_global(
"${lib_target_unaliased}" should_not_promote)
if(is_imported AND NOT should_not_promote)
__qt_internal_promote_target_to_global(${lib_target_unaliased})
_qt_internal_promote_3rd_party_target_to_global(
${lib_target_unaliased})
endif()
endif()
elseif("${lib_target}" MATCHES "^(Qt|${QT_CMAKE_EXPORT_NAMESPACE})::(.*)")
message(FATAL_ERROR "The ${CMAKE_MATCH_2} target is mentioned as a dependency for \
${target}, but not declared.")
if(QT_BUILDING_QT OR QT_BUILD_STANDALONE_TESTS)
set(message_type FATAL_ERROR)
set(message_addition "")
else()
set(message_type WARNING)
set(message_addition " The linking might be incomplete.")
endif()
message(${message_type} "The ${CMAKE_MATCH_2} target is mentioned as a dependency"
" for ${target}, but not declared.${message_addition}")
else()
if(NOT operation MATCHES "^(collect|direct)_targets$")
set(final_lib_name_to_merge "${lib_target}")

View File

@ -53,7 +53,7 @@ endfunction()
function(__qt_internal_get_emcc_recommended_version out_var)
# This version of Qt needs this version of emscripten.
set(QT_EMCC_RECOMMENDED_VERSION "3.1.50")
set(QT_EMCC_RECOMMENDED_VERSION "3.1.56")
set(${out_var} "${QT_EMCC_RECOMMENDED_VERSION}" PARENT_SCOPE)
endfunction()

24
cmake/QtSbomHelpers.cmake Normal file
View File

@ -0,0 +1,24 @@
# Copyright (C) 2024 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
# For now these are simple internal forwarding wrappers for the public counterparts, which are
# meant to be used in qt repo CMakeLists.txt files.
function(qt_internal_add_sbom)
_qt_internal_add_sbom(${ARGN})
endfunction()
function(qt_internal_extend_sbom)
_qt_internal_extend_sbom(${ARGN})
endfunction()
function(qt_internal_sbom_add_license)
_qt_internal_sbom_add_license(${ARGN})
endfunction()
function(qt_internal_extend_sbom_dependencies)
_qt_internal_extend_sbom_dependencies(${ARGN})
endfunction()
function(qt_find_package_extend_sbom)
_qt_find_package_extend_sbom(${ARGN})
endfunction()

View File

@ -77,9 +77,17 @@ function(qt_watch_current_list_dir variable access value current_list_file stack
qt_finalize_plugin(${a1} ${a2} ${a3} ${a4} ${a5} ${a6} ${a7} ${a8} ${a9})
elseif(func STREQUAL "qt_internal_finalize_app")
qt_internal_finalize_app(${a1} ${a2} ${a3} ${a4} ${a5} ${a6} ${a7} ${a8} ${a9})
elseif(func STREQUAL "qt_internal_finalize_tool")
qt_internal_finalize_tool(${a1} ${a2} ${a3} ${a4} ${a5} ${a6} ${a7} ${a8} ${a9})
elseif(func STREQUAL "qt_internal_finalize_3rdparty_library")
qt_internal_finalize_3rdparty_library(
${a1} ${a2} ${a3} ${a4} ${a5} ${a6} ${a7} ${a8} ${a9})
elseif(func STREQUAL "qt_internal_export_additional_targets_file_finalizer")
qt_internal_export_additional_targets_file_finalizer(
${a1} ${a2} ${a3} ${a4} ${a5} ${a6} ${a7} ${a8} ${a9})
elseif(func STREQUAL "_qt_internal_finalize_sbom")
_qt_internal_finalize_sbom(
${a1} ${a2} ${a3} ${a4} ${a5} ${a6} ${a7} ${a8} ${a9})
else()
message(FATAL_ERROR "qt_watch_current_list_dir doesn't know about ${func}. Consider adding it.")
endif()

View File

@ -41,10 +41,12 @@ function(qt_internal_extend_target target)
set(option_args
NO_UNITY_BUILD
${__qt_internal_sbom_optional_args}
)
set(single_args
PRECOMPILED_HEADER
EXTRA_LINKER_SCRIPT_CONTENT
${__qt_internal_sbom_single_args}
)
set(multi_args
${__default_public_args}
@ -54,6 +56,7 @@ function(qt_internal_extend_target target)
CONDITION_INDEPENDENT_SOURCES
COMPILE_FLAGS
EXTRA_LINKER_SCRIPT_EXPORTS
${__qt_internal_sbom_multi_args}
)
cmake_parse_arguments(PARSE_ARGV 1 arg
@ -210,6 +213,34 @@ function(qt_internal_extend_target target)
endif()
endforeach()
if(arg_LIBRARIES)
_qt_internal_append_to_target_property_without_duplicates(${target}
_qt_extend_target_libraries "${arg_LIBRARIES}"
)
endif()
if(arg_PUBLIC_LIBRARIES)
_qt_internal_append_to_target_property_without_duplicates(${target}
_qt_extend_target_public_libraries "${arg_PUBLIC_LIBRARIES}"
)
endif()
if(QT_GENERATE_SBOM)
set(sbom_args "")
_qt_internal_forward_function_args(
FORWARD_APPEND
FORWARD_PREFIX arg
FORWARD_OUT_VAR sbom_args
FORWARD_OPTIONS
${__qt_internal_sbom_optional_args}
FORWARD_SINGLE
${__qt_internal_sbom_single_args}
FORWARD_MULTI
${__qt_internal_sbom_multi_args}
)
_qt_internal_extend_sbom(${target} ${sbom_args})
endif()
set(target_private "${target}Private")
get_target_property(is_internal_module ${target} _qt_is_internal_module)
# Internal modules don't have Private targets but we still need to
@ -298,7 +329,7 @@ endfunction()
function(qt_get_install_target_default_args)
cmake_parse_arguments(PARSE_ARGV 0 arg
""
"OUT_VAR;CMAKE_CONFIG;RUNTIME;LIBRARY;ARCHIVE;INCLUDES;BUNDLE"
"OUT_VAR;OUT_VAR_RUNTIME;CMAKE_CONFIG;RUNTIME;LIBRARY;ARCHIVE;INCLUDES;BUNDLE"
"ALL_CMAKE_CONFIGS")
_qt_internal_validate_all_args_are_parsed(arg)
@ -348,6 +379,13 @@ function(qt_get_install_target_default_args)
BUNDLE DESTINATION "${bundle}${suffix}"
INCLUDES DESTINATION "${includes}${suffix}")
set(${arg_OUT_VAR} "${args}" PARENT_SCOPE)
if(arg_OUT_VAR_RUNTIME)
set(args
"${runtime}${suffix}"
)
set(${arg_OUT_VAR_RUNTIME} "${args}" PARENT_SCOPE)
endif()
endfunction()
macro(qt_internal_setup_default_target_function_options)
@ -391,6 +429,12 @@ macro(qt_internal_setup_default_target_function_options)
TARGET_COPYRIGHT
)
_qt_internal_get_sbom_add_target_common_options(
__qt_internal_sbom_optional_args
__qt_internal_sbom_single_args
__qt_internal_sbom_multi_args
)
# Collection of arguments so they can be shared across qt_internal_add_executable
# and qt_internal_add_test_helper.
set(__qt_internal_add_executable_optional_args
@ -401,6 +445,7 @@ macro(qt_internal_setup_default_target_function_options)
DELAY_TARGET_INFO
QT_APP
NO_UNITY_BUILD
${__qt_internal_sbom_optional_args}
)
set(__qt_internal_add_executable_single_args
CORE_LIBRARY
@ -408,10 +453,12 @@ macro(qt_internal_setup_default_target_function_options)
INSTALL_DIRECTORY
VERSION
${__default_target_info_args}
${__qt_internal_sbom_single_args}
)
set(__qt_internal_add_executable_multi_args
${__default_private_args}
${__default_public_args}
${__qt_internal_sbom_multi_args}
)
endmacro()
@ -447,7 +494,15 @@ function(qt_internal_setup_cmake_config_postfix)
set(default_cmake_debug_postfix "d")
endif()
elseif(APPLE)
set(default_cmake_debug_postfix "_debug")
# Only add a suffix for explicit no-framework builds.
# For framework builds the library inside the framework
# is always unsuffixed, and we want to match that for
# plugins and other non-framework (static) libraries.
if(NOT (QT_FEATURE_framework OR FEATURE_framework
# Account for default in configure.json being ON
OR (NOT DEFINED QT_FEATURE_framework AND NOT DEFINED FEATURE_framework)))
set(default_cmake_debug_postfix "_debug")
endif()
endif()
set(custom_postfix_vars "")
@ -921,6 +976,7 @@ endif()\n")
set(write_implib FALSE)
set(write_soname FALSE)
set(write_objects FALSE)
set(write_link_dependencies FALSE)
set(write_location TRUE)
if(target_type STREQUAL "SHARED_LIBRARY")
@ -931,6 +987,7 @@ endif()\n")
else()
set(write_soname TRUE)
endif()
set(write_link_dependencies TRUE)
elseif(target_type STREQUAL "OBJECT_LIBRARY")
set(write_objects TRUE)
set(write_location FALSE)
@ -946,6 +1003,9 @@ endif()\n")
if(write_soname)
string(APPEND content "get_target_property(_qt_imported_soname ${full_target} IMPORTED_SONAME_${uc_release_cfg})\n")
endif()
if(write_link_dependencies)
string(APPEND content "get_target_property(_qt_imported_link_dependencies ${full_target} IMPORTED_LINK_DEPENDENT_LIBRARIES_${uc_release_cfg})\n")
endif()
if(write_objects)
string(APPEND content "get_target_property(_qt_imported_objects ${full_target} IMPORTED_OBJECTS_${uc_release_cfg})\n")
# We generate CLR props as well, because that's what CMake generates for object
@ -962,6 +1022,9 @@ endif()\n")
if(write_soname)
string(APPEND content "get_target_property(_qt_imported_soname_default ${full_target} IMPORTED_SONAME_$\{QT_DEFAULT_IMPORT_CONFIGURATION})\n")
endif()
if(write_link_dependencies)
string(APPEND content "get_target_property(_qt_imported_link_dependencies_default ${full_target} IMPORTED_LINK_DEPENDENT_LIBRARIES_$\{QT_DEFAULT_IMPORT_CONFIGURATION})\n")
endif()
if(write_objects)
string(APPEND content "get_target_property(_qt_imported_objects_default ${full_target} IMPORTED_OBJECTS_$\{QT_DEFAULT_IMPORT_CONFIGURATION})\n")
string(APPEND content "get_target_property(_qt_imported_clr_default ${full_target} IMPORTED_COMMON_LANGUAGE_RUNTIME_$\{QT_DEFAULT_IMPORT_CONFIGURATION})\n")
@ -996,6 +1059,12 @@ endif()")
string(APPEND content "
if(_qt_imported_soname${var_suffix})
set_property(TARGET ${full_target} PROPERTY IMPORTED_SONAME${property_suffix} \"$\{_qt_imported_soname${var_suffix}}\")
endif()")
endif()
if(write_link_dependencies)
string(APPEND content "
if(_qt_imported_link_dependencies${var_suffix})
set_property(TARGET ${full_target} PROPERTY IMPORTED_LINK_DEPENDENT_LIBRARIES${property_suffix} \"$\{_qt_imported_link_dependencies${var_suffix}}\")
endif()")
endif()
if(write_objects)
@ -1018,6 +1087,8 @@ unset(_qt_imported_location)
unset(_qt_imported_location_default)
unset(_qt_imported_soname)
unset(_qt_imported_soname_default)
unset(_qt_imported_link_dependencies)
unset(_qt_imported_link_dependencies_default)
unset(_qt_imported_objects)
unset(_qt_imported_objects_default)
unset(_qt_imported_clr)
@ -1354,6 +1425,7 @@ endfunction()
# Needed to allow selectively applying certain flags via PlatformXInternal targets.
function(qt_internal_mark_as_internal_library target)
set_target_properties(${target} PROPERTIES _qt_is_internal_library TRUE)
set_property(TARGET "${target}" APPEND PROPERTY EXPORT_PROPERTIES "_qt_is_internal_library")
qt_internal_mark_as_internal_target(${target})
endfunction()
@ -1363,6 +1435,7 @@ endfunction()
# Needed to allow selectively applying certain flags via PlatformXInternal targets.
function(qt_internal_mark_as_internal_target target)
set_target_properties(${target} PROPERTIES _qt_is_internal_target TRUE)
set_property(TARGET "${target}" APPEND PROPERTY EXPORT_PROPERTIES "_qt_is_internal_target")
endfunction()
# Marks a target with a property to skip it adding it as a dependency when building examples as
@ -1659,31 +1732,29 @@ function(qt_internal_export_genex_properties)
)
endfunction()
# The macro promotes the Qt platform targets and their dependencies to global. The macro shouldn't
# be called explicitly in regular cases. It's called right after the first find_package(Qt ...)
# call in the qt_internal_project_setup macro.
# This allows using the qt_find_package(Wrap<3rdparty> PROVIDED_TARGETS ...) function,
# without the risk of having duplicated global promotion of Qt internals. This is especially
# sensitive for the bundled 3rdparty libraries.
macro(qt_internal_promote_platform_targets_to_global)
if(TARGET Qt6::Platform)
get_target_property(is_imported Qt6::Platform IMPORTED)
if(is_imported)
set(known_platform_targets
Platform
PlatformCommonInternal
PlatformModuleInternal
PlatformPluginInternal
PlatformAppInternal
PlatformToolInternal
)
set(versionless_platform_targets ${known_platform_targets})
# A small wrapper for adding the Platform target, and a building block for the PlatformXInternal
# and GlobalConfig INTERFACE targets to apply common options.
function(qt_internal_add_platform_target target)
_qt_internal_add_library("${target}" INTERFACE)
qt_internal_add_target_aliases("${target}")
list(TRANSFORM known_platform_targets PREPEND Qt6::)
list(TRANSFORM versionless_platform_targets PREPEND Qt::)
qt_find_package(Qt6 PROVIDED_TARGETS
${known_platform_targets}
${versionless_platform_targets})
endif()
endif()
endmacro()
# The platform targets should never be promoted to global via the
# _qt_internal_promote_3rd_party_target_to_global command.
set_property(TARGET "${target}" PROPERTY _qt_should_skip_3rd_party_global_promotion TRUE)
set_property(TARGET "${target}" APPEND PROPERTY EXPORT_PROPERTIES
"_qt_should_skip_3rd_party_global_promotion")
endfunction()
# A small wrapper for adding the PlatformXInternal and GlobalConfig INTERFACE targets to apply
# common options.
# They can't be added via qt_internal_add_module, because it automatically links to the
# PlatformInternal targets creating a cyclic dependency.
function(qt_internal_add_platform_internal_target target)
qt_internal_add_platform_target("${target}")
qt_internal_mark_as_internal_library("${target}")
qt_internal_add_sbom("${target}"
TYPE QT_MODULE
IMMEDIATE_FINALIZATION
)
endfunction()

View File

@ -50,18 +50,24 @@ function(qt_internal_add_tool target_name)
INSTALL_VERSIONED_LINK
EXCEPTIONS
NO_UNITY_BUILD
TRY_RUN)
TRY_RUN
${__qt_internal_sbom_optional_args}
)
set(one_value_keywords
TOOLS_TARGET
INSTALL_DIR
CORE_LIBRARY
TRY_RUN_FLAGS
${__default_target_info_args})
${__default_target_info_args}
${__qt_internal_sbom_single_args}
)
set(multi_value_keywords
EXTRA_CMAKE_FILES
EXTRA_CMAKE_INCLUDES
PUBLIC_LIBRARIES
${__default_private_args})
${__default_private_args}
${__qt_internal_sbom_multi_args}
)
cmake_parse_arguments(PARSE_ARGV 1 arg
"${option_keywords}"
@ -137,7 +143,6 @@ function(qt_internal_add_tool target_name)
# qt_set_target_info_properties knows how to process them
)
qt_internal_add_target_aliases("${target_name}")
_qt_internal_apply_strict_cpp("${target_name}")
qt_internal_adjust_main_config_runtime_output_dir("${target_name}" "${output_dir}")
if (WIN32)
@ -186,8 +191,21 @@ function(qt_internal_add_tool target_name)
set_property(GLOBAL APPEND PROPERTY QT_USER_FACING_TOOL_TARGETS ${target_name})
endif()
if(QT_GENERATE_SBOM)
set(sbom_args "")
list(APPEND sbom_args TYPE QT_TOOL)
endif()
if(NOT arg_NO_INSTALL AND arg_TOOLS_TARGET)
set(will_install TRUE)
else()
set(will_install FALSE)
if(QT_GENERATE_SBOM)
list(APPEND sbom_args NO_INSTALL)
endif()
endif()
if(will_install)
# Assign a tool to an export set, and mark the module to which the tool belongs.
qt_internal_append_known_modules_with_tools("${arg_TOOLS_TARGET}")
@ -202,6 +220,7 @@ function(qt_internal_add_tool target_name)
foreach(cmake_config ${cmake_configs})
qt_get_install_target_default_args(
OUT_VAR install_targets_default_args
OUT_VAR_RUNTIME runtime_install_destination
RUNTIME "${install_dir}"
CMAKE_CONFIG "${cmake_config}"
ALL_CMAKE_CONFIGS ${cmake_configs})
@ -214,6 +233,15 @@ function(qt_internal_add_tool target_name)
unset(install_optional_arg)
endif()
if(QT_GENERATE_SBOM)
_qt_internal_sbom_append_multi_config_aware_single_arg_option(
RUNTIME_PATH
"${runtime_install_destination}"
"${cmake_config}"
sbom_args
)
endif()
qt_install(TARGETS "${target_name}"
${install_initial_call_args}
${install_optional_arg}
@ -240,6 +268,28 @@ function(qt_internal_add_tool target_name)
qt_enable_separate_debug_info(${target_name} "${install_dir}" QT_EXECUTABLE)
qt_internal_install_pdb_files(${target_name} "${install_dir}")
if(QT_GENERATE_SBOM)
_qt_internal_forward_function_args(
FORWARD_APPEND
FORWARD_PREFIX arg
FORWARD_OUT_VAR sbom_args
FORWARD_OPTIONS
${__qt_internal_sbom_optional_args}
FORWARD_SINGLE
${__qt_internal_sbom_single_args}
FORWARD_MULTI
${__qt_internal_sbom_multi_args}
)
_qt_internal_extend_sbom(${target_name} ${sbom_args})
endif()
qt_add_list_file_finalizer(qt_internal_finalize_tool ${target_name})
endfunction()
function(qt_internal_finalize_tool target)
_qt_internal_finalize_sbom(${target})
endfunction()
function(_qt_internal_add_try_run_post_build target try_run_flags)

View File

@ -195,13 +195,27 @@ endif()")
list(APPEND init_platform "endif()")
list(APPEND init_platform "")
# For macOS user projects, default to not specifying any architecture. This means CMake will
# not pass an -arch flag to the compiler and the compiler will choose the default
# architecture to build for.
# For macOS user projects, the common case is to default to not specifying any architecture.
# This means CMake will not pass an -arch flag to the compiler and the compiler will
# choose the default architecture to build for.
# On Apple Silicon, CMake will introspect whether it's running under Rosetta and will
# pass the detected architecture (x86_64 under Rosetta or arm64 natively) to the compiler.
# This is line with default CMake behavior for user projects.
#
# If Qt was cross-compiled to arm64 from an x86_64 host machine, or vice versa, we need
# to continue using the same architecture for the user project, otherwise the CMake default
# might be incorrect depending on which host arch the user project is built on.
if(NOT UIKIT)
list(LENGTH CMAKE_OSX_ARCHITECTURES arch_count)
if(arch_count EQUAL 1 AND CMAKE_CROSSCOMPILING AND CMAKE_SYSTEM_NAME STREQUAL "Darwin")
list(APPEND init_platform
"if(NOT __qt_toolchain_building_qt_repo AND NOT QT_NO_SET_OSX_ARCHITECTURES)"
" set(CMAKE_OSX_ARCHITECTURES \"${CMAKE_OSX_ARCHITECTURES}\" CACHE STRING \"\")"
" set(CMAKE_SYSTEM_NAME \"${CMAKE_SYSTEM_NAME}\" CACHE STRING \"\")"
"endif()"
)
endif()
endif()
# For iOS, we provide a bit more convenience.
# When the user project is built using the Xcode generator, we only specify the architecture
# if this is a single architecture Qt for iOS build. If we wouldn't, invoking just

View File

@ -11,16 +11,11 @@ function (qt_internal_setup_wasm_target_properties wasmTarget)
"SHELL:-s WASM_BIGINT=1"
"SHELL:-s STACK_SIZE=5MB")
target_link_libraries("${wasmTarget}" INTERFACE embind)
## wasm64
if (WASM64)
target_compile_options("${wasmTarget}" INTERFACE "SHELL:-s MEMORY64=1" )
target_link_options("${wasmTarget}" INTERFACE "SHELL:-s MEMORY64=1" -mwasm64)
endif()
# Enable MODULARIZE so that we are able to set EXPORT_NAME later and instantiate on demand (with
# MODULARIZE=0, emscripten creates a global app instance object at Javascript eval time)
target_link_options("${wasmTarget}" INTERFACE "SHELL:-s MODULARIZE=1")
#simd
if (QT_FEATURE_wasm_simd128)
@ -60,7 +55,6 @@ function (qt_internal_setup_wasm_target_properties wasmTarget)
# a few good defaults to make console more verbose while debugging
target_link_options("${wasmTarget}" INTERFACE $<$<CONFIG:Debug>:
"SHELL:-s DEMANGLE_SUPPORT=1"
--profiling-funcs>)
# target_link_options("${wasmTarget}" INTERFACE "SHELL:-s LIBRARY_DEBUG=1") # print out library calls, verbose
@ -119,9 +113,5 @@ function (qt_internal_setup_wasm_target_properties wasmTarget)
endfunction()
function(qt_internal_wasm_add_finalizers target)
qt_add_list_file_finalizer(_qt_internal_set_wasm_export_name ${target})
qt_add_list_file_finalizer(_qt_internal_add_wasm_extra_exported_methods ${target})
qt_add_list_file_finalizer(_qt_internal_wasm_add_target_helpers ${target})
qt_add_list_file_finalizer(_qt_internal_finalize_wasm_app ${target})
endfunction()

View File

@ -45,6 +45,7 @@ The following table describes the mapping of configure options to CMake argument
| -device-option <key=value> | -DQT_QMAKE_DEVICE_OPTIONS=key1=value1;key2=value2 | Only used for generation qmake-compatibility files. |
| | | The device options are written into mkspecs/qdevice.pri. |
| -appstore-compliant | -DFEATURE_appstore_compliant=ON | |
| -sbom | -DQT_GENERATE_SBOM=ON | Enables generation and installation of an SBOM |
| -qtinlinenamespace | -DQT_INLINE_NAMESPACE=ON | Make the namespace specified by -qtnamespace an inline one. |
| -qtnamespace <name> | -DQT_NAMESPACE=<name> | |
| -qtlibinfix <infix> | -DQT_LIBINFIX=<infix> | |

View File

@ -71,6 +71,11 @@ instructions:
maxTimeBetweenOutput: 1200
# INTEGRITY artifacts aren't used.
disable_if:
condition: property
property: target.osVersion
equals_value: INTEGRITY
condition: or
conditions:
- condition: property
property: target.osVersion
equals_value: INTEGRITY
- condition: property
property: features
contains_value: DoNotUploadTests

View File

@ -74,6 +74,9 @@ instructions:
variableName: DESTDIR
variableValue: "{{.InstallRoot}}"
- !include "{{qt/qtbase}}/call_host_install.yaml"
- type: EnvironmentVariable
variableName: DESTDIR
variableValue: ""
- type: SignPackage
enable_if:
condition: and

View File

@ -71,6 +71,9 @@ instructions:
variableName: DESTDIR
variableValue: "{{.InstallRoot}}"
- !include "{{qt/qtbase}}/call_host_install.yaml"
- type: EnvironmentVariable
variableName: DESTDIR
variableValue: ""
- type: SignPackage
enable_if:
condition: and

View File

@ -12,21 +12,4 @@ instructions:
- type: ChangeDirectory
directory: "{{.SourceDir}}_standalone_tests"
# Ignore CTest exit code for Tart configs, unless
# the module declares that it should be significant.
- type: Group
enable_if:
condition: and
conditions:
- condition: property
property: id
contains_value: tart
- condition: runtime
env_var: TART_SIGNIFICANT_TARGET_OSVERSIONS
not_contains_value: "{{.Env.TARGET_OSVERSION_COIN}}"
instructions:
- type: EnvironmentVariable
variableName: COIN_CTEST_IGNORE_EXIT_CODE
variableValue: "1"
- !include "{{qt/qtbase}}/cmake_run_ctest.yaml"

View File

@ -70,11 +70,11 @@ instructions:
- condition: and
conditions:
- condition: property
property: host.compiler
equals_value: MSVC2019
property: target.os
equals_value: Windows
- condition: property
property: target.arch
equals_value: ARM64
not_equals_property: host.arch
- condition: property
property: features
not_contains_value: "DebianPackaging"

View File

@ -17,7 +17,7 @@ instructions:
- type: EnvironmentVariable
variableName: COIN_CMAKE_ARGS
variableValue: "-DQT_BUILD_TESTS=OFF"
variableValue: "-DQT_BUILD_TESTS=OFF {{.Env.COIN_DOC_CMAKE_ARGS}}"
- type: EnvironmentVariable
variableName: CONFIGURE_ENV_PREFIX
variableValue: "{{.Env.ENV_PREFIX}}"

View File

@ -32,7 +32,7 @@ instructions:
while :; do
echo "Waiting QEMU SSH coming up"
status=$(ssh -o BatchMode=yes -o ConnectTimeout=1 ${QEMUIPADDR} echo ok 2>&1)
status=$(ssh -o PreferredAuthentications=publickey -o BatchMode=yes -o ConnectTimeout=1 ${QEMUIPADDR} echo ok 2>&1)
RESULT=$?
if [ $RESULT -eq 0 ]; then
echo "QEMU SSH Connected ok"

View File

@ -1,5 +1,12 @@
type: Group
instructions:
- type: Group
instructions:
- !include "{{qt/qtbase}}/run_license_check.yaml"
enable_if:
condition: property
property: features
contains_value: LicenseCheckV2
- type: Group
instructions:
- !include "{{qt/qtbase}}/coin_module_test_template_common.yaml"
@ -19,6 +26,11 @@ instructions:
property: target.osVersion
in_values: [QEMU, QNX_710]
disable_if:
condition: property
property: features
contains_value: DisableTests
condition: or
conditions:
- condition: property
property: features
contains_value: DisableTests
- condition: property
property: features
contains_value: LicenseCheckV2

View File

@ -1,5 +1,12 @@
type: Group
instructions:
- type: Group
instructions:
- !include "{{qt/qtbase}}/run_license_check.yaml"
enable_if:
condition: property
property: features
contains_value: LicenseCheckV2
- type: Group
instructions:
- !include "{{qt/qtbase}}/coin_module_test_template_common.yaml"
@ -19,6 +26,11 @@ instructions:
property: features
contains_value: AndroidTestRun
disable_if:
condition: property
property: features
contains_value: DisableTests
condition: or
conditions:
- condition: property
property: features
contains_value: DisableTests
- condition: property
property: features
contains_value: LicenseCheckV2

View File

@ -61,11 +61,11 @@ instructions:
- condition: and
conditions:
- condition: property
property: host.compiler
equals_value: MSVC2019
property: target.os
equals_value: Windows
- condition: property
property: target.arch
equals_value: ARM64
not_equals_property: host.arch
- condition: property
property: features
not_contains_value: "DebianPackaging"

View File

@ -347,11 +347,11 @@ instructions:
condition: and
conditions:
- condition: property
property: host.compiler
equals_value: MSVC2019
property: target.os
equals_value: Windows
- condition: property
property: target.arch
equals_value: ARM64
not_equals_property: host.arch
instructions:
- type: EnvironmentVariable
variableName: TARGET_ENV_PREFIX
@ -473,6 +473,74 @@ instructions:
property: features
contains_value: UseConfigure
# SBOM
- type: Group
enable_if:
condition: property
property: features
contains_value: GenerateSBOM
instructions:
- type: AppendToEnvironmentVariable
variableName: COMMON_CMAKE_ARGS
variableValue: " -DQT_GENERATE_SBOM=ON -DQT_GENERATE_SOURCE_SBOM=ON"
- type: AppendToEnvironmentVariable
variableName: COMMON_NON_QTBASE_CMAKE_ARGS
variableValue: " -DQT_GENERATE_SBOM=ON -DQT_GENERATE_SOURCE_SBOM=ON"
- type: AppendToEnvironmentVariable
variableName: COMMON_TARGET_CMAKE_ARGS
variableValue: " -DQT_GENERATE_SBOM=ON -DQT_GENERATE_SOURCE_SBOM=ON"
- type: AppendToEnvironmentVariable
variableName: COMMON_NON_QTBASE_TARGET_CMAKE_ARGS
variableValue: " -DQT_GENERATE_SBOM=ON -DQT_GENERATE_SOURCE_SBOM=ON"
# SBOM Python apps path. On Windows python-installed apps are
# in the same directory where pip is, aka Scripts sub-directory.
- type: EnvironmentVariable
variableName: SBOM_PYTHON_APPS_PATH
variableValue: "{{.Env.PIP3_PATH}}"
enable_if:
condition: property
property: host.os
equals_value: Windows
- type: EnvironmentVariable
variableName: SBOM_PYTHON_APPS_PATH
variableValue: "{{.Env.PYTHON3_PATH}}"
disable_if:
condition: property
property: host.os
equals_value: Windows
# SBOM verification and auditing
- type: Group
enable_if:
condition: property
property: features
contains_value: VerifySBOM
instructions:
- type: EnvironmentVariable
variableName: SBOM_COMMON_ARGS
variableValue: >-
-DQT_LINT_SOURCE_SBOM=ON
-DQT_INTERNAL_NO_SBOM_FIND_PYTHON_FRAMEWORK=ON
-DQT_INTERNAL_SBOM_DEFAULT_CHECKS=ON
-DQT_INTERNAL_SBOM_AUDIT=ON
-DQT_INTERNAL_SBOM_AUDIT_NO_ERROR=ON
-DQT_SBOM_PYTHON_INTERP={{.Env.PYTHON3_PATH}}
-DQT_SBOM_PYTHON_APPS_PATH={{.Env.SBOM_PYTHON_APPS_PATH}}
- type: AppendToEnvironmentVariable
variableName: COMMON_CMAKE_ARGS
variableValue: " {{.Env.SBOM_COMMON_ARGS}} "
- type: AppendToEnvironmentVariable
variableName: COMMON_NON_QTBASE_CMAKE_ARGS
variableValue: " {{.Env.SBOM_COMMON_ARGS}} "
- type: AppendToEnvironmentVariable
variableName: COMMON_TARGET_CMAKE_ARGS
variableValue: " {{.Env.SBOM_COMMON_ARGS}} "
- type: AppendToEnvironmentVariable
variableName: COMMON_NON_QTBASE_TARGET_CMAKE_ARGS
variableValue: " {{.Env.SBOM_COMMON_ARGS}} "
- type: Group
instructions:
- type: AppendToEnvironmentVariable

View File

@ -0,0 +1,23 @@
type: Group
instructions:
- type: ChangeDirectory
directory: "{{.AgentWorkingDir}}"
- type: InstallSourceArchive
maxTimeInSeconds: 600
maxTimeBetweenOutput: 600
project: qt/qtqa
ref: dev
directory: qt/qtqa-latest
userMessageOnFailure: >
Could not install qtqa source archive. Please investigate why.
- type: EnvironmentVariable
variableName: QT_MODULE_TO_TEST
variableValue: "{{.SourceDir}}"
userMessageOnFailure: >
Failed to set QT_MODULE_TO_TEST environment variable. This should not happen.
- type: ExecuteCommand
command: perl qt/qtqa-latest/tests/prebuild/license/tst_licenses.pl
maxTimeInSeconds: 7200
maxTimeBetweenOutput: 120
userMessageOnFailure: >
Failed to run license check script.

View File

@ -239,7 +239,7 @@ const char msg2[] = "==Qt=magic=Qt== Sub-architecture:"
#endif
// -- ARM --
#if defined(__ARM_NEON) || defined(__ARM_NEON__)
#if defined(__ARM_NEON) || defined(__ARM_NEON__) || defined(_M_ARM64)
" neon"
#endif
#ifdef __IWMMXT__

View File

@ -2,6 +2,10 @@ Usage: configure [options] [-- cmake-options]
This is a convenience script for configuring Qt with CMake.
Options after the double dash are directly passed to CMake.
You can pass CMake variables as configure arguments:
configure VAR=value
which is equivalent to
configure -- -DVAR=value
Top-level installation directories:
-prefix <dir> ...... The deployment directory, as seen on the target device.
@ -25,6 +29,8 @@ except -sysconfdir should be located under -prefix:
-libexecdir <dir> ..... Helper programs [ARCHDATADIR/bin on Windows,
ARCHDATADIR/libexec otherwise]
-qmldir <dir> ......... QML imports [ARCHDATADIR/qml]
-sbomdir <dir> ....... Software Bill of Materials (SBOM)
installation directory [ARCHDATADIR/sbom]
-datadir <dir> ........ Arch-independent data [PREFIX]
-docdir <dir> ......... Documentation [DATADIR/doc]
-translationdir <dir> . Translations [DATADIR/translations]
@ -99,6 +105,9 @@ Build options:
through an app store by default, in particular Android,
iOS, tvOS, and watchOS. [auto]
-sbom ................ Enable Software Bill of Materials (SBOM) generation
[no]
-qt-host-path <path> . Specify path to a Qt host build for cross-compiling.
-qtnamespace <name> .. Wrap all Qt library code in 'namespace <name> {...}'.
-qtinlinenamespace ... Make -qtnamespace an inline namespace

View File

@ -370,6 +370,36 @@ qt_config_compile_test_x86simd(avx512vbmi2 "AVX512VBMI2")
# x86: vaes
qt_config_compile_test_x86simd(vaes "VAES")
# localtime_r
qt_config_compile_test(localtime_r
LABEL "localtime_r()"
CODE
"#include <time.h>
int main(void)
{
/* BEGIN TEST: */
(void) localtime_r(nullptr, nullptr);
/* END TEST: */
return 0;
}
")
# localtime_s
qt_config_compile_test(localtime_s
LABEL "localtime_s()"
CODE
"#include <time.h>
int main(void)
{
/* BEGIN TEST: */
(void) localtime_s(nullptr, nullptr);
/* END TEST: */
return 0;
}
")
# posix_fallocate
qt_config_compile_test(posix_fallocate
LABEL "POSIX fallocate()"
@ -457,10 +487,13 @@ if(NOT CLANG) # https://gitlab.kitware.com/cmake/cmake/-/issues/21998
endif()
# trivial_auto_var_init_pattern
qt_config_compiler_supports_flag_test(trivial_auto_var_init_pattern
LABEL "-ftrivial-auto-var-init=pattern support"
FLAG "-ftrivial-auto-var-init=pattern"
)
if(NOT GCC OR CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "14.2.0")
# Causes broken codegen on GCC https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115527
qt_config_compiler_supports_flag_test(trivial_auto_var_init_pattern
LABEL "-ftrivial-auto-var-init=pattern support"
FLAG "-ftrivial-auto-var-init=pattern"
)
endif()
# intelcet
if(MSVC)
@ -560,9 +593,9 @@ qt_feature("optimize_full"
qt_feature_config("optimize_full" QMAKE_PRIVATE_CONFIG)
qt_feature("msvc_obj_debug_info"
LABEL "Embed debug info in object files (MSVC)"
CONDITION MSVC
ENABLE QT_USE_CCACHE
AUTODETECT OFF
EMIT_IF MSVC
)
qt_feature_config("msvc_obj_debug_info" QMAKE_PRIVATE_CONFIG)
qt_feature("pkg-config" PUBLIC
@ -643,6 +676,8 @@ qt_feature("force_asserts" PUBLIC
qt_feature("framework" PUBLIC
LABEL "Build Apple Frameworks"
AUTODETECT ON
# If changing this, please align with logic in
# qt_internal_setup_cmake_config_postfix.
CONDITION APPLE
)
qt_feature_definition("framework" "QT_MAC_FRAMEWORK_BUILD")
@ -701,7 +736,7 @@ qt_feature_config("plugin-manifests" QMAKE_PUBLIC_CONFIG
qt_feature("c++20" PUBLIC
LABEL "C++20"
AUTODETECT OFF
CONDITION TEST_cxx20
CONDITION TEST_cxx20 AND NOT VXWORKS
)
qt_feature_config("c++20" QMAKE_PUBLIC_QT_CONFIG)
qt_feature("c++2a" PUBLIC
@ -952,6 +987,14 @@ qt_feature("wasm-exceptions" PUBLIC
qt_feature_definition("wasm-exceptions" "QT_WASM_EXCEPTIONS" VALUE "1")
qt_feature_config("wasm-exceptions" QMAKE_PRIVATE_CONFIG)
qt_feature("localtime_r" PRIVATE
LABEL "localtime_r()"
CONDITION TEST_localtime_r
)
qt_feature("localtime_s" PRIVATE
LABEL "localtime_s()"
CONDITION TEST_localtime_s
)
qt_feature("posix_fallocate" PRIVATE
LABEL "POSIX fallocate()"
CONDITION TEST_posix_fallocate

View File

@ -39,6 +39,11 @@
\externalpage https://doc.qt.io/qtcreator/creator-how-tos.html
\title Qt Creator: How-tos
*/
/*!
\externalpage https://doc.qt.io/qtcreator/creator-how-to-build-and-run-tests.html
\title Qt Creator: Build and Run Tests
*/
/*!
\externalpage https://doc.qt.io/qtcreator/creator-help.html
\title Qt Creator: Using the Help Mode
@ -600,7 +605,7 @@
\title Qt Creator: Visualizing Chrome Trace Events
*/
/*!
\externalpage https://doc.qt.io/qtcreator/creator-autotest.html
\externalpage https://doc.qt.io/qtcreator/creator-how-to-build-and-run-tests.html
\title Qt Creator: Running Autotests
*/
/*!

59
doc/global/grid.qdocconf Normal file
View File

@ -0,0 +1,59 @@
# Macros for laying out a three-column grid structure of
# items in online documentation. Takes three arguments,
# wrapped in braces:
# a link, a title, and a description.
# Usage:
# \grid
# \griditem {qtqml-index.html} {Qt Qml} {Classes for QML and JavaScript languages.}
# \griditem {qtquick-index.html} {Qt Quick} {
# Declarative framework for dynamic apps with custom UIs.
# }
# \griditem {qtquickcontrols-index.html} {Qt Quick Controls} {
# Lightweight QML types for creating performant user
# interfaces.
# }
# \endgrid
# Note: For offline documentation, these macros
# generate a \table structure instead.
macro.grid = \
"\\if defined(onlinedocs)\n" \
" \\raw HTML\n" \
" <div class=\"grid\">\n" \
" <ul class=\"l-tile\" data-column=\"3\">\n" \
" \\endraw\n" \
"\\else\n" \
" \\table\n" \
"\\endif\n"
macro.griditem = \
"\\detailedgriditem {\1} {\2} {\3} {#} {}"
macro.detailedgriditem = \
"\\if defined(onlinedocs)\n" \
" \\raw HTML\n" \
" <li class=\"l-tile__item\">\n" \
" <div class=\"c-feature c-feature--external-link\" data-scheme=\"\">\n" \
" <h3>\2</h3>\n" \
" <p>\3</p>\n" \
" <a class=\"c-feature__overlay-link\" href=\"\1\"></a>\n" \
" <a data-tag=\"\5\" href=\"\4\"></a>\n" \
" </div>\n" \
" </li>\n" \
" \\endraw\n" \
"\\else\n" \
" \\row \\li \\l {\1}{\2} \\li \3\n" \
"\\endif\n"
macro.endgrid = \
"\\if defined(onlinedocs)\n" \
" \\raw HTML\n" \
" </ul></div>\n" \
" \\endraw\n" \
"\\else\n" \
" \\endtable\n" \
"\\endif\n"

View File

@ -96,8 +96,8 @@ macro.AndroidMinVer = "9"
macro.AndroidMaxVer = "14"
macro.AndroidPlatformVer = "34"
macro.AndroidBuildToolsVer = "34.0.0"
macro.GradleVer = "8.7"
macro.AGPVer = "8.4.0"
macro.GradleVer = "8.10"
macro.AGPVer = "8.6.0"
macro.AAOSVer = "10 to 13"
macro.beginfloatleft.HTML = "<div style=\"float: left; margin-right: 2em\">"
@ -171,3 +171,5 @@ macro.qtpolicydeprecatedbehavior = "\\note The \\c{OLD} behavior of a policy is
#group.
#Must be placed directly under a \brief command
macro.techpreview = "(Technical preview)\n\n\\meta status {Technical preview}\n\\ingroup tech_preview\n"
include(grid.qdocconf)

View File

@ -642,14 +642,7 @@ Content table
@media print {
.toc {
float: right;
clear: right;
padding-bottom: 10px;
padding-top: 50px;
width: 100%;
background-image: url(../images/bgrContent.png);
background-position: top;
background-repeat: no-repeat;
display: none;
}
}
@ -731,6 +724,9 @@ Landing page
vertical-align: top;
}
.landing {
display: flex;
}
.landing h2 {
background-color: transparent;
@ -745,19 +741,14 @@ Landing page
}
.col-1 {
display: inline-block;
white-space: normal;
width: 70%;
height: 100%;
float: left;
}
.col-2 {
display: inline-block;
white-space: normal;
width: 20%;
margin-left: 5%;
position: relative;
top: -20px;
}

View File

@ -12,10 +12,6 @@
\image queuedcustomtype-example.png
Contents:
\tableofcontents
\section1 Overview
In this example, we create a value class, \c Block, and register it with

View File

@ -34,8 +34,6 @@
We'll start by initializing OpenGL ES 2.0 in \c MainWidget.
\tableofcontents
\section1 Initializing OpenGL ES 2.0
Since OpenGL ES 2.0 doesn't support fixed graphics pipeline anymore it has to

View File

@ -32,6 +32,7 @@ target_link_libraries(masterdetail PRIVATE
set(masterdetail_resource_files
"images/icon.png"
"images/image.png"
"albumdetails.xml"
)
qt_add_resources(masterdetail "masterdetail"

View File

@ -173,6 +173,7 @@ void Dialog::increaseAlbumCount(const QModelIndex &artistIndex)
int albumCount = albumCountIndex.data().toInt();
artistModel->setData(albumCountIndex, QVariant(albumCount + 1));
artistModel->submitAll();
}

View File

@ -14,7 +14,7 @@ int main(int argc, char *argv[])
if (!createConnection())
return EXIT_FAILURE;
QFile albumDetails("albumdetails.xml");
QFile albumDetails(":/albumdetails.xml");
MainWindow window("artists", "albums", &albumDetails);
window.show();
return app.exec();

View File

@ -202,6 +202,8 @@ void MainWindow::removeAlbumFromFile(int id)
void MainWindow::removeAlbumFromDatabase(const QModelIndex &index)
{
model->removeRow(index.row());
// to avoid a blank row, see QSqlTableModel::removeRows()
model->select();
}
void MainWindow::decreaseAlbumCount(const QModelIndex &artistIndex)
@ -217,6 +219,7 @@ void MainWindow::decreaseAlbumCount(const QModelIndex &artistIndex)
showImageLabel();
} else {
artists->setData(albumCountIndex, QVariant(albumCount - 1));
artists->submitAll();
}
}

View File

@ -2,5 +2,6 @@
<qresource>
<file>images/icon.png</file>
<file>images/image.png</file>
<file>albumdetails.xml</file>
</qresource>
</RCC>

View File

@ -13,10 +13,12 @@ int main(int argc, char *argv[])
QApplication app(argc, argv);
if (!QSystemTrayIcon::isSystemTrayAvailable()) {
QMessageBox::critical(nullptr, QObject::tr("Systray"),
QObject::tr("I couldn't detect any system tray "
"on this system."));
return 1;
auto choice = QMessageBox::critical(nullptr, QObject::tr("Systray"),
QObject::tr("I couldn't detect any system tray on this system."),
QMessageBox::Close | QMessageBox::Ignore);
if (choice == QMessageBox::Close)
return 1;
// Otherwise "lurk": if a system tray is started later, the icon will appear.
}
QApplication::setQuitOnLastWindowClosed(false);

View File

@ -9,6 +9,7 @@
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
app.styleHints()->setColorScheme(Qt::ColorScheme::Dark);
WidgetGallery gallery;
gallery.show();
return QCoreApplication::exec();

View File

@ -140,9 +140,7 @@ WidgetGallery::WidgetGallery(QWidget *parent)
colorSchemeComboBox->addItem(tr("Auto"));
colorSchemeComboBox->addItem(tr("Light"));
colorSchemeComboBox->addItem(tr("Dark"));
// override the color scheme to dark
qApp->styleHints()->setColorScheme(Qt::ColorScheme::Dark);
colorSchemeComboBox->setCurrentIndex(2);
colorSchemeComboBox->setCurrentIndex(static_cast<int>(qApp->styleHints()->colorScheme()));
auto colorSchemeLabel = createWidget1<QLabel>(tr("&Color Scheme:"), "colorSchemeLabel");
colorSchemeLabel->setBuddy(colorSchemeComboBox);

View File

@ -22,6 +22,16 @@
"file type" : "examples and snippets",
"spdx" : ["LicenseRef-Qt-Commercial OR BSD-3-Clause"]
},
"cmake/QtPublicGitHelpers.cmake" : {
"comment" : "MIT licensed copied parts",
"file type" : "build system",
"spdx" : ["BSD-3-Clause AND MIT"]
},
"cmake/QtPublicSbomGenerationHelpers.cmake" : {
"comment" : "MIT licensed copied parts",
"file type" : "build system",
"spdx" : ["MIT AND BSD-3-Clause"]
},
"tests/auto/cmake/test_plugin_shared_static_flavor\\.cmake" : {
"comment" : "Exception. This is a test file.",
"file type" : "test",
@ -169,6 +179,11 @@
"file type" : "util",
"spdx" : ["LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0"]
},
"util/locale_database/testlocales/localemodel.cpp" : {
"comment" : "Exception: this contains CLDR-generated code",
"file type" : "util",
"spdx" : ["Unicode-3.0"]
},
"util/wasm/batchedtestrunner/" : {
"comment" : "Exception: this is a helper tool",
"file type" : "util",

View File

@ -42,7 +42,6 @@ EMCC_COMMON_LFLAGS += \
# but are here in debug for clarity.
EMCC_COMMON_LFLAGS_DEBUG = \
$$EMCC_COMMON_LFLAGS \
-s DEMANGLE_SUPPORT=1 \
# -s LIBRARY_DEBUG=1 \ #print out library calls, verbose
# -s SYSCALL_DEBUG=1 \ #print out sys calls, verbose
# -s FS_LOG=1 \ #print out filesystem ops, verbose

View File

@ -19,8 +19,13 @@ defineReplace(qtPlatformTargetSuffix) {
}
darwin {
contains($$config_variable, debug, debug|release) {
!debug_and_release|build_pass: \
return($${suffix}_debug)
debug_and_release {
build_pass: \
return($${suffix}_debug)
} else {
!qtConfig(framework): \
return($${suffix}_debug)
}
}
}
return($$suffix)

View File

@ -45,7 +45,7 @@ CONFIG(debug, debug|release) {
equals(build, debug): \
suffix = _debug
} else {
contains(QT_CONFIG, debug): \
!qtConfig(framework):contains(QT_CONFIG, debug): \
suffix = _debug
}

View File

@ -1,5 +1,5 @@
defineReplace(qtEmccRecommendedVersion) {
return (3.1.50)
return (3.1.56)
}
defineReplace(qtSystemEmccVersion) {

View File

@ -8,44 +8,57 @@
#####################################################################
# The common object library, that should be available regardless of the presence of qmake.
qt_add_library(QtLibraryInfo OBJECT
library/proitems.cpp library/proitems.h
library/qmake_global.h
property.cpp property.h
propertyprinter.cpp propertyprinter.h
qmakelibraryinfo.cpp qmakelibraryinfo.h
)
if(QT_WILL_BUILD_TOOLS)
qt_add_library(QtLibraryInfo OBJECT
library/proitems.cpp library/proitems.h
library/qmake_global.h
property.cpp property.h
propertyprinter.cpp propertyprinter.h
qmakelibraryinfo.cpp qmakelibraryinfo.h
)
qt_internal_add_sbom(QtLibraryInfo
TYPE QT_MODULE
NO_INSTALL
)
# Make sure we use same parameters when building QtLibraryInfo and other Qt libraries,
# otherwise some compilers may have compilation errors, such as clang-cl.
target_link_libraries(QtLibraryInfo PUBLIC PlatformCommonInternal)
# Make sure we use same parameters when building QtLibraryInfo and other Qt libraries,
# otherwise some compilers may have compilation errors, such as clang-cl.
target_link_libraries(QtLibraryInfo PUBLIC PlatformCommonInternal)
target_link_libraries(QtLibraryInfo PUBLIC Qt::CorePrivate)
target_link_libraries(QtLibraryInfo PUBLIC Qt::CorePrivate)
qt_internal_add_sync_header_dependencies(QtLibraryInfo Core)
qt_internal_add_sync_header_dependencies(QtLibraryInfo Core)
target_include_directories(QtLibraryInfo PUBLIC
"${CMAKE_CURRENT_SOURCE_DIR}"
"${CMAKE_CURRENT_SOURCE_DIR}/library"
)
target_include_directories(QtLibraryInfo PUBLIC
"${CMAKE_CURRENT_SOURCE_DIR}"
"${CMAKE_CURRENT_SOURCE_DIR}/library"
)
# Chop off the "/mkspecs" part of INSTALL_MKSPECSDIR
get_filename_component(hostdatadir "${INSTALL_MKSPECSDIR}" DIRECTORY)
if("${hostdatadir}" STREQUAL "")
set(hostdatadir ".")
# Chop off the "/mkspecs" part of INSTALL_MKSPECSDIR
get_filename_component(hostdatadir "${INSTALL_MKSPECSDIR}" DIRECTORY)
if("${hostdatadir}" STREQUAL "")
set(hostdatadir ".")
endif()
target_compile_definitions(QtLibraryInfo PUBLIC
PROEVALUATOR_FULL
QT_BUILD_QMAKE
QT_USE_QSTRINGBUILDER
QT_HOST_MKSPEC="${QT_QMAKE_HOST_MKSPEC}"
QT_TARGET_MKSPEC="${QT_QMAKE_TARGET_MKSPEC}"
QT_HOST_DATADIR="${hostdatadir}"
)
qt_internal_set_exceptions_flags(QtLibraryInfo OFF)
# Add QMAKE_VERSION_STR only if qmake is part of the build.
if(QT_FEATURE_qmake)
target_compile_definitions(QtLibraryInfo PUBLIC
QMAKE_VERSION_STR="3.1"
)
endif()
endif()
target_compile_definitions(QtLibraryInfo PUBLIC
PROEVALUATOR_FULL
QT_BUILD_QMAKE
QT_USE_QSTRINGBUILDER
QT_HOST_MKSPEC="${QT_QMAKE_HOST_MKSPEC}"
QT_TARGET_MKSPEC="${QT_QMAKE_TARGET_MKSPEC}"
QT_HOST_DATADIR="${hostdatadir}"
)
qt_internal_set_exceptions_flags(QtLibraryInfo OFF)
if(NOT QT_FEATURE_qmake)
return()
endif()
@ -99,13 +112,21 @@ qt_internal_add_tool(${target_name}
generators/win32/msvc_objectmodel.cpp # xml symbols clash with generators/win32/msbuild_objectmodel.cpp
library/qmakeparser.cpp # struct statics clashes with qmakeevaluator_p.h
)
qt_internal_return_unless_building_tools()
# Add QMAKE_VERSION_STR only if qmake is part of the build.
target_compile_definitions(QtLibraryInfo PUBLIC
QMAKE_VERSION_STR="3.1"
# When we don't build tools, we still want to be able to build the documentation.
# Add a fake interface library to make sure the documentation target is created.
# We use the direct name rather than ${target_name} to ensure the doc target keeps
# the original name even when cross-building.
if(NOT TARGET qmake)
add_library(qmake INTERFACE)
endif()
qt_internal_add_docs(qmake
doc/qmake.qdocconf
)
qt_internal_return_unless_building_tools()
#### Keys ignored in scope 1:.:.:qmake.pro:<TRUE>:
# _OPTION = "host_build"
@ -133,6 +154,3 @@ set_target_properties(${target_name} PROPERTIES
qt_internal_apply_gc_binaries(${target_name} PRIVATE)
qt_skip_warnings_are_errors(${target_name})
qt_internal_add_docs(${target_name}
doc/qmake.qdocconf
)

View File

@ -314,9 +314,9 @@ void NmakeMakefileGenerator::writeImplicitRulesPart(QTextStream &t)
const QStringList sourceFilesFilter = sourceFilesForImplicitRulesFilter();
QStringList fixifiedSourceDirs = fileFixify(QList<QString>(source_directories.constBegin(), source_directories.constEnd()), FileFixifyAbsolute);
fixifiedSourceDirs.removeDuplicates();
constexpr auto filters = QDir::Files | QDir::NoDotAndDotDot;
using F = QDirListing::IteratorFlag;
for (const QString &sourceDir : std::as_const(fixifiedSourceDirs)) {
for (const auto &dirEntry : QDirListing(sourceDir, sourceFilesFilter, filters)) {
for (const auto &dirEntry : QDirListing(sourceDir, sourceFilesFilter, F::FilesOnly)) {
QString &duplicate = fileNames[dirEntry.completeBaseName()];
if (duplicate.isNull()) {
duplicate = dirEntry.filePath();

View File

@ -1293,9 +1293,8 @@ void VcprojGenerator::initDeploymentTool()
}
int pathSize = searchPath.size();
constexpr auto filters = QDir::Files | QDir::NoDotAndDotDot | QDir::NoSymLinks;
using F = QDirListing::IteratorFlag;
QDirListing dirList(searchPath, QStringList{nameFilter}, filters, F::Recursive);
QDirListing dirList(searchPath, QStringList{nameFilter}, F::FilesOnly | F::Recursive);
// foreach dirIterator-entry in d
for (const auto &dirEntry : dirList) {
const QString absoluteItemPath = Option::fixPathToTargetOS(dirEntry.absolutePath());

View File

@ -221,15 +221,21 @@ bool IoUtils::touchFile(const QString &targetFileName, const QString &referenceF
*errorString = fL1S("Cannot stat() reference file %1: %2.").arg(referenceFileName, fL1S(strerror(errno)));
return false;
}
# if defined(_POSIX_VERSION) && _POSIX_VERSION >= 200809L
const struct timespec times[2] = { { 0, UTIME_NOW }, st.st_mtim };
# if (defined(_POSIX_VERSION) && _POSIX_VERSION >= 200809L) || defined(Q_OS_DARWIN)
const struct timespec times[2] = { { 0, UTIME_NOW },
# if defined(_POSIX_VERSION) && _POSIX_VERSION >= 200809L
st.st_mtim // POSIX.1-2008
# else
st.st_mtimespec // Darwin
# endif
};
const bool utimeError = utimensat(AT_FDCWD, targetFileName.toLocal8Bit().constData(), times, 0) < 0;
# else
struct utimbuf utb;
utb.actime = time(0);
utb.modtime = st.st_mtime;
const bool utimeError= utime(targetFileName.toLocal8Bit().constData(), &utb) < 0;
# endif
# endif // (defined(_POSIX_VERSION) && _POSIX_VERSION >= 200809L) || defined(Q_OS_DARWIN)
if (utimeError) {
*errorString = fL1S("Cannot touch %1: %2.").arg(targetFileName, fL1S(strerror(errno)));
return false;
@ -256,7 +262,7 @@ bool IoUtils::touchFile(const QString &targetFileName, const QString &referenceF
}
SetFileTime(wHand, NULL, NULL, &ft);
CloseHandle(wHand);
# endif
# endif // Q_OS_UNIX
return true;
}

View File

@ -1046,6 +1046,11 @@ void QMakeEvaluator::loadDefaults()
case PROCESSOR_ARCHITECTURE_AMD64:
archStr = ProString("x86_64");
break;
# endif
# ifdef PROCESSOR_ARCHITECTURE_ARM64
case PROCESSOR_ARCHITECTURE_ARM64:
archStr = ProString("arm64");
break;
# endif
case PROCESSOR_ARCHITECTURE_INTEL:
archStr = ProString("x86");

View File

@ -141,7 +141,10 @@ function(qt_commandline_cxxstd arg val nextok)
qtConfAddError("Missing argument to command line parameter '${arg}'.")
return()
endif()
if(val MATCHES "(c\\+\\+)?(20|2a)")
if(val MATCHES "(c\\+\\+)?(17|1z)")
qtConfCommandlineDisableFeature(c++20)
qtConfCommandlineDisableFeature(c++2b)
elseif(val MATCHES "(c\\+\\+)?(20|2a)")
qtConfCommandlineEnableFeature(c++20)
qtConfCommandlineDisableFeature(c++2b)
elseif(val MATCHES "(c\\+\\+)?(2b)")

View File

@ -8,6 +8,8 @@ if(QT_FEATURE_gui AND QT_FEATURE_jpeg AND NOT QT_FEATURE_system_jpeg)
endif()
qt_install_3rdparty_library_wrap_config_extra_file(BundledLibjpeg)
# Needed for freetype, because it links against WrapPNG
qt_find_package(WrapPNG PROVIDED_TARGETS WrapPNG::WrapPNG)
if(QT_FEATURE_gui AND QT_FEATURE_freetype AND NOT QT_FEATURE_system_freetype)
add_subdirectory(freetype)
endif()

View File

@ -1,4 +1,4 @@
FreeType 2.13.2
FreeType 2.13.3
===============
Homepage: https://www.freetype.org
@ -32,9 +32,9 @@ sites. Go to
and download one of the following files.
freetype-doc-2.13.2.tar.xz
freetype-doc-2.13.2.tar.gz
ftdoc2132.zip
freetype-doc-2.13.3.tar.xz
freetype-doc-2.13.3.tar.gz
ftdoc2133.zip
To view the documentation online, go to
@ -94,7 +94,7 @@ Enjoy!
----------------------------------------------------------------------
Copyright (C) 2006-2023 by
Copyright (C) 2006-2024 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used,

View File

@ -4,7 +4,7 @@
*
* Unix-specific FreeType low-level system interface (body).
*
* Copyright (C) 1996-2023 by
* Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,

View File

@ -4,7 +4,7 @@
*
* Debugging and logging component for Win32 (body).
*
* Copyright (C) 1996-2023 by
* Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,

View File

@ -1,3 +1,43 @@
CHANGES BETWEEN 2.13.2 and 2.13.3 (2024-Aug-11)
I. IMPORTANT CHANGES
- Some fields in the `FT_Outline` structure have been changed
from signed to unsigned type, which better reflects the actual
usage. It is also an additional means to protect against
malformed input.
II. IMPORTANT BUG FIXES
- Rare double-free crashes in the cache subsystem have been fixed.
- Excessive stack allocation in the autohinter has been fixed.
III. MISCELLANEOUS
- The B/W rasterizer has received a major upkeep that results in
large performance improvements. The rendering speed has increased
and even doubled for very complex glyphs.
- If the new configuration option `TT_CONFIG_OPTION_GPOS_KERNING` is
defined, `FT_Get_Kerning` understands rudimentary GPOS kerning
(for TrueType fonts only). This is not enabled by default since
its usage is very limited, mainly for legacy applications that
have to support TrueType fonts automatically converted from 'kern'
tables to GPOS kerning. If you need proper (GPOS) kerning support
please use a higher-level library like HarfBuzz.
Code contributed by David Saltzman <davidbsaltzman@gmail.com>.
- The internal structures `PS_DesignMap` and `PS_Blend` related to
parsing of old Multiple Masters fonts have been removed from the
public header file `t1tables.h`.
======================================================================
CHANGES BETWEEN 2.13.1 and 2.13.2 (2023-Aug-25)
I. MISCELLANEOUS
@ -5668,7 +5708,7 @@ Extensions support:
------------------------------------------------------------------------
Copyright (C) 2000-2023 by
Copyright (C) 2000-2024 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used,

View File

@ -139,7 +139,7 @@ IV. Overriding default configuration and module headers
----------------------------------------------------------------------
Copyright (C) 2003-2023 by
Copyright (C) 2003-2024 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used,

View File

@ -297,7 +297,7 @@ to access them.
------------------------------------------------------------------------
Copyright (C) 2002-2023 by
Copyright (C) 2002-2024 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used,

Some files were not shown because too many files have changed in this diff Show More