Commit Graph

62593 Commits

Author SHA1 Message Date
Mikolaj Boc
592494e2e5 Use module.exports to get the entry function name in WASM test lib
Obtaining entry function name with exports = {} is about to get removed
(in emscripten 3.1.44). Use the only alternative, which is to specify
the module = {} object that gets the 'exports' variable. Oddly enough,
it gets assigned the only export name, even though the name is plural.

Change-Id: Idcda29bfcaed2d0a923a8d39af078359abc73f7d
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2023-08-02 15:43:45 +02:00
Mikolaj Boc
63b64084cd Make more of tst_settings pass on WASM
Missing parts of local storage backend implemented:
- fallback mechanism
- removal of all child keys for groups
- variant decoding instead of string decoding
- report AccessError when organization is empty in settings' ctor

Some WASM-specific adjustments to tst_qsettings have also been
introduced.

Task-number: QTBUG-115509
Fixes: QTBUG-115037
Change-Id: I02cde965b11d98a64fc1ecb261d74838c508afd6
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2023-08-02 15:43:45 +02:00
Shreya Pattani
6341e0d201 Implement text update in wasm apps during accessibility
Implementation for QAccessibleEditableTextInterface is pending for texts
in qml accessibility, adding accessibile role check for text to be
updated when accessibility feature is on in wasm

Change-Id: Ic24ebf6942e50a5952126e312afa633ed4fbe9ce
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
2023-08-02 13:43:45 +00:00
Nicholas Bennett
5290ba4cbd Docs: Add a macro for documenting something as a technical preview
Adds a warning symbol.
Adds a note to the brief string.

Pick-to: 6.5 6.6
Change-Id: Ib036295bbcf7ab5eca7fd554fb2da836fedad8a0
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2023-08-02 12:47:15 +00:00
Alexey Edelev
8c41125118 Allow using custom CMAKE_<CONFIG>_POSTFIX when building Qt
Do not override CMAKE_<CONFIG>_POSTFIX if it's specified by user.
Using custom CMAKE_<CONFIG>_POSTFIX can potentially break qmake,
since qmake relies on pre-defined postfixes that are set by Qt build
by default. Building Qt with CMAKE_<CONFIG>_POSTFIX different from
default one will now warn about potential issues. Assume that we
still doesn't support setting of CMAKE_<CONFIG>_POSTFIX, but also
don't force our default values.

Fixes: QTBUG-115045
Change-Id: I75a34913189eae77062afa10d384eccf4edfc849
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-08-02 14:47:15 +02:00
Jani Korteniemi
b3127806a7 Update Android notifier example to match example guideline
Replaced add_subdirectory() with qt_internal_add_example().
Added tags.

Task-number: QTBUG-114638
Change-Id: I397c2974a51f0bea391099d1d1abfea39bd29cbe
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2023-08-02 15:47:15 +03:00
Marc Mutz
f91588923b QPlatformWindow: add a macro when setBackingStore() is virtual
This is the only way to detect, and act upon, the addition of the
virtual function in other Qt modules.

Amends a4ca9e8065.

Pick-to: 6.6
Task-number: QTBUG-97482
Task-number: QTBUG-115691
Change-Id: Id32fdd3d8af1fced17983dd104318645a5578b8c
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-08-02 14:02:33 +02:00
Marc Mutz
c91146b9ef eglfs plugin: port away from Q_FOREACH
Mark the module are Q_FOREACH-free, so it stays that way.

These two instances are risk-free, because the loop is over local
variables that the loop bodies clearly do not touch, so the safety
copy that Q_FOREACH takes is not required here.

Pick-to: 6.6
Change-Id: Ida3c1d51c661d77a59a2ad105e080c3c9b66c53f
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2023-08-02 14:02:33 +02:00
Edward Welbourne
9237908327 Update QLocale to CLDR v43
Ran the scripts, added the new enum members to docs.
Updated tests:
* Two of the new languages are right-to-left,
* Canada has replaced a silly date format with a sensible one.

