Commit Graph

58088 Commits

Author SHA1 Message Date
Johannes Kauffmann
2ce2992f5e tst_qprocess: remove unused loop counter
Change-Id: I1eece5a676cfa02fff27be01f25b07ddd82c40d6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-09-20 19:09:31 +02:00
Tor Arne Vestbø
8e577b6d10 windowflags: Add control to toggle Qt::NoDropShadowWindowHint
Change-Id: I53b496c7b27a73cfb6052af3cd8643a971609523
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-09-20 16:34:57 +02:00
Tor Arne Vestbø
6fc751aedf windowflags: Report QWindow compound window states
Pick-to: 6.4
Change-Id: I44b923df6851d0f51ac39bcbb4a569cb2fde775d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2022-09-20 16:34:57 +02:00
Tor Arne Vestbø
55a7385296 macOS: Report compound window state when state changes
Otherwise we lose the fact that the window is both maximized and
minimized, if the minimize transition is asynchronous, as it is
on macOS 13.

Task-number: QTBUG-104210
Pick-to: 6.4
Change-Id: I76199e98927e6e4a0f379d78db0603faa80aa4b0
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2022-09-20 16:34:57 +02:00
Tor Arne Vestbø
9796670732 Clarify that FramelessWindowHint does not guarantee fixed sized windows
Depending on the window manager or operating system the act of making
a window borderless may also affect the ability for the user to move or
resize a window interactively. However, this is a side effect of making
a window borderless, and should not be relied on. The correct way to
ensure a window has a fixed size it to use setMinimum/MaximumSize.

Fixes: QTBUG-103503
Fixes: QTBUG-106710
Pick-to: 6.4
Change-Id: I6d82380f5a9af1f08b12cb445792ecbf71bb0377
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-09-20 16:34:57 +02:00
Tor Arne Vestbø
dc1f931a91 macOS: Handle asynchronous deminiaturizing of windows
As of macOS 13 this operation is now asynchronous.

Pick-to: 6.4 6.2 5.15
Change-Id: I9431e24803c53a3fa455707b20a6814290718766
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2022-09-20 16:34:57 +02:00
Mikolaj Boc
b4780f1990 Get rid of copypasted code between isWindowBlocked's overrides
The code in QGuiApplication::isWindowBlocked and
QApplication::isWindowBlocked is very similar, a result of copying and
pasting. Due to the copying it is difficult to modify the code and the
implementation is hard to comprehend, too.
There are ultimately only two parts that are different. First is that
QApplication's override may also specify a certain window as
non-blockable if it is a popup window. Second, default modality is
computed in QApplication if a modal window does not have one assigned.
The differing parts have been extracted following the template method
design pattern.

Pick-to: 6.4
Change-Id: I3b9aa206a3c7211fe022730943bf6f76aa5ae6d2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-09-20 16:34:57 +02:00
Mikolaj Boc
de56047620 Redirect resize from QSizeGrip to system resize in wasm compositor
Using two different resizing techniques (one in QSizeGrip, one in
QWasmCompositor) leads to strange behavior while resizing wasm windows.
Redirect the QSizeGrip's resize to wasm's compositor resize (which might
be considered system resize) to avoid that.

Change-Id: Idfc062643caac3ceee879bfb875d943aade28378
Reviewed-by: David Skoland <david.skoland@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2022-09-20 16:34:57 +02:00
Venugopal Shivashankar
4a338aa180 Doc: Update the animation framework overview
- Clarify how the object ownership works
- Language clean up
- Update the snippets

Pick-to: 6.4 6.3 6.2
Task-number: QTBUG-106071
Change-Id: I7caf42a150ef82dee920df4d03db6fd988796bd4
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2022-09-20 14:28:08 +02:00
Santhosh Kumar
82e7ac23a0 Clear WA_UnderMouse attribute when widget gets hidden
From 6.3 onward, hiding a widget doesn't automatically clear
QT::WA_UnderMouse attribute.

This leads to multiple buttons drawn with highlighted rectangle at the
same time (refer bug). The behavior is observed after
commit 0246bfd40a made as part of
bug QTBUG-53286.

This patch clears WA_UnderMouse attribute in widget hideChildren() and
subsequently, widgets that are hidden will not inherit this attribute
on the next show operation.

