Commit Graph

62659 Commits

Author SHA1 Message Date
Liang Qi
c41733b06b tests: blacklist tst_QWidget::render() on Wayland
which is flaky.

Task-number: QTBUG-115598
Pick-to: 6.6 6.5
Change-Id: Ibb0a0c6b1e225144e2ce796691c40bb7510bfd56
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-08-03 07:23:37 +02:00
Antti Määttä
74dd646e82 CTF: Add streaming support
Implement TCP server to stream trace data. Use the QTRACE_LOCATION
environment variable to configure the server address and port.

The rest of the configuration is done in the client TraceRequest.
The user can configure the compression level, buffer size and
whether the server is buffering when client doesn't have connection.

The server responds with basic response and then begins sending packets
until the client disconnects or the app closes.
Each packet contains stream name, stream data and whether to overwrite
the stream, which is used with metadata streams.

Task-number: QTBUG-105976
Change-Id: I41c708a4c7988666d59f0c6093dd41e8ccd88441
Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
2023-08-03 08:23:36 +03:00
Antti Määttä
c6ab516f71 CTF: Clear output location at startup
Remove old files from the output location before saving new ones.

Pick-to: 6.6 6.5
Change-Id: I75181126c6c920e13951e9a46a6be1c666d457fe
Reviewed-by: Antti Määttä <antti.maatta@qt.io>
Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
2023-08-03 08:23:30 +03:00
Ahmad Samir
7fe1198f6e QAbstractSocket: remove a redundant stack variable
Just use the static const int directly.

Change-Id: Icf37ac5db4457bbc8631659e175d038cfeed46e4
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-08-03 02:12:22 +03:00
Ahmad Samir
8ed2bc9194 QByteArray: change append(QByteArray) to match QStringBuilder behavior
I.e. concatenating a null byte array and an empty-but-not-null byte
array should result in an empty-but-not-null byte array.

This matches the behavior of QString::append(QString) too.

Fixes: QTBUG-114238
Pick-to: 6.6
Change-Id: Id36d10ee09c08041b7dabda102df48ca6d413d8b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-08-03 02:12:22 +03:00
Ahmad Samir
d1da83002d QByteArray: remove a unittest
It relied on an implementation detail of operator+=(), that the latter
wouldn't just use assignement (e.g. if `this` is empty/null).

It also had undefined behavior, when the char array used with
fromRawData() went out of, the nested, scope, the code was pointing to a
dangling stack pointer.

Thanks to Thiago for the explanation in code review.

This ties in with further changes in this series, where append() is
changed to preserve null-ness; there is no way to preserve null-ness in
append() while keeping this unittest passing.

Change-Id: I43b9f60db9ce2d471f359f32bcc48e7b4cfceeab
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-08-03 02:12:22 +03:00
Ahmad Samir
c168172ea9 qstringalgorithms: make trimmed_helper_positions [[nodiscard]]
Change-Id: Ic3a3ed29b2472487634715ee7b447b36d04b377f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-08-03 02:12:21 +03:00
Marc Mutz
f141108887 Port QCoreApplication::requestPermission() to SlotObjUniquePtr internally
Well, except that the ownership of the slot object here is actually
shared between the PermissionReceiver and the lambda passed to
QPermission::Private::requestPermission(), which eventually may hand
ownership over to QMetaCallEvent, so we can't really use
SlotObjUniquePtr.

While we can, of course, manually copy and call ref(), even if the
slot-object is stored in a SlotObjUniquePtr, unfortunately, the lambda
is subsequently stored in a std::function, which infamously cannot
hold move-only objects, so we actually need something copyable.

So grasp the nettle and implement a SlotObjSharedPtr.

I was originally planning to just make this a typedef for
QIntrusiveSharedPointer, but that's not in dev, yet, let alone 6.5, to
which we're picking this, and there was always this nagging impedance
mismatch between the QIntrusiveSharedPointer behavior, inherited from
it's Q(Explicitly)SharedPointer roots, on the one hand, to always
ref() in the constructor from raw pointer, and, OTOH, QSlotObjectBase
starting its life with a ref-count of one (1) (not zero (0), like
QSharedData).

