Commit Graph

68491 Commits (fdd8924dcee4d7c8555fbbdb40f9b55fa1e62897)

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

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

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 633c136596.

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: 4b755bc11a
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 9c56a77027

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