The attribute will be set only when the widget is under mouse cursor.

Fixes: QTBUG-104805
Pick-to: 6.4
Change-Id: I4988eb72577fd557a328fd08bb09fa2fbded3138
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-09-20 10:34:08 +00:00
Vladimir Belyavsky
013c346a8d QTextLayout: fix maximumWidth() for a text containing line separator
When laying out, we need to increase layout's maximum width _only_
if the previous line was not explicitly wrapped by a line or paragraph
separator, or if the current line's width is greater than the
previously accumulated layout's maximum width.

Fixes: QTBUG-89557
Fixes: QTBUG-104986
Pick-to: 6.2 6.4
Change-Id: Ib7cc4b9dda8f20166dcbd5cfd3b56424bb33d14a
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2022-09-20 06:52:21 +00:00
Michael Weghorn
53086094d8 a11y: Fix QAccessibleTableInterface::selectedRows doc
While QAccessibleTableInterface::selectedColumns returns
the selected columns, QAccessibleTableInterface::selectedRows
should return the selected rows.

Change-Id: I0a4972e7c46536aa813d35512c02336cc1efb286
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-09-19 20:14:20 +02:00
Liang Qi
571e7a41f5 tests: improve tst_gestures on GNOME
There are some issues when testing QGraphicsView on GNOME(xorg)
overlapping with the default top bar. This change only move
the view a bit.

Notes:

* There is no CentOS in CI any more.
* panelPropagation() and panelStacksBehindParent() failed in CI
and local vm on Ubuntu 20.04, but only in CI on Ubuntu 22.04.

For example, we can turn the top bar off:

In Extension Manager, install Just Perfection, and disable Panel
in Visibility in it, all tests will pass too.

Task-number: QTBUG-84258
Task-number: QTBUG-103054
Pick-to: 6.4 6.2
Change-Id: I05c262540c85af00182cd142760c4a29554b04c9
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-09-19 14:39:28 +00:00
Bartlomiej Moskal
7ae9632929 Examples doc: Tags fix for QtQuick examples
Four examples in QtQuick module had wrong tag in qdocconf file:
-QQuickRenderControl D3D11 Example
-Scene Graph - Direct3D 11 Under QML
-Scene Graph - Metal Texture Import
-Scene Graph - Metal Under QML

The first two are specific to Windows. The other two are IOS specific.
They were all marked as "android".
This commit changed those tags to correct one.

Pick-to: 6.4 6.4.0 6.3
Fixes: QTBUG-106436
Fixes: QTBUG-106438
Fixes: QTBUG-106439
Fixes: QTBUG-106469
Change-Id: I3d8d3cb54e4e552d7574c7c2f1d59437374c6446
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
2022-09-19 11:25:36 +00:00
Mikolaj Boc
a5205d983b Set NO_EXCEPTIONS on executables on wasm
This reflects the true state of exceptions on WASM, which are always
disabled (DISABLE_EXCEPTION_CATCHING is always set with 1).

Change-Id: I7b681846159caf61f291f78a7b4ddf5260dc341f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-09-19 12:44:21 +02:00
Aleksandr Reviakin
aee64bbe13 wasm: capture pointer unconditionally on PointerDown event
The pointer events weren't captured previously
if, for example, mouse was pressed inside the window
and released outside of the window.

Pick-to: 6.4
Fixes: QTBUG-71948
Change-Id: Ie50e5c132fa03046f0c5b321c35a58cb9f34b67a
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2022-09-19 12:14:14 +02:00
Aleksandr Reviakin
81d9b5ada4 wasm: add DejaVu Sans as a fallback font
Add fallback font which supports emoji.
Similar logic of addding additional fallback fonts is used
for some other platforms.

Pick-to: 6.4
Fixes: QTBUG-87339
Change-Id: Iad9e7071bcc3c5bb1c11c6c745fd86f7d0f7860b
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2022-09-19 12:14:14 +02:00
Yuhang Zhao
dfabeead97 QWindowsKeyMapper: whitespace fixes
Code style fix, add some necessary whitespaces.

Change-Id: Ib6c5bf503faacec5dad804154ae992b2b0a49162
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-09-19 18:14:13 +08:00
Mikolaj Boc
bb582f7fd5 Use the js test runner for all tests on wasm
Make cmake changes that have ctest run the emrun test runner for
all tests that are build for wasm.

