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>
A qmake project built for iOS-simulator tries to find suitable devices
in xcodebuild.mk.
If no suitable device could be found, the build failed with
xcodebuild: error: missing value for key 'id' of option 'Destination'
which isn't that helpful.
Detect the situation in xcodebuild.mk and print an error message.
Pick-to: 5.15 6.2
Fixes: QTBUG-77222
Change-Id: I02f9ab0dd7b8f234bcd8d0ea387927f31ca092e0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
To allow reading from a slot connected to the aboutToClose() signal,
we should call QIODevice::close() just before closing the inner device.
This patch amends 21f3ff65b8.
Pick-to: 6.2
Change-Id: Ic8cd00497e1bdf923b980c26e9ca874b77e82f89
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
In 0c2ca26cd9 we started re-sending the
key event through the input method when we detected a focus object change,
to support the use-case of QAbstractItemView opening an editor and changing
focus in response to the first QEvent::InputMethod event.
Unfortunately this doesn't work as a general approach, because we don't
know what the reason was for the change in focus object. For example,
a client might respond to a Qt::Key_Return press by changing the focus
to the next input element, and re-sending the key event would in that
case insert a new-line in the new focus object -- counter to the
expectations of the client.
Since we can't know the reason for the changed focus object we can't
assume re-sending the key event is safe.
Task-number: QTBUG-54848
Fixes: QTBUG-96726
Pick-to: 6.2 6.2.0
Change-Id: Iea8b166385925cd1a05ef62d5cf763638d9f8a67
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
While the data subobject is at the same position in memory as the
QVariant::Private, using d.data actually activates the union member.
Change-Id: Ie6879b588c8e830ae8b34cfcd8e9ddff8b60b3a6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
- It does however use the Unix backend for system locale, so don't entirely
skip setting environment variable, only leave out LC_MEASUREMENTS.
Pick-to: 6.2
Change-Id: If292f1077851b29da2a21af7c46f4db9c0e4ed19
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Amends ca54b741d6.
operator< is not constrained in MSVC's standard library, either.
Pick-to: 6.2
Fixes: QTBUG-96690
Change-Id: Ibcbb9e53a1f9e8b13786f6d8c01489c61d8d2d7f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
EGL_NO_X11 has been replaced with USE_X11, thus breaking all existing
code out there, including Qt:
https://github.com/KhronosGroup/EGL-Registry/pull/130
Fix this by defining USE_X11 whenever we do not define EGL_NO_X11.
Fixes: QTBUG-96392
Pick-to: 6.2
Change-Id: If8b68caa8c9022477d87169ca2e2a0121a9313e0
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
When setting QT_FEATURE_ values we need to convert the user-provided
FEATURE_ values to the one that is supported by QT_FEATURE_.
Pick-to: 6.2
Fixes: QTBUG-96300
Change-Id: Idd19fbf7f23f351a6c1cfdcedccfaaf6b0aa6e44
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Give a more pragmatic illustration for QT_DEPRECATED_BEFORE.
Make various minor tweaks to wording, use slightly less antique
versions in examples. Make usage of "runtime" standard in qglobal.cpp,
at least, since "run-time" seems to be less used generally.
Change-Id: I1db4950d0d0e97903b1586d98ecba75576493b1c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Commit 6336b535 accidentally removed a call to
applyToMinMaxInfo(). Add it back.
Task-number: QTBUG-96441
Pick-to: 6.2.0 6.2
Change-Id: I26a5d121ed3b4cd9e49e3dd8b371abe71d9a482c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The documentation for QTGUI's `Drag and Drop` links to the XDND
protocol, which is used to manage Drag and Drop on X11.
The previous link seems to have been broken for a few years and was thus
replaced with a link to XDND on Jhon Lindal's site, who is the author of
the protocol.
Task-number: QTBUG-96127
Pick-to: 6.2 6.2.0
Change-Id: Ia46b10c7461129491934eb74355f107f96e04383
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
The android specific options were plain wrong:
- android_sdk_path -> android_sdk
- android_ndk_path -> android_ndk
These reflect the Qt configure options.
Pick-to: 6.2
Change-Id: I0b9283b6603aff8243208216baffe263d37b6541
Reviewed-by: Matti Paaso <matti.paaso@qt.io>
This option should not affect the binary compatibility thus it should
not be part of the package_id of the created Conan package.
Pick-to: 6.2
Change-Id: I6d09cc3933cd28c306ef011bb26346a0993ffcd3
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
The qtbase Conan recipe has 'cmake_args_qtbase" option to pass cmake
arguments. Some of the cmake arguments should not be included in the
package_id checksum of the Conan package. Filter these out when
generating the package_id.
Examples:
- -DCMAKE_C_COMPILER_LAUNCHER=sccache
- -DCMAKE_CXX_COMPILER_LAUNCHER=sccache
- -DFEATURE_headersclean=..
- -DPostgreSQL_ROOT=..
Those arguments which are specific to Qt CI build environment are
filtered out. This makes the pre-built Conan binary packages more
usable for the end users because Conan would enforce a build
from sources if the checksum(s) would not match.
Pick-to: 6.2
Task-number: QTBUG-96230
Change-Id: I076a57427614fdf4bf9138402e247d63f1ce15d9
Reviewed-by: Toni Saario <toni.saario@qt.io>
libxcb thinks that it knows about all device class types sent by the X
server XInput extension. With the addition of touchpad gestures in
XInput 2.4 and X server 21.1 this is no longer the case and libxcb fails
horribly by thinking that the protocol was malformed.
The X server currently has a workaround, but it would not address the
following situation:
- there are multiple modules within the same X client (e.g. part of the
application uses Qt, another part talks to X server via another library)
- both of the modules talk to XI
- at least one module requests for XI 2.4 protocol support.
The request for XI 2.4 disables the workaround on the X server and Qt
side would crash horribly.
This bug is being fixed upstream in these MRs:
https://gitlab.freedesktop.org/xorg/proto/xcbproto/-/merge_requests/23https://gitlab.freedesktop.org/xorg/lib/libxcb/-/merge_requests/20
Change-Id: Idf345271340031152b512ef59f619313be5ec226
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
One signal emission was not labelled emit.
Removed some unnecessary braces
Change-Id: I1c0adde869e559056e60671619bfca33b1966d1e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The docs (10 lines above) say it will find the backend case
insensitively. Thus the comparison should also be case-insensitive.
Pick-to: 6.2
Change-Id: I65901ed81b7d8bdfcf76f5b6c7b40efe63245503
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
CodeChecker complains regarding the two classes not having all
the special 5 declared, so do it.
Change-Id: I76d562c52f89a24aec9f155c2be62f8844f1f4a7
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
In Qt 5, QVector::iterator was actually a raw pointer. In Qt 6,
QVector = QList, and QList::iterator isn't a pointer, but converts
to one (for backwards compatibility).
Some code in QtDBus exploits this by mixing iterators and raw
pointers. In preparation for deprecating conversions between them,
adjust this code by "converting" explicitly when needed.
Change-Id: I1efab72b33d27742b339cf848cefd5cc258cd215
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This is required to generate the correct import for Python.
Pick-to: 6.2 6.2.0
Task-number: QTBUG-63235
Change-Id: I6aaff82058e3f0a5453da15d8d470f06ad9a5a16
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This file was necessary for the qmake build and the CI. The qmake
build is history, and the CI does now read .cmake.conf (see
QTQAINFRA-4392).
In addition to being superfluous, the existence of .qmake.conf
triggers QTBUG-76140 when building Qt examples with qmake. Removing
the file alleviates the symptoms of this bug.
"Interestingly", to make the qmake build of examples work in the CI, we
have to adjust the dbus examples to not use nmake inference rules. The
absence of .qmake.conf results in a different order of inference rules
in the Makefile, and nmake/jom pick up generated source files from the
source dir. These are incompatible with the correct generated source
files in the build dir. See QTBUG-96513 for details.
Fixes: QTBUG-92271
Task-number: QTBUG-96513
Change-Id: I4076fae2eeb993956b54aced2c9c844ae2577a4a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Showing, hiding, and showing a window can result in the Xcb QPA plugin
warning about
qt.qpa.xcb: internal error: void QXcbWindow::setNetWmStateOnUnmappedWindow()
called on mapped window
The point of the test is to verify that we get a paint event on a window
that is shown again after having been hidden, not to verify that async
windowing systems can handle a show/hide/show sequence. So wait for the
window being exposed before we hide it.
Pick-to: 6.2 5.15
Change-Id: If91a9926613645e78e332dacff34bd57e4034b6f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
After the recent refactoring in 28b14b966f
this test should run stable on all platforms. However, the way the test
was written made it quite flaky. Simplify it to verify that closing one
window doesn't prevent a second timer to fire (which it would if closing
the first window already quit the application).
Change-Id: I0306792cd7573ebd3418d1aabffe2b78700ec2d9
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Verifies that we get the messages we want, and makes it easier to see
relevant debug output.
Pick-to: 6.2
Change-Id: Ide92959b120f325badbf200236cdc85f72226e1e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
CMake doesn't add framework include paths for the includes if
add_custom_command is used. When all Qt modules are installed to a
single directory, frameworks could be found under
QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX, but for Conan builds
each module is installed to the separate directory. These directories
need to be listed in the QT_ADDITIONAL_PACKAGES_PREFIX_PATH variables
family. This takes into account directories that are listed in the
QT_ADDITIONAL_PACKAGES_PREFIX_PATH variables and considers they
can contain frameworks.
Pick-to: 6.2
Fixes: QTBUG-96511
Change-Id: I664381df4859a2e85c399cd94dc2f3996e452c03
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
- process environment/DNS are OFF for INTEGRITY
Task-number: QTBUG-96176
Pick-to: 6.2
Change-Id: I189a97f88c96a428586c31a66b8d250e04482900
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
With single_android_abi, the file qmake_qmake_immediate.qrc is laid
directly into the root of the build dir and not under different abis
dirs.
Pick-to: 6.2.0 6.2 5.15
Fixes: QTBUG-87669
Fixes: QTBUG-95202
Fixes: QTBUG-95235
Change-Id: Ie13cccdf2fc323e8fd725a94f3aacab465fa1287
Reviewed-by: Andy Shaw <andy.shaw@qt.io>