The thread ID is already initialized inside QThread::start() while
the thread lock is taken. This is completed before the attempted
initialization in QThreadPrivate::start() because it tries to take
the same lock.
Task-number: QTBUG-96846
Pick-to: 5.15 6.2
Change-Id: Ic9588f3e2e2f3c2180afbed8ec01155b33043eb3
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Using MS Gothic UI as the fallback on Japanese locale has been
outdated for many years. The default font on Japanese is Yu Gothic UI,
and this caused mismatches between Japanese text when using the
fallback and when just relying on the default.
[ChangeLog][Text] Made the primary fallback font on Japanese
locale "Yu Gothic UI" (the default system font).
Fixes: QTBUG-96689
Pick-to: 6.2
Change-Id: I9cf34410619ff4a2ceb9b03d523018c5061c3634
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Previously pro2cmake assumed that all .pro were internal Qt projects
like qtbase/src/corelib.pro and generated private api calls like
qt_internal_add_module().
Public CMake API calls (like qt_add_executable) were only generated if
an --is-example command line flag was passed to the script or if the
.pro file was located under the examples subfolder of a qt repo source
directory (indicated by the presence of a .qmake.conf file).
Change the logic to always generate public CMake API code by default,
unless a .cmake.conf/.qmake.conf file is encountered with a valid repo
module version inside, in which case apply the old heuristic of
checking for the ./examples subfolder.
The intention is to have a sensible default so that Qt users can use
the script to more easily migrate their qmake projects without having
to explicitly specify the --is-example flag.
Pick-to: 6.2
Task-number: QTBUG-96799
Change-Id: I38f4f1b349a5b9688cf7bc5914d4fde72e660a98
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Adapt to fb656c036d which removes
.qmake.conf files in repos by searching for either .qmake.conf or
.cmake.conf.
The locations of those files are only used to compute relative paths
based on the directory where the conf file is.
For now, remove the warning if a conf file is not found, because we
intend to change the script to generate user project code by default,
instead of Qt internal project code and the warning looks scary.
Pick-to: 6.2
Task-number: QTBUG-96799
Change-Id: I301e93d2ce5c05a52877eb6ed9eb9cee54fc5b15
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
We allow QWidget::closeEvent to "delete this", and verify that this works
in the tst_QWidget::testDeletionInEventHandlers test function. Sadly,
that test didn't reliably catch the issue introduced in
28b14b966f, where the receiver is accessed
after the delivery of QEvent::Close.
Handle the QWindow event delivery explicitly so that we don't need to
access the receiver after the event has been delivered.
There's nothing we can do to make the test fail more reliably in CI.
A QWindow deleting itself in closeEvent will still crash; perhaps we don't
want to allow that anyway.
Change-Id: I2b5c2d11ded71c4f22ae9862cdc459e1f93b3374
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Rather than fail with obscure can't find Qt packages errors when the
Webassembly CMake toolchain file can not be found, error out with a
clear error on how to ensure it is found.
Pick-to: 6.2
Task-number: QTBUG-96843
Change-Id: I0f34cdcde05efb25c93017f3fd365186335ed52c
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Try to to chainload the emscripten CMake toolchain file from the
EMSDK env var if it is set, instead of requiring the user to explicitly
specify a path to the file via QT_CHAINLOAD_TOOLCHAIN_FILE.
The order in which the toolchain file is chainloaded becomes is as
follows:
1) The initial toolchain file path that was specified when configuring
qtbase is set written as the initial value of
__qt_chainload_toolchain_file in qt.toolchain.cmake
2) If EMSDK env var is set, it overrides the value from 1)
3) If QT_CHAINLOAD_TOOLCHAIN_FILE cache var is supplied it overrides
the value from 2)
Whichever value ends up in __qt_chainload_toolchain_file is
checked too see if the file exists.
If it exists it gets included, if it doesn't, a warning is issued.
This checking logic is a bit crude and should be improved and unified
with the Android chainload checking, but the current change already
improves the behavior for users of Qt.
Pick-to: 6.2
Task-number: QTBUG-96843
Change-Id: I5da58a329f659086aaaee765c9399d0369021b22
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Split qt_auto_detect_wasm into multiple helper functions and place
them in a new QtPublicWasmToolchainHelpers.cmake file.
We want to use them to try and detect the CMake toolchain
file location from within the generated qt.toolchain.cmake
file whem configuring a user project.
Pick-to: 6.2
Task-number: QTBUG-96843
Change-Id: Id8c2350e6dbe3c994b435681353bdaee114249a7
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Introduce a new macro qt_internal_return_unless_building_tools which
simply calls return() if tools are not built. This macro is supposed to
be called after qt_internal_add_tool().
Using this macro avoids having to special-case code for when
qt_internal_add_tool() creates imported targets in cross-builds.
Adjust pro2cmake accordingly.
Task-number: QTBUG-85084
Change-Id: I9e1c455c29535dd8c318efa890ebd739c42effc1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Task-number: QTBUG-96844
Change-Id: I9af60ef0cf3def699e58b3477b647f2e071afa40
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Put stars after spaces, not before; indent cases level with switch.
Change-Id: I1dc29d0729d5be449b8123e15510177d814d42da
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The compiler ought to figure them out, but we can just help it.
Change-Id: I42eb903a916645db9900fffd16a4981ac966f982
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
The multi-state return code was a legacy of how Arvid wrote the ELF
parser code back in the day, the fact that it scanned for two different
types of plugins in Qt 4 and that the metadata could exist in different
places. None of that matters nowadays: who cares if the file is a
corrupt binary, not a valid binary, does not have the right
architecture, or has no suitable section? It's not a plugin, period.
The Qt 4 plugin mechanism was removed for Qt 5.0 in commit
7443895857 ("Remove support for Qt 4 style
plugins").
Change-Id: I42eb903a916645db9900fffd16a442d800399b98
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
The Cocoa QPA plugin no longer tracks popups, but dispatches enter/leave
events when popups show and hide. So the special handling in tests and
QWidgetWindow can go away now.
Change-Id: Ib6ef00689de231996e5e57ecdd8fd0d4c861d68b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
If we can't mmap(), then libdl won't be able to either.
Pick-to: 6.2
Change-Id: I42eb903a916645db9900fffd16a492a1ac25903f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Debug builds were broken.
WARNING: tst_QPluginLoader::errorString() testdata bin/libtst_qpluginloaderlib.dylib could not be located!
$ ls -l bin
total 112
-rwxr-xr-x 1 tjmaciei staff 77296 Sep 14 08:46 libtheplugin_debug.dylib
-rwxr-xr-x 1 tjmaciei staff 33408 Sep 14 08:46 libtst_qpluginloaderlib_debug.dylib
Pick-to: 6.2
Change-Id: I42eb903a916645db9900fffd16a4bb0a51ef967c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Since macOS doesn't give us any event when a modal window opens,
we need to do so ourselves explicitly so that the current mouse
window gets a leave event when e.g. a popup opens, and an enter
event when the popup closes again. The case for modal dialogs is
partially handled by QGuiApplication already.
Note: We cannot rely on the transientParent of the opening/closing
window, as it's nullptr for QMenu windows even if the QMenu has
a widget parent.
Add a test for enter/leave events when a secondary window opens,
covering both the dialog and the popup case. For the dialog case,
we sometimes get two Enter events when the dailog closes, which
we have to tolerate for now.
To make the test pass on b2qt platforms, fix the offscreen plugin
to explicitly send enter/leave events in the same way as Cocoa
now does.
Fixes: QTBUG-78970
Pick-to: 6.2
Change-Id: If45e43e625e8362c3502c740154f6a6a8962b9e9
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
We're not using the internal m_image of QRasterBackingStore, nor its
m_requestedSize, so inheriting it was just causing confusion when we
ended up in QRasterBackingStore::scroll(), operating on those members.
Pick-to: 6.2 5.15 5.12
Change-Id: I26561209c0a19777577724728f0ad62e07673577
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Remove an unused and deprecated enum value that was giving
compile errors due to a missing case statement when compiling
locally with -developer-build.
Pick-to: 6.2
Change-Id: Ieca2124beda122f603acfd1b5f5746284a8a1a6c
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
The jarsigner command that was being used was malformed before the
file path leading to wrong signing command. A sample of the malformed
command part "-storepass password⍣/path/to/package", note the char
after 'password'. So having auto produces a QStringBuilder that's
returning the malformed char.
Fixes: QTBUG-96838
Change-Id: I5477f6913a74d79ebaf029ef7f4e2745c9f7ced0
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit f492790611fe15a4745c8ad0c97259f438c91b6b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Also tidy up the inline TODO comments to reduce duplication and address
some minor inconsistencies.
Task-number: QTBUG-95712
Pick-to: 6.2 6.2.0
Change-Id: Ic0d27f3c0a356fd311bba95de967faaea05e0f0a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This reverts commit efb90f6e7e.
Reason for revert: behavior change for signal listeners
Change-Id: Ibe3c5d496cd61a9fccab17a10cc9fda8334fc9d4
Reviewed-by: Björn Schäpers <qt-codereview@hazardy.de>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
After 6589f2ed0c it's possible and expected
that each platform plugin will register the input devices it discovers.
Task-number: QTBUG-46412
Pick-to: 6.2
Change-Id: I76c9252bc14c5c8e6af3ecc9b26211f6f301103d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The documentation links on `msdn.microsoft.com` now redirect to
`docs.microsoft.com`.
While the redirection works, our script to catch broken links on
dev-snapshots builds of the documentation doesn't handle redirection
correctly, reporting it as broken.
Both to appease the broken-links script and to avoid an unneccesary
redirection, the links were modified to point to the equivalent address
in the new domain.
Furthermore, the link to the `Winsock 2 Socket Handle` was moved to be
an `\externalpage` link, as it was used in two different places.
Additionally, the `\externalpage` link titled `Dirext X SDK` was removed
as it was not used in any part of the documentation.
Task-number: QTBUG-96127
Pick-to: 6.2 6.2.0
Change-Id: I07f0ae8d610a7f8322b892a2fa37a5cc1769289e
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Style masks such as NSWindowStyleMask{Resizable,Miniaturizable}
affect whether the window has a title bar button for the action,
but also whether the window can be resized or minimized through
other means, for example if the window border can be dragged
to resize.
By decoupling the visibility and enablement of the title bar buttons
from the style mask we can individually control the buttons, and
leave the style mask set to enable behaviors we always want. We
were already doing this for the NSWindowZoomButton.
Unfortunately AppKit not only checks NSWindowStyleMaskMiniaturizable
during a call to miniaturize, but also whether the title bar button
is enabled. To allow minimizing windows without the titlebar button
we detect the situation and give AppKit a NSWindowMiniaturizeButton
that we haven't disabled. The alternative would be to temporarily
enable the NSWindowMiniaturizeButton during the minimize, but this
results in the button flashing yellow for the duration of the
animation.
Task-number: QTBUG-65637
Task-number: QTBUG-46882
Task-number: QTBUG-64994
Task-number: QTBUG-71485
Change-Id: I2c1a9564d8b7516476aa018b2820670199124bc2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Since QHash in Qt6 does not guarantee stable iterators after
an insert it crashed from time to time.
- possible crash at the erase call if pit is invalid
- possible crash at insert if pit is invalid
QHash<QString, int> myHash;
auto i = myHash.find("foo");
myHash.insert("foo", 789);
i.value(); // possible crash
myHash.erase(i); // possible crash
Task-number: QTBUG-96790
Change-Id: Ia9b53d46b8d1fef81ab5a130c229bc9e936f6521
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit e60951eef4f0ade944e2f93ffe2f44abfc76d97a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
By default Conan uses 'minor_mode' policy for 'python_requires'
dependencies. This causes updates in 'qt-conan-common' package not to
land into users when invoking e.g. "$conan instal .. --update".
Fix this by enforcing recipe revision mode so any changes to
'qt-conan-common' recipe is received by the clients when updating
packages.
Pick-to: 6.2
Change-Id: I225965aa76c39552bd4adc93d7e68e0ae0b38d56
Reviewed-by: Toni Saario <toni.saario@qt.io>
Provide the information an implementor needs in order to be able to
implement an logging backend.
Change-Id: I7bb522de57149dad843e01a8afa9f8891d011d29
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The one place that actually called it with file and line number was
internal to QtTest, so could call QtTestLog::warn().
Change-Id: I8be10fc81996cc3de4d2eea3ecedc59671ffe759
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
It's the recommended replacement when file and line aren't known, and
simplifies the code in any case, thanks to taking format and varargs.
It incidentally also enables tests to tell QtTest's custom message
logger to anticipate its warnings, when they arise.
Fixes: QTBUG-67702
Change-Id: I10c883f4dd0b69dca6e59e0dbd55ab318f1938f4
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
QT_VERSION is now at least QT_VERSION_CHECK(6, 3, 0), so remove all
checks against Qt 6.0.0 or earlier. They are superfluous. Tidied up in
some places in the process, particularly #include order.
Change-Id: I2636b2fd13be5b976f5b043ef2f8cddc038a72a4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
There is absolutely nothing we can do if the render target has no
stencil buffer, but print at least a warning in debug builds to give a
hint to the developer.
Pick-to: 6.2
Task-number: QTBUG-96786
Change-Id: If7f84f28f9bc9b3dadd01d0816c8db4015a1db0b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The current implementation found a QScreen by using the
position of the mouse in a call to QGuiApplication::screenAt().
From the documentation, this function is allowed to return
nullptr if the position is outside the screen.
From the stack track in the bug report, it seems very likely
that the mentioned call returns nullptr. This is strengthen
by the fact that the crash happens for messageboxes that are
maximized, so that you need to click on the upper corner of the
screen to close it. And then only when HiDPI scaling is in use
at the same time.
This patch will change the code to just use the screen that the
widget is on instead. If no screen can be resolved, the call will
default to primary screen.
Fixes: QTBUG-96639
Pick-to: 6.2
Change-Id: I31f0301318b358be9619caa31cc831b9598d5f90
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
We show non-modal and Qt::WindowModal native dialogs as modeless
panels by calling makeKeyAndOrderFront on the panel. When we exec()
a dialog on the other hand, we start a modal event loop by calling
runModalForWindow. This method will display the dialog and make it a
key window before running the modal event loop. So we don't need to
and shouldn't call makeKeyAndOrderFront explicitly before that.
Doing so will make Cocoa lose the reference to the previous active
window (as it maintains only one level of previous active window) and
wrongly choose the main window as key after the dialog closes. Avoiding
the call to showModelessPanel for Qt::ApplicationModal dialogs fixes it.
Also, in order to display a modal when show() is called and app modality
is set via setModality, display it as a modeless dialog as well. This
keeps the same behavior we have currently, but it is still not the right
way to handle it as we don't respect the modality set by the user.
A clean-up of that logic to come in a follow-up commit.
Fixes: QTBUG-42661
Pick-to: 5.15 6.1 6.2
Change-Id: I8f33e3866b191d775a64a5d9ec3dd65736114e62
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The current implementation configured NSTrackingArea to be active
while the application was active (NSTrackingActiveInActiveApp).
But because of a bug in AppKit, the tracking area would sometimes
stop being updated, with the result that no mouse events was being
sent from AppKit. One way to trigger this bug would be to
deactivate the app using cmd+tab (fast enough so that the task
switcher is not showing), and reactivate it again using a
mouse click.
To work around this issue, this patch will instead configure
the tracking area to always listen for tracking events, even when
the application is inactive (NSTrackingActiveAlways). By doing so,
we bypass the apparently broken behavior in AppKit related to
activation. The downside is that we then also get tracking events
while the application is inactive, which is against how Qt should
work. So we therefore need to now check if the application is active
before we forward any tracking events to QWSI.
With NSTrackingActiveAlways we no longer get enter/leave events
from AppKit when the application is activated/deactivated and the
mouse stays on top of the application, so we now also need to handle
this explicitly from the application delegate. Since we already need
to keep track of which QWindow is under the mouse to be able to send
out enter/leave from mouse moves, we use the same variable
(s_windowUnderMouse) for this purpose as well.
Because of QTBUG-35109, there was already a code path in QCocoaWindow
that sent out an enter event when a window became key. This is no
longer needed now that we send out enter/leave when the application is
activated/deactivated. It's also questionable if sending an enter
event based on a window's key status is correct, since we in Qt should
also send out enter events for inactive windows. So we remove this code
path since it interferes with (both the old and) the new implementation.
Fixes: QTBUG-36926
Task-number: QTBUG-94447
Change-Id: I5c1105bc3102925c9c65964b4a7d1e02efd01735
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Used from qt_message_fatal(), but is useful in other situations too.
Change-Id: I3c0e438536d40271061c76d954c7878abfe37b8e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Needed for subsequent change that will check and error out if the
version is lower than 3.16. We do that to ensure all policies
introduced by CMake up to version 3.16 have their behavior set to
NEW.
Pick-to: 6.2
Task-number: QTBUG-95018
Change-Id: Ieaf82c10987dd797d86a3fd4a986a67e72de486a
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
In non-prefix builds, we want to prevent users from accidentally running
"cmake --install". We did that by replacing cmake_install.cmake with an
empty file.
The responsible target remove_cmake_install is visible in IDEs, appears
in the build output, and the approach is hacky.
It's cleaner and easier to add bail out code at the top of
cmake_install.cmake. This is now done when calling qt_build_repo_begin.
As a bonus, print an informative message on installation.
Change-Id: I022b36289358ba09cac8b79781f44cd7b93113f7
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
We were working under the assumption that the NSWindowStyleMaskBorderless
style mask excluded all others, on account of having the value 0. But in
practice this does not seem to be the case, and you can combine the mask
with many of the other masks. The only mask that is mutually exclusive with
the borderless mask is NSWindowStyleMaskTitled (with a value of 1).
Clarify this be restructuring QCocoaWindow::windowStyleMask().
Task-number: QTBUG-71485
Change-Id: I4bbd603fd2373c11f76e84b72a2a60aa2356b032
Reviewed-by: Doris Verria <doris.verria@qt.io>
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Calls to QTestResult::setCurrentTestData() are handled via an RAII
class, QTestDataSetter, that ensures this final call passing nullptr
was redundant.
Change-Id: I7788e3ce898e5628d5590ef9d34182f05e85fe50
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The thread build variant is not implemented; the no-thread one simply
returns the current thread. As this has no utility at best and
misleading at worst, remove those functions.
Change-Id: I93ee45ae7d55e3a7ad1f03168b14149a5d4c9253
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
When we load by name we used to pass an empty QList to the backend as
the list of requested features. That's not ideal if a backend were to
selectively initialize components, so let's just pass the list of
supported features.
Not a problem in any current backend but it looks weird.
Pick-to: 6.2
Change-Id: Ib022778b08d32e4057103a86bfdda9e17e6ebdaf
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>