Change-Id: I8c07068d79cfd0d745dbcc3d3f025c7c48fe1069
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-09-19 08:54:02 +02:00
Mikolaj Boc
38049164c3 Make the clipboard paste from the outside work correctly
During the previous refactoring, two exceptions that triggered
native copy/paste events were omitted.

Fixes: QTBUG-106668
Pick-to: 6.4.0 6.4
Change-Id: Ie61dd6a0c1d9d2fdd47bd94be055d0221feae25b
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2022-09-18 21:44:35 +02:00
Thiago Macieira
9536a0ad48 {QSharedMemory,QSystemSemaphore}Private: use NSDMI for the members
Change-Id: If4c23ea3719947d790d4fffd171524225cc125fc
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-09-17 15:52:47 -07:00
Tor Arne Vestbø
705665957b macOS: Remove hard-coded logic for determining if key event has text
The normal flow for a keyDown event when sent to a text input enabled
view (NSTextInputClient), is that it's sent through interpretKeyEvents,
which in turn goes through the input methods, and result in either
composing (marking) text, inserting text, or executing a text editing
command such as moving the cursor to the beginning of the line.

  https://apple.co/3qDhwNb

In our case, we prefer to treat "simple" text insertion (non-composed
text) outside of the Qt input method protocol, and send these as normal
key events instead. The same applies when a key event results in a text
editing command that we don't handle.

The problem is that in the latter case, the key event would contain the
text that resulted from e.g. ⌘+K, or one of the function or arrow keys,
which in many cases would not be suitable for inserting into a text
field by a naive client that trusted the text property of the QKeyEvent.

To work around this two exceptions were added; first in 4dbce2a469
to ignore text when inside the U+F700-U+F8FF unicode range (arrow keys,
function keys, etc), and second in 933fab137d to ignore text for
events that had one or both of the control or command modifiers.

Unfortunately this hard-coded logic was not taking into account that
some keyboard layouts may produce text that match these exceptions,
for example ^⌥+ю with a Russian keyboard layout should result in
inserting a period.

Instead of continuing to add hard-coded exceptions to this logic,
(for example by only filtering out single-modifier events), we
instead use the information that the text input system gives us
via doCommandBySelector to decide whether the key event should
have text or not.

Note: We have similar workarounds for detecting text that is not
suitable for text insertion in other places of Qt, for example in
QInputControl::isAcceptableInput(), but since we can't assume the
client uses QInputControl for their text input needs we need to
filter out the text earlier than that.

Fixes: QTBUG-106393
Task-number: QTBUG-36281
Task-number: QTBUG-35734
Pick-to: 6.4
Change-Id: I7769098cba1c605f6fdb6b23964eb614578724bb
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-09-17 21:37:20 +02:00
Alexey Edelev
3800bcf526 Fix the way deffered files are added to a CMake source tree
Use relative paths when adding deffered files to the target sources.
The use of real paths causes issues in the build.ninja file on
Windows platforms.

Amends 3df618b8d9

Task-number: QTBUG-99808
Change-Id: I15b7c695e5f281f2a0ee96ba25ef27baa74ebd37
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-09-17 15:03:38 +02:00
Samuel Mira
072387edec Android: Fix flickering on window resize and show keyboard
Changed to use display getMetrics which will return the size of the
application window, and use getRealMetrics to obtain the size of the
largest region accessible to the app.
I updated the fullscreen mode to use the new sizes.

Task-number: QTBUG-41170
Task-number: QTBUG-66727
Pick-to: 6.4 6.3 6.2 5.15
Change-Id: Ic25555ed2e1b910b3fdbc0f3a31e3a19763a04eb
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2022-09-17 08:42:48 +00:00
Thiago Macieira
66485a4c5d QSystemSemaphorePrivate: remove unused semaphoreLock member
Change-Id: If4c23ea3719947d790d4fffd17153314cc58c2a7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-09-16 17:20:19 -07:00
Thiago Macieira
de25c1d27d QSharedMemory: remove QT_NO_QOBJECT
This was only needed for bootstrapped builds, but QSharedMemory is no
longer part of it since commit 75082c9f20.