Fixes: QTBUG-111550
Change-Id: Ie6f1e6e94477167c9e2b5c67e6518ca0f6a7e7fb
Reviewed-by: Mate Barany <mate.barany@qt.io>
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
2023-08-02 09:38:34 +02:00
Edward Welbourne
69a0cec4d0 Canonicalize space in lists of IANA time-zones
In the Windows zone-ID code, we tokenize() a text extracted from CLDR
data. However, a leading or trailing space (or a repeated internal
space) would then give an empty "IANA ID" for us to match, causing the
empty ID to be mapped to the Windows ID for the entry with the
superfluous space. This was uncovered by an entry with a trailing
space in CLDR v43's data.

Canonicalize spacing in the IANA ID lists extracted from CLDR so as to
ensure this doesn't happen. (We could pass Qt::SkipEmptyParts to the
tokenize() call, but fixing the issue when generating the data is
cheaper and more robust than fixing it at run-time every time it's
consulted.)

Task-number: QTBUG-111550
Change-Id: Ib3883419558d6574141e9ab0bc929ade2d73e020
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
2023-08-02 09:38:14 +02:00
Thiago Macieira
ee593cdde6 QDBusXmlParser: downgrade property name mismatches to warnings
This has happened before: there's a disagreement on whether property
names need to be identifiers or not. In Qt, we insist they are, and if
this code had been around before, other specifications from other teams
in freedesktop.org and gnome.org would have adhered to this rule. But it
wasn't, so such properties exist (see [1]).

Commit bcc93850fc converted the check that
had bene here all along as a proper error for qdbusxml2cpp. So downgrade
it a warning and move on.

An alternative implementation would keep on going and install this
property with the invalid name, but qdbusxml2cpp and other generators
may want to ignore such property names later on. I'm not implementing
this in a bug fix (or at all).

[1] https://fprint.freedesktop.org/fprintd-dev/Device.html

Fixes: QTBUG-115596
Task-number: QTBUG-2597
Pick-to: 6.6
Change-Id: Ifbf974a4d10745b099b1fffd1776fb8cc9239125
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
2023-08-01 21:52:55 -07:00
Tor Arne Vestbø
ec3d09bd9c cmake: Enable Objective-C++ language for standalone test projects
Amends 8450ab8dec.

Task-number: QTBUG-93020
Change-Id: Ied86754dbcd216a73cc77135c2c45303463d28d2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-08-01 20:42:30 +02:00
Axel Spoerl
d35e8ad754 Implement private visualRect() in QTreeView and QAbstractItemView
QTreeView::visualRect() returns a given model index's visual rectangle.
The method is used to toggle the background during hovering.
The previous implementation included the row indicator, when the first
row section was hovered. When it was unhovered, the row indicator
remained highlighted, until the mouse had left the view port.

The reason is, that the highlighting implementation changed the
rectangle returned for the first section, to include the row indicator.
The implementation for neutralising a highlighted section relies on
QAbstractItemViewPrivate::setHoverIndex() and
QAbstractItemView::update(). These methods don't know about the row
indicator to be included, and therefore do not update() its rectangle.
As a consequence, the correct background gets painted but not updated
on the screen.

This patch moves the calculation of the visual rectangle to a new
QTreeViewPrivate::visualRect_impl(). In addition to the model index,
the new method expects an enum argument, representing the calculation
rule:
- SingleSection: Calculate the rectangle of the given section.
- FullRow: Returns the rectangle of the entire row, regardless of the
index's column.
- AddRowIndiCatorToFirstCulumn: Adds the row indicator to the rect,
if the model index points to the first column.

The patch updates all calls within QTreeView, to use the private method
with the right calculation rule for the use case at hand. It elminates
manual (and repeated) modifications of the return value.

The patch implements QAbstractItemViewPrivate::visualRect(), which
returns QAbstractItemView::visualRect(). It is overridden in
QTreeViewPrivate, so that QAbstractItemViewPrivate::setHoverIndex()
and QAbstractItemView receive the rectangle including row indicator.

