Commit Graph

62353 Commits

Author SHA1 Message Date
Ahmad Samir
4f618bde08 QEventLoop: port processEvents() to QDeadlineTimer
[ChangeLog][QtCore][QEventLoop] Added a processEvents() overload
that takes a QDeadlineTimer.

Task-number: QTBUG-110059
Change-Id: I239dbeec33cb4f10d1ecd44a8455e7bd808f378b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-06-30 02:24:54 +03:00
Ahmad Samir
fa296ee1dc QTest: add QDeadlineTimer qWaitFor() overload
For Forever timers, don't check the remaining time.

Merge src_corelib_kernel_qtestsupport_core_snippet.cpp and
src_corelib_kernel_qtestsupport_core.cpp.

[ChangeLog][QtCore][QTest] Added QDeadlineTimer qWaitFor() overload.

Change-Id: I74c3f362b77206426136a418e656465e43f45b09
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-06-30 02:24:54 +03:00
Ahmad Samir
57712e1160 QTest: add qWait(chrono::milliseconds) overload
The code bailed out of the while loop when "remainingTime <= 0",
for a QDeadlineTimer::isForever() timer remainingTime() returns -1,
whereas remainingTimeAsDuration() returns nanoseconds::max().

I.e. the original code stopped the while loop when the timer isForever()
or "expired" (i.e. remaining time is 0). I am not sure the isForever()
part was intended that way or not, but it makes sense, if
QCoreApplication::processEvents() has already run "forever", there is no
point looping again.

[ChangeLog][QtCore][QTest] Added qWait(chrono::milliseconds) overload.

Change-Id: I871c28b053c6ba4f81a7e2d434aa4fbe03c8c5e7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-06-30 02:24:53 +03:00
Ahmad Samir
c580a7b0fa QTest: add qSleep(std::chrono::milliseconds) overload
Using chrono means one can write 10s instead of 10'000.

[ChangeLog][QTest] Added qSleep(std::chrono::milliseconds) overload.

Change-Id: Iac1b12a3fc3f692b557e2d459e6f3bc565f20e93
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-06-30 02:24:53 +03:00
Santhosh Kumar
3902fb0438 Fix button state validation in windows platform during drag and drop
The button state from windows when we use GetAsynckeyState() provides
both MK_LBUTTON and MK_RIGHTBUTTON at the same time. This creates an
issue when we validate only with single state to determine
DRAGDROP_S_DROP operation.

Normally, The MK_RBUTTON will be delivered when we have long press
during drag. But sometimes (no definitive reason identified) the key
state from windows contains both the key state (MK_LBUTTON | Mk_RBUTTON)
during drag and drop operation with touch.

This patch set fixes the issue by validating all key state instead of
a particular state.

Fixes: QTBUG-112995
Pick-to: 6.6 6.5
Change-Id: I67bf5f4956b68279ecc5fbeca8e8e7aef46d0482
Reviewed-by: Timothée Keller <timothee.keller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2023-06-29 22:14:47 +02:00
Tor Arne Vestbø
1f70c073d4 QMessageBox: Respect clients overriding QDialog::done()
As a result of d8bbb5ee0e, we
were no longer calling QDialog::done(), which users may have
overridden.

We now pull out the dialog code to determine whether to
emit accepted/rejected directly in done(), so that we
can go back to calling QDialog::done().

Pick-to: 6.6 6.5
Change-Id: Ie08270123d61d9010acd8c989b66986f71960ad0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-29 18:49:46 +02:00
Tor Arne Vestbø
4a4283e3e9 QMessageBox: Plumb native button clicks back to dialog's QAbstractButton
The native dialog helper is populated with buttons based on the message
box buttons, which are still represented as QAbstractButtons, either
by adding custom buttons, or by turning QMessageBox::StandardButton
into QAbstractButton.

To ensure as little difference as possible between the native and
non-native backed dialogs, we plumb the dialog helper clicks back
to the corresponding QAbstractButton. We were already doing this
partially for custom dialog buttons, but now we also do it for
standard buttons.

As the click() will plumb back to _q_buttonClicked, which calls
setClickedButton to finalize the dialog, we don't need to do
this explicitly anymore.

For custom buttons it now means the result() of the message box
will be the custom button's index, not its role, but the result
in this case is documented to be an opaque value, and it's best
to keep these the same for native and non-native dialogs.