Change-Id: If4c23ea3719947d790d4fffd171522c0d5f9aafb
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-09-16 17:20:18 -07:00
Alexandru Croitor
469dbe5c6d CMake: Fix _qt_is_test_executable assignment for tests
_qt_is_test_executable can only be set on a test that is backed by a
real target. QMLTESTs might not backed by an executable target, if
they are missing cpp SOURCES.

Which led to errors like

 CMake Error at
  cmake/QtTestHelpers.cmake:510
 (set_target_properties):
  set_target_properties Can not find target to add properties to:
  textedit
 Call Stack (most recent call first):
  tests/auto/qmltest/textedit/CMakeLists.txt:10 (qt_internal_add_test)

Amends 62c681a599

Change-Id: Ie66fd3e94484562061f851c0a034629959d091da
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-09-17 00:30:39 +02:00
Allan Sandfeld Jensen
0e90bdbaa4 Fix flaky FP32x4 test
The composition implementation may act unexpectedly on Inf or NaN input
values. This change avoid those values, without changing the current
implementation.

Pick-to: 6.4
Fixes: QTBUG-101236
Change-Id: I8e4ee67f53093b7f81e014b28d8a028ba2ddcc47
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2022-09-16 21:02:31 +02:00
Thiago Macieira
864fbd6582 tst_QFile::setPermissions/Unix: test both chmod() and fchmod()
On Unix, we have the fchmod(2) system call that changes the permissions
of an open file descriptor. This commit adds a test for that, by not
closing the QFile before setPermissions().

Pick-to: 6.4
Change-Id: If5d5ef6220874ae8858efffd171255b9f20ed501
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-09-16 08:37:50 -07:00
Thiago Macieira
0193b4d219 tst_QFile::setPermissions: add QScopeGuard to remove temporary file
Pick-to: 6.4
Change-Id: If5d5ef6220874ae8858efffd17125580b5943cc2
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-09-16 08:37:50 -07:00
Thiago Macieira
4b997d1851 QFileDevice: clear cached permissions on setPermission()
In theory, if we succeed, the permissions should be what we set, but
let's not make that assumption. And if we failed, it might be because
the file disappeared or something else, so re-stat()ing the file is a
good idea.

Pick-to: 6.4
Fixes: QTBUG-7211
Change-Id: If5d5ef6220874ae8858efffd171255506b7bbee0
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-09-16 08:37:49 -07:00
Mårten Nordheim
68f641095c QNetworkReplyFileImpl: Don't emit 'finished' in the ctor
Pick-to: 5.15 6.2 6.4
Fixes: QTBUG-105618
Change-Id: I3bd36fbd5818d54088098e750643c3e2de30496e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2022-09-16 17:02:06 +02:00
Michael Weghorn
ad69ea47f5 a11y: Fix typo in QAccessible::ObjectHide doc
"obscured" is also what the doc uses for QWidget's visible property [1].

[1] https://doc.qt.io/qt-6/qwidget.html#visible-prop

Change-Id: I0fc5a2672b8d6f43627763e01ffe7ebde17ac6e8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-09-16 17:02:06 +02:00
Tor Arne Vestbø
a661f8c306 Share logic for QScreen property update emitting in helper class
With high-DPI scaling in place QScreen properties like the geometry
can be affected both by screen resolution changes, as well as logical
DPI changes. We want to ensure similar behavior in both cases when it
comes to which change-signals we emit, so centralizing this code makes
sense.

As the update of the cached primary orientation is trivial we do it
unconditionally.

Change-Id: I712005075a4b758180906fb88b2ac187b3dbe1ff
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-09-16 16:32:51 +02:00
Alexandru Croitor
865b1721bd CMake: Fix return value of applicationName() on macOS
QCore::applicationName() is influenced by what values we insert into
the Info.plist file of an application bundle.

We accidentally inserted tokens like ${PRODUCT_NAME} that are meant to
be expanded by xcodebuild, even when using a generator like Ninja.

This caused the applicationName() to report "${PRODUCT_NAME}".

Make sure to only call relevant finalizers for macOS applications
when using a generator other than Xcode.

Amends d5580aa719

Pick-to: 6.4 6.4.0
Fixes: QTBUG-106652
Change-Id: Idbc9c84557a8f17b1302e6969f6eb317e3ef225d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-09-16 14:32:51 +00:00
Mikolaj Boc
62c681a599 Set target property _qt_is_test_executable on all tests
This is needed to later determine what kind of runner should be
selected on WASM for the executable. Tests use the test runner,
whereas other executables use qtLoader.