I eventually found the (elegant, if I may say so myself) solution to
just not provide a constructor from raw pointer, only one from
SlotObjUniquePtr, which, granted, has the same issue, but which is, by
now, probably, hopefully, more fully grasped by QtCore regulars, and so
we can piggy-back on that for SlotObjSharedPtr's constructor
semantics.

Add a comment nevertheless.

Inside the lambda, we could theoretically move the slotObj into
QMetaCallEvent::create(), after adding such conversion to
SlotObjSharedPtr, but that would require making the lambda mutable,
and seeing as it's stored in a std::function and copied around, I was
not ready to make that change just yet.

As a drive-by, make PermissionReceiver's constructor explicit.

Pick-to: 6.6 6.5
Fixes: QTBUG-115330
Change-Id: I4e0cec13d19a19eeec31e4101ce289d07c92ce46
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-08-02 22:11:12 +02:00
Marc Mutz
902063628f QSlotObjectBase: fix return value of ref()
QAtomicInt::ref() returns bool, not int, so do the same in our ref().

As a drive-by, drop the superfluous inline keyword.

Pick-to: 6.6 6.5
Change-Id: I60712df3640b67dfd857355d364e0fc5a3a40650
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-08-02 22:10:33 +02:00
Thiago Macieira
3e2b3c094e CMake: remove TEST_glibc
Commit aa82d295c8 changed from using
minimum-linux.S to qlibraryinfo.cpp, so we no longer need this. Saves
350 ms of CMake time.

Change-Id: Ifbf974a4d10745b099b1fffd177754aa5a4096ac
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-08-02 12:36:18 -07:00
Thiago Macieira
4a5f3c8b93 CMake: remove check for cxx11_future
Everyone must have this by now. This test was 1193 ms of CMake time.

Since this was a PUBLIC feature, I've left it around with a constant
condition.

Change-Id: Ifbf974a4d10745b099b1fffd177754538bbff245
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-08-02 12:36:18 -07:00
Thiago Macieira
f44072ca43 CMake: remove test for cxx11_random
Everyone has it, without exception. QRandomGenerator uses the Mersenne
twister without checking, so you can't have Qt without this. This test
was here only to produce an error at CMake time instead of at build
time, but that test costs 650 ms for everyone running CMake without
cached results.

Change-Id: Ifbf974a4d10745b099b1fffd177753b6d4fc89d4
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-08-02 12:36:18 -07:00
Alexey Edelev
d7a3733056 Fix standalone headersclean_check targets
If module depends on some module Private part only the sync_headers
dependencies from this public part of this Private module is skipped.
Check if the module is Private and use the public module to read the
_qt_internal_sync_headers_target property.

Amends 0006a564c8

Fixes: QTBUG-115712
Pick-to: 6.6
Change-Id: I4678e2a6c9ec8f80862a97d48f0a3b4214ae2307
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-08-02 20:22:52 +02:00
Tor Arne Vestbø
4ede419533 tst_foreignwindow: Run test with high-DPI disabled
To avoid having to take high-DPI scaling into account for geometry
calculations/comparisons.

Pick-to: 6.6
Change-Id: I941b74781264455b70520df8d1e6e91592e00310
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-08-02 19:36:13 +02:00
Dennis Oberst
d7d15c1a47 Use new QBA::assign in QXcbMime::mimeDataForAtom
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: I5e5114064c8aaa23892e95c235335632d7c5cd0a
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-08-02 17:11:45 +02:00
Dennis Oberst
da5f2fc6be QFreeList: Resolve symbol ambiguity in unity build
Remove 'qfreelist.cpp' from the NO_UNITY_BUILD_SOURCES section
and fix the underlying problem of the clashing symbols with
'qabstracteventdispatcher.cpp', by wrapping the unnamed enum in
a namespace.

Amends: a07426d23a.

Task-number: QTBUG-109394
Pick-to: 6.6 6.5
Change-Id: I585ab06a33d46a11a48220f504c53a5f4fa91d7e
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-08-02 15:11:45 +00:00
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