Pick-to: 6.5 6.6
Change-Id: I5fe3b28e4c4ed879775610103cd1b591b3353f7e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-29 18:49:46 +02:00
Tor Arne Vestbø
6da1ecc8c2 QMessageBox: Emit accepted/rejected for native message boxes
In d8bbb5ee0e we started respecting the
button roles of buttons added to QMessageBox, by emitting accepted()
and rejected() if the appropriate roles were found.

Unfortunately this only touched the QMessageBoxPrivate::_q_buttonClicked
code path, for non-native dialogs, leaving the code path for native
dialogs in QMessageBoxPrivate::_q_clicked alone.

We now follow the same approach for the native dialogs as for the
non-native ones, by calling QMessageBoxPrivate::close() and
QMessageBoxPrivate::finalize() explicitly, instead of going
via QDialog::done(). This allows us to pass a dialog code
to finalize().

One side effect of the original change was that overriding
QDialog::done() for non-native dialogs no longer had any effect,
as we were using lower level plumbing. Since we now align with
the original change for native dialogs, we will adopt the same
limitation, but this will be fixed in a follow up for both
cases.

The callback code for custom buttons in native dialogs could also
use some alignment with the non-native path, but this is also
left for a follow up.

Fixes: QTBUG-113685
Pick-to: 6.5 6.6
Change-Id: Iea03a0007f884d6c7f11d2bd891446bdaa5ddc67
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Erik Verbruggen <erik.verbruggen@me.com>
2023-06-29 18:49:46 +02:00
Tor Arne Vestbø
cd9ae49962 QMessageBox: Set clicked button for native dialogs in clicked callback
For non-native dialogs we set the clicked button before calling finalize,
which emits finished(). We did the same for custom buttons in native
dialogs, but for standard buttons in native dialogs we deferred it
until QMessageBoxPrivate::helperDone, which meant that during the
finished() signal the button was not set.

We now set the button as early as possible for all three cases.

Pick-to: 6.6 6.5
Change-Id: Ifdbaa9a25105fef0bb56dd28caee9af55cd74e67
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-29 18:49:46 +02:00
Alexey Edelev
49ce711796 Fix syncqt compiler and linker flags handling
We want syncqt to be built optimized by default. The current approach
set the default build type for the external projects and optimized
flags for the non-configure-time syncqt build. The problem is that
syncqt still have compiler flags littered by either the Qt configuration
type or the system defaults that are applicable for RelWithDebugInfo
configuration(the default one we chose for syncqt).

This patch makes sure that we cleanup all compiler flags from any
optimizations and apply optimized flags for all configurations. Also
we discard '/RTC1' flag if it's set. Configure time executables now
respect the language related flags that are set in the project and
adjust the flags passed to try_compile.

For linker flags we should use those that are applicable for the
preferred build type. Since syncqt is built in RelWithDebugInfo
by default we should replace linker flags in all configs with
those are used for RelWithDebugInfo configuration.

Fixes: QTBUG-114925
Pick-to: 6.5 6.6
Change-Id: I782f81a36f5ef7ee4d342ce8ac6c217cb2552f3b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-06-29 18:49:45 +02:00
Liang Qi
ed1fbc7a88 Examples: Revamp sql/books
* use nullptr
* use member init
* set ExpandingFieldsGrow fieldGrowthPolicy for QFormLayout, which
makes it behaviors similar on macOS as other platforms
* select first row to make up/down keys works by default

Pick-to: 6.5 6.6
Change-Id: I25d9869d2ca1c7274c2b750aada8270734787546
Reviewed-by: Liang Qi <liang.qi@qt.io>
2023-06-29 16:06:33 +00:00
Ahmad Samir
728b991b93 Suppress a couple of GCC warnings
They're already suppressed for clang.

-Wself-move was added in GCC 13.1, the CI still doesn't have that so
wrap it in an "#if Q_CC_GNU >= 1301".

Change-Id: I5c2ec78a5003485261b4e3125f85c5b78dd0db22
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-06-29 15:19:52 +00:00
Ahmad Samir
fe4f977a2d QStorageInfo: use the same code on Linux and Android
/proc/self/mountinfo is available on Android too AFAIK (it's available
on an old Android 6.0 phone I have).