As a drive-by, several local variables have been constified and/or
renamed to indicative variable names.

Fixes: QTBUG-115149
Pick-to: 6.6 6.5
Change-Id: I4838bcf744f87d8cfb259c5d8758fb65e091e9fe
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-08-01 19:25:06 +02:00
Edward Welbourne
5db5d3e4b1 Add new languages and a script for CLDR v43
Also add a comment to check the locales new additions enable do have
substantial data. Some of those added in the past are more or less
stubs, for all that they're officially present.

Task-number: QTBUG-111550
Change-Id: I04d46ee96303ecec56c056a0deff6a9457b863e9
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
Reviewed-by: Mate Barany <mate.barany@qt.io>
2023-08-01 15:36:31 +02:00
Edward Welbourne
8a762c6f0f Cope with CLDR data conflict decimal == group
The digit-grouping and fractional-part separators need to be distinct
for parsing to be able to distinguish between two thousand and one vs
two and one thousandth. Thakfully ldml.py asserted this, so caught the
glitch in CLDR v43's data where mn_Mong_MN over-rode mn's decimal, but
not group, and thereby clashed with group. Fortunately the over-ride
is marked as draft="contributed" so we can back out of the collision
and limit the selection to draft="approved" values (but only when
there *is* such a conflict, as plenty of locales have (compatible)
draft data), thereby ignoring the conflicting contribution.

Brought to the attention of cldr-users at:
https://groups.google.com/a/unicode.org/g/cldr-users/c/6kW9kC6fz3g
hopefully that'll lead to a saner resolution at v44.

Task-number: QTBUG-111550
Change-Id: I1332486e60481cb4494446c0c87d89d74bd317d4
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
2023-08-01 15:36:20 +02:00
Edward Welbourne
615047e98f Ignore parentLocales nodes with component="..." attributes
From CLDR v43, "The parentLocale elements now have an optional
component attribute, with a value of segmentations or
collations. These should be used for inheritance for those respective
elements." Since we aren't extracting collation or segmentation data
for the present, omit these elements from the scan for parentLocale
information.