Change-Id: I75aa361403b72f8e82a288967b8a81b8232d68dc
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-09-16 16:32:51 +02:00
Axel Spoerl
c8cf0f17b8 Add enum class Qt::Appearance
It has been decided to add an appearance property in QStyleHints, which
will be propagated to classes that do not include QPlatformTheme.

Therefore an appearance enum class is added to the Qt namespace, thus
being available to all Qt classes.

Task-number: QTBUG-106383
Change-Id: Icff94b0d7adca954ce74241d6811401d41f053e6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-09-16 12:50:59 +02:00
Thiago Macieira
986fef5ca1 QTeamCityLogger: fix build (INT_MAX undefined)
Change-Id: If4c23ea3719947d790d4fffd171525faa9f9ae09
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-09-16 03:01:58 -07:00
Konrad Kujawa
ec2af0a9df Remove preprocessor conditionals for chrono include
__has_include(<chrono>) is always true, because C++11 chrono include
is required since 6.0.

Pick-to: 6.4 6.3 6.2
Change-Id: I50cb92571bf4f1f86e2f3f2b5f486dd3c3f30f4a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-09-16 08:09:05 +02:00
Thiago Macieira
22d4c67234 QObject: attempt to fix a deadlock introduced by an earlier fix
Commit 71b4d4f150 is likely the source of
the issue. It fixed a race on disconnection, but kept the call to
disconnectNotify() (which is user code) inside the locked section. My
analysis is that by construction the sender object can't be undergoing
concurrent deletion anyway at this point. All call sites
(QObject::disconnect or the signal-slot activations but before the slot
is activated) imply that the user code that reached here cannot itself
be racing the deletion.

There may be one race condition left: if the same signal was connected
earlier to a slot via queued connection and that slot deletes the sender
asynchronously. A synchronous deletion is handled by doActivate(), so
the single-shot connection is never activated in the first place, but an
asynchronous deletion could race past that check and delete the sender
while QObjectPrivate::removeConnection is running. However, I'd call
this a mistake in user code.

[ChangeLog][QtCore][QObject] Fixed a regression from 6.3 that caused
QObject::isSignalConnected() to deadlock if called from inside
disconnectNotify().

Fixes: QTBUG-106025
Pick-to: 5.15 6.2 6.3 6.4
Change-Id: Ic6547f8247454b47baa8fffd170fe0bdb62cfcaf
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
2022-09-15 19:58:45 -03:00
Mårten Nordheim
7447d73327 tst_QLocale: use fenv everywhere
And remove the platform-specific code.
fenv is available since c++11.

Change-Id: Ia5540be93b54117d4b5e9c7579100039c151dcc5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-09-15 23:41:51 +02:00
Alexandru Croitor
59e08d2105 CMake: Add function to get tool wrapper shell script path
The _qt_internal_wrap_tool_command function has a limitation
that it is not possible to use it when a command needs to be wrapper
in a generator expression.

Provide a lower level API called
_qt_internal_get_tool_wrapper_script_path
to just get the path to the wrapper script, ensuring that the script
is created if needed.

Deprecate _qt_internal_wrap_tool_command, in favor of replacing it
with the new API.

Pick-to: 6.4
Task-number: QTBUG-90820
Task-number: QTBUG-96232
Change-Id: Ie4a4a17178bf2061ae01ee2b03b052d84560abf9
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-09-15 22:47:12 +02:00
Alexandru Croitor
74083599f8 CMake: Rework tool wrapper shell script creation
Instead of creating the tool wrapper shell script only
during a Qt build in QtBuild.cmake,
ensure it is created any time _qt_internal_wrap_tool_command is
called, regardless if we're building Qt or a user project.

As a transitional period not to break compatibility, we also need
to create the script in QtBuild.cmake, until all usages of
QT_TOOL_COMMAND_WRAPPER_PATH are replaced with function calls.
Currently such usages are present in qtdeclarative.

When considering which bin dirs to add to the script's PATH
environment variable assignment, in addition to the build
internals relative bin dir, also add QT_BUILD_DIR,
QT_ADDITIONAL_PACKAGES_PREFIX_PATH and QT6_INSTALL_PREFIX.