Change-Id: Ia4b04a143b362c7a18773716a90897ce4c5fc5f0
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2023-06-29 18:19:52 +03:00
Alexandru Croitor
961ff0cc8a CMake: Don't use check_language for Objective-C/C++
The check_language macro spawns a new cmake subprocess to detect
availability of a language. We use that to detect availability of
the Objective-C/C++ languages when targeting Apple platforms.

That's problematic because the parent process CFLAGS / LDFLAGS env
vars influences the result of the subprocess compiler detection,
and in some cases that can fail the detection.
An example of that is passing iOS specific flags which then get
mixed with the default macOS flags added by CMake, resulting in
a linker failure.

Instead of using check_language, explicitly enable the Objective-C
and C++ languages when targeting Apple platforms because we know
that we need them for compiling Qt.

This avoids the issue because enable_language is not spawning a
separate cmake sub-process and thus passes more information to the
underlying try_compile project to ensure a successful check.

The change also means that CMake will error out earlier in case if the
Objective-C compiler is not found, which was not the case before.

Pick-to: 6.5 6.6
Fixes: QTBUG-114470
Change-Id: I1a16c1e5828dfe10b2d7da27cc9a8c787517ab8e
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-06-29 16:28:53 +02:00
Marc Mutz
b249a8ab3a QCFString: unexport
This class doesn't exist on MSVC, so the inline functions didn't
become part of the ABI, so it suffices to only export the two
out-of-line functions.

Pick-to: 6.6
Task-number: QTBUG-104164
Change-Id: Iedf8b0b1882802db53406942d7ac2a27e7ddfa23
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-06-29 16:28:53 +02:00
Eskil Abrahamsen Blomfeldt
17f8e2c441 API update: Don't expose QHash storage in API
To maintain flexibility in how we store the features, we
introduce accessors through indirection rather than accessing
the property directly.

Made as response to API review.

Pick-to: 6.6
Change-Id: I3e5d4ddabe93f67796af4626fddefe028ded9888
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
2023-06-29 16:04:34 +02:00
Alexey Edelev
bacb04d77b Introduce openssl-hash feature
The feature allows to not use OpenSSL in QCryptographicHash
implementation and removes OpenSSL from dependencies of QtCore if
disabled.

Fixes: QTBUG-114783
Pick-to: 6.6
Change-Id: I2a49fa9ddfa5acedcfc95a3330fd7863a8052a5c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-06-29 12:49:14 +00:00
Marc Mutz
3bc3b8d69a tst_QXmlStream: remove unneeded _ba UDLs
... and collapse adjacent C string literals.

Both QStringBuilder and non-QStringBuilder builds have no problem
resolving an operator+ for char[] and QByteArray, so there's no need
to turn the char[] into a QByteArray using the _ba UDL first.

It just causes pain because not all active branches support this UDL,
so remove, to bring this code in line with what the cherry-picks to
6.2 and 5.15 must needs had to use.

Amends 6326bec46a.

Pick-to: 6.6 6.5 6.5.2
Change-Id: Id3d61483729c51c82f58b826efcc8fc7960c3ccd
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2023-06-29 12:49:14 +00:00
Tor Arne Vestbø
5654fbffd5 Move dials example to manual test
Pick-to: 6.5 6.6
Change-Id: Ib99a3890b814c2089db62485f0a10cf308ff9b66
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-29 14:49:14 +02:00
Tor Arne Vestbø
81db1766dd Move textedit example to manual test
Pick-to: 6.5 6.6
Change-Id: Ic3189044598be8e121c1f065e68e04a3547a87d0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-29 14:49:13 +02:00
Tor Arne Vestbø
40dbee13eb Move tetrix example to manual test
Pick-to: 6.5 6.6
Change-Id: Ie73d9e35df8513d05d55ffbad1f02584359e3bd0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-29 14:49:13 +02:00
Tor Arne Vestbø
89b463ac2f Move styles example to manual test
Pick-to: 6.5 6.6
Change-Id: I5738932c0c498ce2075a399274e3b80a04ad9211
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-29 14:49:13 +02:00
Tor Arne Vestbø
1e954f9be8 Move stylesheets example to manual test
Pick-to: 6.5 6.6
Change-Id: If0206e63546bf948af4cfb65773e2662c53a5e79
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-29 14:49:13 +02:00
Tor Arne Vestbø
c5ee7c8b8f Move main window example to manual test
Pick-to: 6.5 6.6
Change-Id: I7d9281f173ce9fb24c0f565797b6fbcfba10459f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-29 14:49:13 +02:00
Tor Arne Vestbø
4b79834e1a Move MDI example to manual test
Pick-to: 6.5 6.6
Change-Id: Ide698a171a4600cb4bac6574b6be74c17f779051
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-29 14:49:13 +02:00
Topi Reinio
15db0935c5 Doc: Move the warninglimit configuration to doc/global
The /coin directory is not installed, so trying to include a .qdocconf file using a relative path from an (installed) global configuration will fail.