Task-number: QTBUG-111550
Change-Id: I42871929f539c1852471812801953f2fc8be0e8a
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
2023-08-01 15:36:06 +02:00
Edward Welbourne
37c5a9f20b Fix typos in QLocaleXmlWriter
The script and territory to exclude from reports about unused ones
were swapped, so we excluded a territory from the script list (which
didn't contain it anyway) and vice versa.

TheTest for whether to report used the non-existend .territories
attribute by mistake for .__territories

Change-Id: I29e9d9f8f34883d7c3a5ac15470d9e7a0366e3db
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
2023-08-01 15:35:57 +02:00
Edward Welbourne
4e23da9086 Correct enumdata.py's new-at-v42 entries to match generated data
Amends commit 9a8b9473d5 - apparently
the enumdata.py entries were tidied up after the data had been
generated, leading to them being inconsistent (and I missed that in
review). That, in turn, meant the next update would have changed the
public API enum members, backwards-incompatibly; so make enumdata.py
consistent with the released public API. We'll be tidying the order up
at Qt 7 in any case.

Task-number: QTBUG-110333
Change-Id: I3eed2924ce8b69deb552e923d9b0dc142c5f3a65
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Mate Barany <mate.barany@qt.io>
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
2023-08-01 15:35:48 +02:00
Dennis Oberst
5e2d95db97 Use new QBA::assign in QCoreApplication::applicationFilePath()
QByteArray::assign() re-uses existing unshared capacity(), if any, and
is therefore potentially more efficient than '= QByteArray(~)' (and
never slower).

Task-number: QTBUG-106201
Pick-to: 6.6
Change-Id: Ieeb254afd94e26f1b425795feb53c59ebb2322c6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-08-01 14:15:39 +02:00
Dennis Oberst
b40bb99a60 Use new QBA::assign in QStorageInfoPrivate::retrievePosixInfo
QByteArray::assign() re-uses existing unshared capacity(), if any, and
is therefore potentially more efficient than '= QByteArray(~)' (and
never slower).

Task-number: QTBUG-106201
Pick-to: 6.6
Change-Id: Ic51fc57eb0f84d3624ad3447c93a74241ab3612b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-08-01 13:22:39 +02:00
Ivan Solovev
eb0abd9789 Use QT_SUPPORTS_INT128 macro to handle 128-bit integral types
Introduce QT_SUPPORTS_INT128 and QT_NO_INT128 marcos to handle 128-bit
types. These macros allow to undef Qt's own 128-bit types and the
related code, but keep the compiler definitions unchanged.

This is required for Qt Bluetooth, where we need to use
QT_BLUETOOTH_REMOVED_SINCE to get rid of the APIs using
QtBluetooth-specific struct quint128 which clashes with the 128-bit
types. The idea is to use QT_NO_INT128 in Qt Bluetooth's
removed_api.cpp instead of directly undef'ing __SIZEOF_INT128__,
because the latter is UB.

This commit amends befda1acca.

Pick-to: 6.6
Change-Id: Ia2c110b5744c3aaa53eda39fb44984cf5a01fac2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-08-01 10:30:51 +02:00
Antti Määttä
8cedef62cf CTF: Simplify writing endianness to metadata
Pick-to: 6.5 6.6
Change-Id: Ie10533dc22746c31941d5d60d2cc7aa81436fee0
Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io>
Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
2023-08-01 09:05:01 +03:00
Antti Määttä
cc3f18e5e9 CTF: Use wfopen in windows
Pick-to: 6.5 6.6
Change-Id: If54fe2b0af32a097cac6f485900ec5e353d92dd9
Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io>
Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
2023-08-01 09:04:52 +03:00
Thiago Macieira
cff13c2417 QMetaType: fix recursive detection of std::optional operators
Commit ca54b741d6 used the internal
has_operator_equal (and commit 01d94760d8
copied that for has_operator_less_than) instead of using the recursive
expander that was being used here. That assumed that the contained type
in std::optional would always be the last final check, which is an
incorrect assumption.

Fixes: QTBUG-115646
Pick-to: 6.6 6.5
Change-Id: Ifbf974a4d10745b099b1fffd177702934bec27ff
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-07-31 18:43:55 -07:00
Laszlo Agocs
c6fce818db rhi: Guard QRhiVulkan more in qrhi_platform.h
Replicate qvulkaninstance.h's logic. The idea being to allow
to compile code that uses QRhi (so includes qrhi.h) with a pre-built
Qt that was built with Vulkan support, but there is no Vulkan SDK
(and so vulkan.h) on the developer's system. Normally this is not
something we care about, e.g. compiling an application using
QVulkanInstance or any other Vulkan functionality implies one has
to have the SDK installed or at least the headers available in one
way or another.

However, including qrhi.h (and so qrhi_platform.h) happens in some
cases in applications that do not themselves initialize a QRhi,
i.e. they do not care about the QRhiVulkan* structs, because
they only ever use a QRhi retrieved e.g. from the QQuickWindow.
Design Studio is one example. To allow building DS against a Qt
that is Vulkan-enabled (e.g. the official Qt releases) but in
an environment that has no Vulkan headers, we skip the QRhiVulkan*
stuff when there is no vulkan.h available.

Pick-to: 6.6
Change-Id: Ic81250e6c90939a38f79cab1438fbb9f483f56df
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2023-08-01 00:58:22 +02:00
Marc Mutz
c1a95d1d0c QtConcurrent::run: point return value ignorers to QThreadPool::start(Callable&&)
Use the new Q_NODISCARD_X macro to point users that ignore the QFuture
returned from QtConcurrent::run() to QThreadPool::start(), which does
the same thing, but doesn't return a future, so is better suited for
the fire-and-forget use-case the OP of and commentators on
QTBUG-111875 cited.

Can't pick to older branches, since Q_NODISCARD_X is 6.7+.

Task-number: QTBUG-111875
Change-Id: If0bf920ecc0fb59b9a9a9931ea9dc30f7abff1b7
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-07-31 20:09:03 +00:00
Marcin Zdunek
f8cb42e391 Redefinition of root on qstorageinfo_stub.cpp
Change-Id: If35fddc8f23a1f8f610a318472d2f59cae81f144
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-07-31 19:57:15 +02:00
Axel Spoerl
9a39ad8dfb Remove assertion in QAndroidPlatformScreen::addWindow()
QAndroidPlatformScreen::addWindow() asserted the existence of a backing
store, when a window is added. But QQuickWindow neither needs nor has a
backing store.

This patch removes the assertion, which was introduced in
dbb072eb28

Task-number: QTBUG-97482
Pick-to: 6.6 6.5 6.2 5.15
Change-Id: Ifb43f83d39e16b972754e86d0ff9633f58dac3f8
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2023-07-31 16:19:48 +00:00
Edward Welbourne
5993480b69 Correct some testlib selftest data: blacklisted does not qFatal()
The blacklisted test does not crash, as its expected output indeed shows.

Pick-to: 6.5 6.6
Change-Id: I07522a7d065b5f39620975a3546bcd156024c41d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-07-31 18:16:05 +02:00
Tor Arne Vestbø
118f2210c6 tst_selftests: Fix mistaken early return when checking error output
In porting the selftest machinery to Catch2 in 24e83de8d1 we
accidentally added an unconditional early return when determining
whether to check for unexpected stderr output, resulting in not
checking error output on any platform.

The return statement has now been moved into the Q_CC_MINGW
condition, but as we now seem to have similar issues on macOS
and Linux with some of the tests outputting "Received signal 6
(SIGABRT)" as we do for QEMU, we need to add a few more explicit
early return conditions to the function.

Pick-to: 6.5 6.6
Change-Id: I7a25f000843b5f1003a5db883f08285185046b46
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-07-31 18:16:05 +02:00
Edward Welbourne
2e9d33e534 Use correct index for QLocale::system()'s static
Nothing prevents client code from calling QLocale::setDefault() before
we ever instantiate QLocale::system() - aside from some quirks that
mean setDefault(), currently, does instantiate QLocale::system() to
force initialization of defaultLocalePrivate - so using defaultIndex()
could set the system QLocalePrivate instance's index incorrectly.

In any case, even if the index is initially set correctly, a
subsequent change to the system locale would change the correct index;
and nothing outside QLocale::system() has access to the instance that
would then be remembering an out-of-date index.

Actually tripping over that inconsistency took some deviousness, but
was possible. The index is (currently) only used for month name
lookups and those special-case, for the Roman-derived calendars, the
system locale, to only use the index if the system locale offers no
name for a month. Meanwhile, updateSystemPrivate() uses the fallback
locale's index for its look-up of which CLDR data to copy into the
fallback QLocaleData for the system locale.

None the less, a non-Roman calendar's lookup will go via the index to
get at the CLDR data for that calendar, thereby exposing the system
locale's index to use; and, sure enough, a setDefault() could lead
that to produce wrong answers.

In QLocale::system() there's a cached QLocalePrivate, whose index we
need to ensure stays in sync with the active system locale. So pass
its &m_index to systemData(), which will now (when passed this) ensure
it's up to date. Since we always have called systemData(), to ensure
it is up to date, we can skip that update in the initialization of the
cached private and use m_index = -1 to let systemData() know when it's
in the initial call, thereby making the static cache constinit.

Amended a test to what proved the issue was present.

Change-Id: I8d7ab5830cf0bbb9265c2af2a1edc9396ddef79f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-07-31 17:16:14 +02:00
Michael Brüning
ebb361ee3f qt_enable_separate_debug_info: Enable custom location of dSYM directory
It is part of a solution to produce notarizable binaries for
application using Qt WebEngine.

Pick-to: 6.6 6.5
Task-number: QTBUG-99555
Change-Id: Ice0bbcfb12829906328f55158b0c37f03878f17c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-07-31 17:11:01 +02:00
Ievgenii Meshcheriakov
ee43dacbea QDBusPendingCallPrivate: Remove declaration of fromMessage()
The member function is never implemented.

Change-Id: Iee93c7d24df40b48b897d937889bb9556b8feb1a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-07-31 16:01:22 +02:00
Liang Qi
552e3b9b78 xcb: guard a pointer before usage
in QXcbAtom::initializeAllAtoms().

See also the example in
https://manpages.debian.org/testing/libxcb-doc/xcb_intern_atom_reply.3.en.html

Fixes: QTBUG-115599
Pick-to: 6.6 6.5 6.2
Change-Id: I6590fe1aa11deec7fef7ce6d8f5c49a71d636648
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-07-31 13:40:27 +02:00
Laszlo Agocs
cdae120f7f Handle Null rhi backend in backingstore
Was missing for some reason when this got added in 6.4.

Pick-to: 6.6 6.5
Change-Id: I4f8b780c7119649688d8d8a197e8ef59730b0b61
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2023-07-31 12:38:41 +02:00
Laszlo Agocs
d907f1aa92 rhi: Run cleanup callbacks before the pending deletes
If a callback deleteLaters a QRhiResource that should still be
handled and not left unreleased. Swap the order.

Pick-to: 6.6 6.5
Change-Id: I8419a28a9db5bb59f768ab5820dfaf593464d6d2
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2023-07-31 12:38:41 +02:00
Laszlo Agocs
84873c898c rhi: Enable registering cleanup callbacks with a key
And the ability to deregister.

Going to be required by QRhiWidget.

Change-Id: If185cbed2faa042098ac1f6bb1d6daaffd834377
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2023-07-31 12:38:40 +02:00
Laszlo Agocs
f9d473ac72 rhi: vulkan: use the clamped api version for vma
caps.apiVersion is inst->apiVersion() limited by the version the
physical device reports. Therefore, use caps.apiVersion when
setting up the memory allocator, like it is done everywhere else.

This is expected prevent vma init failures on lavapipe in some Linux
distros.

Pick-to: 6.6 6.5
Change-Id: I4e693820c95a5e0174846afb20e42aadd56034d6
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2023-07-31 12:38:40 +02:00
Laszlo Agocs
108b101441 Handle rhi init failures better in rhi backingstore flush
One may very well force a 3D API not functional. In this case there will
be no QRhi. A bunch of warnings will be printed (which is good), but
then flush() should not do anything, and that was not handled before.

Pick-to: 6.6 6.5
Change-Id: I82139070311152c959d39a553842f4462d8e7811
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2023-07-31 12:38:40 +02:00
Laszlo Agocs
e98ee5f6f4 rhi: metal: Centralize command buffer creation
...and add a single toggle that can be used to switch between
regular (auto-retaining) and unretaining command buffers.

Change-Id: I9ef4b149f172415733e590e8320165358e29fa16
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2023-07-31 12:38:40 +02:00
Laszlo Agocs
eb99d19cc4 rhi: d3d12: Implement lastCompletedGpuTime via timestamp queries
Change-Id: I5f2588268cf4d52025f9b1c8d94cdcd9a742531c
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-07-31 12:38:40 +02:00
Amir Masoud Abdol
95ed8d1fd9 Fix the project name
Fixes: QTBUG-115327
Pick-to: 6.2 6.5 6.6
Change-Id: I77fc3a98d1658609caa9618430f6e6823b8e1bb5
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-07-31 12:38:40 +02:00
Jens Trillmann
7012bea614 Improve Intent source app detection
Activity.getReferrer does not only return app IDs but also URLs if
Intent.EXTRA_REFERRER is set on the Intent. In the case of Chrome the referrer
is set to the website triggering the Intent. To improve the detection of the
calling app we check first if the browser specific
Browser.EXTRAS_APPLICATION_ID is set. If it is not set we fall back to
Intent.getReferrer.

Pick-to: 6.6 6.5
Change-Id: I33d1edd52de98486d9616713e531ea20ada87bcb
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2023-07-31 09:38:56 +02:00
Ahmad Samir
b902b152af QObject: replace _q_reregisterTimers with a lambda
- Pass the QList by value, no heap allocation and no plain new/delete
- A lambda means that there isn't runtime string-based lookup to find
  the member method in QObjectPrivate

The code is only a couple of lines and used in a single place, so might
as well move the code from _q_reregisterTimers to the local lambda.

Modify tst_moc to account for the numer of methods in QObjectPrivate
changing. The test had hardcoded numbers.

Change-Id: I07906fc7138b8e601e4695f8d2de1b5fdd88449c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-07-31 01:52:25 +03:00
Laszlo Agocs
e8e9c287ec doc: Fix QVulkanFunctions code snippet
Showing code that cannot possibly compile is bad practice.
(vkAllocateCommandBuffers is in QVulkanDeviceFunctions, not
QVulkanFunctions)

Rather use a member function that is actually in QVulkanFunctions.

Pick-to: 6.6 6.5 6.2
Change-Id: I3063a8a229152144ce866e915eb4c14ecc58e9ce
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2023-07-30 20:12:20 +02:00
Laszlo Agocs
fa96e76ab1 rhi: metal: Disable MTLBinaryArchive usage regardless of OS version
Ironically enough when the old macOS 13 problem is no longer occurring
(at least on an M1 Mini with 13.2.1), so the OS version based
differentiation could likely be removed, there are now reports about
problems with old Intel hardware and earlier OS versions.

Therefore, get rid of the OS version based logic, and rather add
a global flag that is enabled unconditionally for now, which
disables MTLBinaryArchive usage altogether.

How much we lose is not very clear anyway. The OS performs its
own persistent caching (most likely), hidden from applications.
Thus what we lose really is the fine grained control over the
data (e.g. specifying a custom storage file via
QQuickGraphicsConfiguration), with the possibility of pre-seeding
for the first run. As the performance of subsequent runs is less
likely to change in any significant way, this is seen as not
a big deal for Apple hardware in general so we might just live
with this. (and on macOS 13+ this was already crippled anyway
due to the OS version logic)

Pick-to: 6.6 6.5
Fixes: QTBUG-114338
Task-number: QTBUG-108216
Change-Id: If7b908baea2093f6882674ebfbdc18e770d6503e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-07-30 20:12:10 +02:00
Jacek Poplawski
cd33d90e9f Skip tst_QMimeDatabase::mimeTypeForUnixSpecials_data when AT_FDCWD is not defined
Change-Id: I6fd3bb3e56733b79f349934319a071f8eabaf0ea
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-07-28 23:13:09 +02:00
Laszlo Agocs
4abf862bca android backingstore: Drop out-of-date surface type check
Running a Vulkan-based QRhiWidget (upcoming in 6.7) and QQuickWidget
shows the "...does not support OpenGL-only windows" warning which is
pointless nowadays. Since Qt 6.4 RasterGLSurface is not in use,
whereas the surface type can very well be VulkanSurface too.

Pick-to: 6.6 6.5
Change-Id: I790767e683b2a4cffc99cbc38015aca809cf83c5
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2023-07-28 21:21:33 +02:00
Laszlo Agocs
54e114f20d rhi: d3d12: Clean up the warning shown when dxc libs are missing
Since this was written we added support in windeployqt to find these
DLLs similarly to how the old d3dcompiler_*.dll is bundled.
Therefore, rephrase a little bit.

Change-Id: I13eafea67607900307ff84da3323e84e066de9f8
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2023-07-28 21:21:33 +02:00
Laszlo Agocs
e310bc1646 cocoa: Handle VulkanSurface for backingstores
Should be no different from MetalSurface and OpenGLSurface.

Pick-to: 6.6 6.5
Change-Id: I529f2904a43e44376e9f2da2489fac57670d954d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-07-28 21:21:33 +02:00