QT_BUILD_DIR is important so we always pick up the just-built
but not installed libraries in a prefix build when running just-built
tools.

QT_ADDITIONAL_PACKAGES_PREFIX_PATH is important when building examples
as ExternalProjects in prefix builds, to ensure that the
not-yet-installed tools and libraries are picked up from the repo
build dir, which is passed via QT_ADDITIONAL_PACKAGES_PREFIX_PATH
to the external projects.

QT6_INSTALL_PREFIX is there in case if the build internals relative
dir is located in a different places than the Qt6 package.

Pick-to: 6.4
Task-number: QTBUG-90820
Task-number: QTBUG-96232
Change-Id: I4d76fbbc275ca961379971054f87991adac36539
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-09-15 22:47:12 +02:00
Alexandru Croitor
828e402a19 CMake: Move __qt_internal_prefix_paths_to_roots
Move it into QtPublicCMakeHelpers.cmake so it is available also when
configuring qtbase and the Qt6Config.cmake file is not yet loaded.

Pick-to: 6.4
Task-number: QTBUG-90820
Task-number: QTBUG-96232
Change-Id: I88127fe0439ae26af1d125eb584244d315574a48
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-09-15 22:47:12 +02:00
Alexandru Croitor
59f0f25f71 CMake: Move __qt_internal_collect_additional_prefix_paths
Move it out of QtConfig.cmake.in into QtPublicCMakeHelpers.cmake
so that the Qt6Config file is less cluttered.

Pick-to: 6.4
Change-Id: I772a0cca35d5c03cd688c3f1de34984484444105
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-09-15 22:47:12 +02:00
Mårten Nordheim
91efee1848 QWinRegistry: Add missing include
qwinregistry.cpp(80): error C2079: 'list' uses undefined class 'qt::QList<qt::QString>'

Amends 40523b68c1

Change-Id: Ic622bed4ca3f3d270ab5f6a41f67151b0e40e359
Reviewed-by: Yuhang Zhao <2546789017@qq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-09-15 20:47:12 +00:00
Friedemann Kleint
3696c99a9a uic: Add an option to modify the generated resource import
Historically, resource imports were generated as "import file_rc",
however, pyside6-project generates files by prepending "rc_". Add an
option to flip this.

Pick-to: 6.4
Change-Id: Iee0f161cb2101c8080bd131a6401bbaf4682186d
Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2022-09-15 17:57:54 +02:00
Jan Arve Sæther
30947c7fd4 Pass a parent pointer to the Animation instance to avoid memory leak
The leak is just on termination, but we should show good practices in
our examples

Pick-to: 6.4 6.3 6.2
Change-Id: I39abb7545d3c68a1a537b865ba3fcb5e60c22fbf
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2022-09-15 17:57:54 +02:00
Tor Arne Vestbø
f2a2800b37 QWSI: Remove dead code for macOS-specific shortcut-override handling
The macOS platform plugin exclusively uses handleExtendedKeyEvent() these
days, never the simpler handleKeyEvent(), and always passes false for the
tryShortcutOverride argument, so the special-cased code was never executed.

No other platform passes the optional tryShortcutOverride argument, so
it can be removed completely.

If we ever need to bring back this kind of logic it should live in the
macOS platform plugin, not in the QWSI layer.

We have to keep the existing logic for qt_handleKeyEvent() though,
as that's exercised through QTest::simulateEvent(). The next step
would be to remove the QWindowSystemInterface::handleShortcutEvent()
call in QGuiApplicationPrivate::processKeyEvent() and teach existing
platform plugins, as well as the QTest machinery, to handle shortcuts
explicitly before sending raw key events.

Change-Id: I6eb3fd18c64d1619e33e79f076e25efd299a9ba7
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2022-09-15 15:27:09 +02:00
Joerg Bornemann
f14b8c8294 CMake: Don't set the executable bit for gradlew.bat
This Windows-only file should not be executable on Unix derivatives.
And on Windows it doesn't matter whether we install PROGRAMS or FILES.

This amends commit e0c0feb1d8.

Task-number: QTBUG-106610
Change-Id: I70bfc9576b1feb06c5d69c5f4921a8f83723c753
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-09-15 13:51:45 +02:00