Task-number: QTBUG-113326
Change-Id: I761b1a7eb19ca9d6a768f1367e30d5eaf80cb816
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2023-06-29 12:08:34 +00:00
Amir Masoud Abdol
f607e22d59 Update the implementation of -unity-build
I added the ability to use `-no-unity-build`, and included the
batch size in the config.summary as well. In addition, qt_feature is not
being used for `-unity-build` anymore.

Pick-to: 6.5 6.6
Change-Id: I4a10e03d3505336d2256280ed2854ec0425df47f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-06-29 10:20:25 +02:00
Tor Arne Vestbø
cd7995de57 Move windowcontainer example to manual test
Pick-to: 6.5 6.6
Change-Id: I68b866bcc2659b90aad2c10dc06240674bf4a826
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2023-06-29 03:13:10 +02:00
Tor Arne Vestbø
993cbef7f4 permissions: Handle unknown permission statuses gracefully
If an application runs on a macOS or iOS version that introduces new
permission statuses that we haven't accounted for, we don't want to
crash.

Replace Q_UNREACHABLE with a warning and Qt::PermissionStatus::Denied.

Pick-to: 6.5 6.6
Change-Id: I063042f510caaa8936742f6195bd455d09c4d9ee
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-29 03:13:10 +02:00
Tor Arne Vestbø
2736e908e9 permissions: Handle EKAuthorizationStatusWriteOnly on macOS 14/iOS 17
For now we do not have a QCalendarPermission::AccessMode::WriteOnly,
so we have to report Qt::PermissionStatus::Denied.

Fixes: QTBUG-114864
Pick-to: 6.5 6.6
Change-Id: I94e92912ef4c24adb524ccf2cf28553115d6781b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Doris Verria <doris.verria@qt.io>
2023-06-29 03:13:10 +02:00
Tor Arne Vestbø
9526a76936 CoreText: Handle failure to find matching theme font descriptors
CTFontDescriptorCreateMatchingFontDescriptors has been observed to
return nullptr, so we need to handle that explicitly.

Fixes: QTBUG-113698
Pick-to: 6.5 6.6 6.2
Change-Id: Ic9fa574c14068fcae98fe8e6ceddd8a4f7008210
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-29 03:13:10 +02:00
Carl Schwan
604b2feca7 Modernize EditableTreeModel
- Use unique_ptr instead of manual memory management
- Improve consistenty in variable name with the simpletreemodel
  childrenNumber -> row, m_ prefix for member variables

Change-Id: Iface30c2224c2b1db7c623a9e6fcbb449c556f3e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-28 23:54:11 +00:00
Marc Mutz
7bad2902f8 Make qt_noop() constexpr and noexcept (for C++)
Since qt_noop() is supposed to be a no-op, it should not affect
constexpr'ness and noexcept'ness of functions and expressions it's
(indirectly) used in.

That requires that it be constexpr and noexcept itself. Add the
keywords, but guard against use from C. We can't use our Q_ macros
(which would enable noexcept for C, too, on some compilers, because
qcompilerdetection.h depends on qtnoop.h, and we don't want the
circular dependency.

Pick-to: 6.6 6.5
Change-Id: Ie5441c423b7942a6c956345126fc7aec99907d25
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-06-29 01:54:10 +02:00
Marc Mutz
01e1dc273d Remove all class-level [[nodiscard]] from the code-base
A class-level [[nodiscard]] used to be the only way to get a waring
for code such as

   QMutexLocker(&mutex);

with original C++17 means. This was because a few of our compilers
would warn about the presence of [[nodiscard]] on ctors, which is
really the semantics we want: we don't want to prevent users from
passing QMutexLocker out of functions and users of those functions
from ignoring the return value, if they so choose. That should be the
choice of the author of the function returning such types, not ours.

So QUIP-0019 makes class-level [[nodiscard]] conditional on proper
rationale in the user docs (or the commit message in case of private
API). Since none of the existing uses really strikes this author as
particularly convincing, remove them all.

All these classes have gotten Q_NODISCARD_CTOR on all their ctors, so
we continue to provide the same true positive warnings, minus the
false positives when returning from functions, at least on the
majority of compilers (and it's not as if all compilers interpreted a
class-level [[nodiscard]] as a trigger to warn on the initial example
of this commit message).

Task-number: QTBUG-104164
Pick-to: 6.6
Change-Id: I163356486e7c80f9d69bf67023010a88233fe662
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-06-28 20:48:45 +00:00
Axel Spoerl
574a47dd5a QGtk3Theme: Do not default Active WindowText to button foreground
QGtk3Theme uses the GTK button foreground as a default for the
WindowText color role. When a GTK3 theme has no specific color for the
entry text, this can lead to text on certain assets looking darker
and thus disabled.

This discontinues usage of the button foreground for the window text.

Finding the WindowText color role in QPlatformTheme::SystemPalette now
follows the following logic:
(1) GTK normal entry text is used if specified. This is the preferred
option, copying GTK behavior.
(2) If (1) is not specified, the GTK default text color is used, making
WindowText equal to Text.
(3) If neither (1), nor (2) are specified, the WindowText color role is
taken from qt_fusionPalette, where it is also equal to Text.

The SystemPalette is used as a default template for all other control
or widget speicific palettes. The rules above therefor apply to all
screen assets (unless they use a JSON file to specify a their
individual WindowText).

[ChangeLog][QGtk3Theme][SystemPalette][WindowText] Default to GTK
Entry Text / Normal Text / qt_fusionPalette

Fixes: QTBUG-114600
Pick-to: 6.6 6.5.2 6.5
Change-Id: I4c96ac7d096526faf4c2feee436753990c6c9f92
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-28 22:48:42 +02:00
Alexey Edelev
a3ec70a929 Pass CMAKE_OSX_SYSROOT to syncqt CMAKE_FLAGS
Fixes: QTBUG-114803
Pick-to: 6.5 6.6
Change-Id: I2eed5d6a7255eb61eff09d0c9a102e0652e63c0c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-06-28 22:09:20 +02:00
Alexandru Croitor
9ef864f56f CMake: Require CMake 3.21 when building/using Qt on Apple platforms
Explicitly check that at least CMake 3.21 is used when building Qt or
when using Qt in a project.
This only affects macOS and iOS builds.

We check for 3.21 instead of 3.21.1 as described in the documentation
to avoid an error like:

 Policy VERSION range "3.21.1...3.21" specifies a larger minimum than
  maximum.

Until the technical limitation is addressed, if someone does end up
using 3.21.1, another existing check for "unsuitable" cmake versions
(as opposed to minimum required) will let them know they should use
something newer.

Amends 1cf3295cef321c9a587af2f2de7740c0cd3ca743.

Pick-to: 6.6
Fixes: QTBUG-114869
Change-Id: I2a479baaa63cfbe23af187cf0796e1c00042692b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-06-28 22:09:20 +02:00
Carl Schwan
25027444a9 Modernize SimpleTreeModel example
Use std::unique_ptr to manage items tree memory allocations. This also
use the new string literals operator.

Change-Id: Iab002b5dc612b75cef0be10862e263c6c6c013c1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-28 19:26:45 +00:00
Marc Mutz
be1b589cb9 De-inline QGenericRunnable overrides
Pins the vtable to a single TU and therefore prevents duplicate
vtables, -Wweak-vtables warnings and false-positive dynamic_casts.

This requires exporting QGenericRunnable, which hopefully won't
also export the nested class.

Pick-to: 6.6
Task-number: QTBUG-45582
Change-Id: Ie1f29d25b0dcdee7654c33c497e8e0350d12e311
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-06-28 17:26:07 +00:00
Morten Sørvig
7a31911b79 wasm: fix touch -> mouse event synth on Safari
Mobile Safari generates touch pointer events with negative
pointer id's, which causes processTochEvent() to skip
the event instead of synthesizing a mouse event.

Ensure that the id's are always positive by taking the
absolute value of the event.

Pick-to: 6.6 6.5
Change-Id: I1514329dc76ecc4b9103f7deca9642aaf304df8b
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2023-06-28 17:24:19 +00:00
Michal Klocek
2dcc30592b Fix headers clean for newer msvc
Newer msvc gives C4309 warning for 'initializing':
truncation of constant value

Warning would go away if we had 'enum foo: unsigned'.
Disable the warning for problematic enums is not enough
as it also complains about headers coming from windows sdk
like:

C:\Program Files (x86)\Windows
Kits\10\include\10.0.22621.0\shared\wtypesbase.h(395): warning C4309:
'initializing': truncation of constant value

Note 10.0.22621.0 is the latest sdk already.

Do not disable language extensions for header clean target.

This reverts commit 8bf602518d

Task-number: COIN-1059
Fixes: QTBUG-114931
Pick-to: 6.6
Change-Id: Ifc3883f88a6bd52794a37dc640eca99c158a40e0
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2023-06-28 16:02:45 +00:00
Amanda Hamblin-Trué
0644f8e63a Revamp bindable subscription example
Silence a bogus warning.

Pick-to: 6.6 6.5
Task-number: QTBUG-114689
Change-Id: I7267b752e780b0c48cc57a513d12ad504e4c7a30
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-06-28 15:19:45 +02:00
Laszlo Agocs
277de5ca4b rhi: gl: metal: Enable depth-stencil correctly with multiview
After fixing the data type for D24S8, we can now implement attaching
depth and stencil (with the same texture).

For Metal we need to set a stencil flag correctly.

This allows using D24S8 in the manual test, which is likely the format
that is going to be commonly used when setting up multiview with
Qt Quick.

Fixes: QTBUG-114904
Change-Id: Ife425c6cb3e09bfe40092c841b78f7a93bb6a4cd
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2023-06-28 15:18:28 +02:00
Laszlo Agocs
409cd2be18 rhi: gl: Correct data type for D24 and D24S8
Pick-to: 6.6 6.5
Change-Id: I7aaaba49d0cc427c82e1ee4d0657b2992ffd4905
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2023-06-28 15:18:25 +02:00
Laszlo Agocs
4b233526f2 rhi: gl: Enable depth texture for multiview
Cannot just do like with other APIs and expose a view of multiple
array layers. The only option is to use the multiview-specific API
and specify layers 0..view_count-1 in the depth texture.

This allows having depth in a multiview render pass with OpenGL.
Note that this does not cover stencil. D24S8 does not work, so
we may need to explore having a dedicated, separate stencil
texture.

Task-number: QTBUG-114896
Change-Id: I06ede1d77fef199148d595a55d144c96dc3cbc9d
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2023-06-28 15:18:22 +02:00
Laszlo Agocs
3b7f99d04c rhi: Use a depth/stencil texture in the multiview manual test
...and expand the docs a bit.

Task-number: QTBUG-114896
Change-Id: I969c3aa2fa72a242e275e4b6dd996df20d1cd2ab
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2023-06-28 15:18:18 +02:00
Laszlo Agocs
e126558b9b rhi: d3d: Handle the case of passing in a texture array as depthTexture
Behave identically to Vulkan, i.e. create a view that spans all array
elements. (except when the range is set)

This becomes relevant with multiview, where the depth/stencil attachment
the render target must be set up with a texture array as well, similarly
to the color attachment. But applies even to D3D11, even though it is
not common to use a texture array there, but it's possible.

Task-number: QTBUG-114896
Pick-to: 6.6
Change-Id: Ieda8475500b0553f8c14aa9ecad57001b9714d49
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2023-06-28 15:18:14 +02:00
Tor Arne Vestbø
ec01f6ae8b Move movie example to manual test
Pick-to: 6.5 6.6
Change-Id: Ie185a3c88eced7b8b0fe324b9ef62ab86d38d521
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-28 14:05:41 +02:00
Tor Arne Vestbø
c7702638f3 Move pinch zoom example to manual test
Pick-to: 6.5 6.6
Change-Id: I0632a839ef069e13a8b859a22f47be2e7423ffb0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-28 14:05:41 +02:00
Tor Arne Vestbø
e00d8aa6a8 Move validators example to manual test
Pick-to: 6.5 6.6
Change-Id: Ic91bc89422fb23e3782db69bab2953e7cf8ddf69
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-28 14:05:41 +02:00