Move most string handling code out of the environmentMutex critical
sections to increase parallelism (Amdahl's Law).
I drew the line at temporarily dropping the mutex to allocate memory
for the return QByteArrays, as that would have meant to loop over
obtaining the size, allocating it, and then copying the data which
would have overly complicated the code.
Pick-to: 6.4
Change-Id: I980cbf7fda76fc8057f84b2539b4a299e06cae82
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
I don't expect environments to allow values or names > 2 Gi
characters, so this is just for consistency (int is a code smell these
days).
As a drive-by, replace
QString buffer;
buffer.resize(n);
with
QString buffer(n, Qt::Uninitialized);
Task-number: QTBUG-103527
Pick-to: 6.4 6.3 6.2
Change-Id: I0e41a6e7e9c44ff1ec22377329735538d5f95181
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The std::boyer_moore_searcher is buggy for older verions of Microsoft's
STL, and missing in AppleClang's libc++ with an inefficient fall back.
Fixes: QTBUG-100236
Change-Id: Ic3cc916946546d2ef78456cd15e1425d957b989d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Added a parse option that can be passed to setContent(), to specify that
spacing-only text nodes must be preserved.
[ChangeLog][QtXml][QDomDocument] Spacing-only text nodes can now
be preserved by passing the ParseOption::PreserveSpacingOnlyNodes option
to setContent().
Fixes: QTBUG-104130
Fixes: QTBUG-89690
Task-number: QTBUG-90003
Change-Id: Id43730ce5b79a856c4b434d1f1d4dd7c49c25f31
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This avoids having to rely on moc precalculating everything and getting
its sums right, as the main integer table only has a string index
(unlike my original 5.0 plan which would have stored the offset).
For example, for:
struct Object : QObject { Q_OBJECT signals: void changed(const QVariant &v); }
moc now generates:
struct qt_meta_stringdata_Object_t {};
static constexpr auto qt_meta_stringdata_Object = QtMocHelpers::stringData(
"Object",
"foobar",
"",
"v"
);
Notes on the implementation:
* the old code is retained because we need moc 6.5 to generate code
compatible with QtCore 6.2-6.4. It's marked for removal in Qt 6.9.
* the struct qt_meta_stringdata_%s_t remains because we need a
TU-specific type for QtPrivate::is_complete (via
qt_incomplete_metaTypeArray). This can be cleaned up.
* after this change, GDB complains while loading QtCore:
warning: internal error: string "StringData<long sequence of numbers>" failed to be canonicalized
but debugging does not appear to be impacted. It's just annoying
because it shows up when QtTest detects a crash too.
Change-Id: Id0fb9ab0089845ee8843fffd16f9d5493e9bd708
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Converting from QImage::Format_ARGB32 to QRhiTexture::RGBA8 requires
texture swizzling also on big endian. But unlike on little endian it
is not a red/blue swap that is needed, but a rather rotation of the
alpha channel from the first component to the last.
Add a new swizzling mode to the backingstorecompose fragment shader,
and rename the uniform to reflect that it no longer covers only
red/blue swapping.
Pick-to: 6.4
Change-Id: I001d275abdc88faaadea16e396ebe032b34e83f0
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Using QTime(), which is null and invalid, as the time field of a
QDateTime is supported, but is ill-advised. Use the start of the day
instead.
Change-Id: If30db046218926f7634bbcfcf35cd000d7f6535f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Since 6.3 these use Qt::UTC as time-spec but I neglected to take that
into account in QDateTimeEditPrivate::init()'s construction of a
QDateTime from the QDate or QTime. This amends
commit c00ee2f310.
Fixes: QTBUG-105322
Pick-to: 6.3 6.4
Change-Id: I11dec9808a54cf7da401b1734a9a2812f5fd2e63
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Change to match how QDateTimeEdit()'s overloads taking a QDate or
QTime work, substituting a default value in place of an invalid one.
This fixes one surprising anomaly in a recently-extended test, so that
it now only fails the way I expected.
Task-number: QTBUG-105322
Change-Id: Ied4da6160b7efe70990f956798fb826b5b36d8bb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The constructor_qdate() and constructor_qtime() tests only tested
QDateTimeEdit with a QDate or QTime. Extend them to also test
QDateEdit and QTimeEdit constructors, respectively. This revealed one
surprise; the QDateEdit constructor doesn't replace an invalid QDate
with the usual start-date, as the QDateTimeEdit does. It also serves
to reproduce a bug reported in Qt 6.3, see Task-number. These are
all marked XFail for now.
Task-number: QTBUG-105322
Change-Id: Ifafb40a9b78d9314b74ca9a1710d362b9a3cb18d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It makes no sense to pass, as parameters, values that can't vary
between test data rows, so eliminate m{in,ax}imum{Dat,Tim}e
columns. There were no parameters used to control how those would be
set, so they were always going to be the type's defaults.
The displayDateTime was only needed for the invalid test, in which its
value is known and fixed; for the normal test it was necessarily
implied by the parameter used to initialize the QDateTimeEdit. While
the QDate and QTime tests do have to supplement that construction
information, the other part is again known and fixed. We can check the
data-tag against "invalid" to determine which known and fixed data to
use, saving the need for a data table column.
Change-Id: I3754ba1a6a127a4a872a7f4a3e7edad9a5ff0ec0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QVulkanWindow has recently been updated both in 5.15 and 6.x to start
enabling at least the 1.0 core features, because modern validation
layers are likely to complain if a feature is used without the
corresponding flag enabled upon device creation, even if the driver does
not actually care.
There is a catch here however, namely that some features may be true
opt-in flags, e.g. robustBufferAccess, and when enabled, they may incur
a performance penalty. So we will keep that one feature disabled even
when it is reported as supported.
It is unfortunate that VkPhysicalDeviceFeatures mixes together flags
that are most likely used only to query if some feature is supported by
the implementation while not serving as a real toggle (because opting
in/out is meaningless for the implementations in practice), and flags
that have significant effects when the feature is enabled, for example
when it comes to performance.
As QVulkanWindow only cares about 1.0, and 1.1+ features are to be
handled by the application via the features-modifier callback, we can
get away by just disabling robustBufferAccess and passing in everything
else supported as-is for vkCreateDevice.
Task-number: QTBUG-105158
Pick-to: 6.4
Change-Id: I963402ab50f6e5d3fa6824680f69cff8568b669a
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Apparently, we still support these architecture versions, and there's
no way to detect ARMv6k-or-greater specifically, so exclude yield for
ARM < ARMv7.
Amends 877c158c59.
Fixes: QTBUG-104316
Pick-to: 6.4 6.3
Change-Id: I51a2f0f8e0993dba41e47bb6110473ac8e7cd32a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
openssl3 uses uint64_t for the options argument in SSL_CTX_set_options,
older ones used long.
sizeof(long) is not the same on any platform as sizeof(uint64_t)
Fixes: QTBUG-105041
Change-Id: If148ffd883f50b58bc284c6f2609337d80fb5c58
Pick-to: 5.15 6.2 6.3 6.4
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
VkPhysicalDeviceVulkan11Features and co. need to be considered
separately, for now we just sync the enabling of 1.0 core
features between QVulkanWindow and QRhi, both in 5.15 and 6.x.
For QRhi in Qt 6 this will need to be amended separately once
the myriads of 1.1/1.2/1.3 features are investigated.
Like everywhere else, robustBufferAccess is disabled. We do not
want features that likely affect performance. To be checked
later on if adding some sort of opt-in mechanism for this is
sensible or not.
Task-number: QTBUG-105158
Pick-to: 6.4
Change-Id: Ia3d8c1e6bb8be8643e80178954dca0aa8b92d3c0
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
The output was only printed if the request was no longer available
queued, meaning that it had been removed before the socket had finished
its connection attempt. That means the result of the attempt is not of
much interest to the user so we should not print it out as a warning.
The reason for why the request was removed from the queue would be the
interesting bit, but it's not covered here.
Task-number: QTBUG-85248
Pick-to: 6.4 6.3 6.2 5.15
Change-Id: Iac483b8bb600e1577fe88c3699e46d50615bfccb
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
It's the same implementation. This also inlines the actual comparison,
to allow the compiler to implement the inline memcmp, if it so wishes.
operator< could be changed too, but QByteArrayView's makes an out-of-
line call to QtPrivate::compareMemory, whereas QLatin1StringView's calls
memcmp() directly, which allows the compiler to optimize.
Change-Id: I89c4eb48af38408daa7cfffd16fde9f2b0a8590b
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Instead of having that function load those from memory. This allows us
to pass constant expressions in QVariant::Private s constructor
Change-Id: I3859764fed084846bcb0fffd17045ddd62553710
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This means we can't do a tail-call from customConstruct when
PrivateShared is in use. But the case without that is still a tail-call.
Change-Id: I3859764fed084846bcb0fffd17045d144181ea84
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Even though it's calling a noexcept(false) constructor, we can declare
when it it won't throw and allow the caller to suppress its own
exception handling.
This necessitated splitting the Q_DECLARE_SHARED into its components
because fromValue<QVariant> uses QTypeInfo<QVariant>::isRelocatable.
Change-Id: I3859764fed084846bcb0fffd1704503aa4d3e535
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Group them by noexceptness and then organize each group logically. We
also don't need to #ifdef the constructors for the unavailable classes,
as they are forward-declared.
Change-Id: I6f936da6f6e84d649f70fffd17060903c78edf0f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
- The main window needs to be at the back always, since it's fullscreen. If the root
window gets in front then there's no way to retrieve the secondary windows.
- Qt::Tool and transient child windows go to front as in other QPAs
Change-Id: I4a2793628250756bc07daaee0763ea7174a7bebd
Pick-to: 6.3 6.4
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Since QPlatformScreen::topLevelAt() wasn't implemented it would just fallback
to use QGuiApplication's window list.
Possibly fixes any other bug that relied on QApplication::topLevelAt().
The fix is to consult the compositor, which has proper z-order information,
unlike QGuiApplicationPrivate::window_list.
Task-Id: QTBUG-105256
Pick-to: 6.3 6.4
Change-Id: I4202dd5d87e41b69c461c808d29b809af5b52d09
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
watchOS is no longer supported, nor should the workaround be necessary
anymore.
Pick-to: 6.4 6.3 6.2
Change-Id: Id5898d14b10e8f4aeaf6ce42ab39dbfdff9338ef
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Update vk.xml to 1.3.223 and make qvkgen output the Vulkan 1.3 functions
as well.
[ChangeLog][QtGui] QVulkanFunctions and QVulkanDeviceFunctions are
updated to expose the Vulkan 1.3 API as long as the build environment's
vulkan.h is 1.3-capable.
Fixes: QTBUG-105270
Change-Id: Iabe04f0a74cdbd94efcc1869f545da058a553fed
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
The alternative would be to return a null QByteArray, but the current
implementation makes calling read() on an empty QByteDataBuffer UB, so
this is behavior-preserving, just with a bit nicer error message.
Pick-to: 6.4 6.3 6.2
Change-Id: Ia9db7acbfa47e601b466d6cc6a728859065c27b5
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
It was designed to gauge the impact of replacing QString functions
with QStringView ones, as opposed to just overloading, but that never
came to pass, for two reasons:
1. We never got to implement a full set of overloads with the pattern
in a large enough library (QtCore) for results to matter.
2. QStringView doesn't accept everything that QString accepts, making
it unsuitable as a drop-in replacement (QAnyStringView has that
property, though, but we never added a QT_ANYSTRINGVIEW_LEVEL
macro).
So, R.I.P. QT_STRINGVIEW_LEVEL.
Fixes: QTBUG-100861
Pick-to: 6.4
Change-Id: I0a9318177acb295e8eeeddfb345449112070c597
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The getEscape function truncated the qsizetype position it got from
the caller to an int, potentially parsing a previous escape sequence
(or, more likely, garbage), by getting the position in the string
wrong.
Pick-to: 6.4 6.3 6.2
Task-number: QTBUG-103531
Change-Id: I3b921c0991d238bbacfe6699c56146fe032134df
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
I was told this is 32-bit-only code in Qt 5, where it didn't really
matter, because only QStringView could handle > INT_MAX character
strings. Put up a big stop sign now in Qt 6 to enforce that this
information is correct, incl. notes for when it turns out it isn't.
Pick-to: 6.4 6.3 6.2 5.15
Task-number: QTBUG-59150
Task-number: QTBUG-103531
Change-Id: I4620a43e2e67776cc67531fa993a7bb8e01cffed
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The simulator build of Qt for iOS is currently x86_64 only, instead
of universal builds with an arm64 slice as well, since we don't
support xcframeworks. This means we can't rely on Xcode's default
simulator arch settings, which on an Apple Silicon Mac will be
arm64.
Instead we override the simulator arch, like we do for qmake.
Pick-to: 6.4 6.3 6.2
Change-Id: I8b52389db1b83f4f9679c724bcde53b44dbc76f1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
We already had code to handle attributes on funtcions, but we didn't
handle them correctly for classes so far.
Fix this by simply skipping over the attribute.
Fixes: QTBUG-105310
Pick-to: 5.15 6.2 6.3 6.4
Change-Id: Ic4149f940e74820de4f2fa9540d9dc5b4e626a3a
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
The macOS app code path was missing a bunch of finalizers that also
makes sense for macOS apps.
Pick-to: 6.4
Change-Id: I2b779a1d64086824f43e304f2c7d3b1cd2780070
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
And use the new struct as a result type for error getters instead of
std::tuple. The line and column numbers, therefore, grow to qsizetype
instead of int.
As a drive-by, make the getters inline.
Change-Id: Iad652063af2c9183cb60f27320c2a800ae28ba36
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Added new setContent() overloads, that:
- take parameter of new ParseOptions enum type for specifying the parse
options that can be used for enabling namepsace processing and, in
future, whitespace-only text nodes, etc.
- use ParseResult for returning the information about error message,
line and coulmn number, instead of three parameters for each.
- use QAnyStringView for a QString input data.
To avoid ambiguities when calling setContent() with one argument,
removed the default argument for errorString from all the overloads.
[ChangeLog][QtXml][QDomDocument] Added new setContent() overloads that
allow specifying different parse options through ParseOptions flags.
These overloads use a new ParseResult struct for returning the
information about an error, and QAnyStringView for passing string input.
[ChangeLog][QtXml][QDomDocument][Potentially Source-Incompatible Changes]
setContent() overloads that take only one argument now return
ParseResult instead of a bool. ParseResult explicitly converts to bool,
so the expressions calling setContent() with one argument will continue
compiling, if they are contextually convertible to bool. If an implicit
convertion is required (e.g. bool b = doc.setConetnt(data)), the result
needs to be explicitly converted to bool first
(e.g. bool b = bool(doc.setConetnt(data)).
Task-number: QTBUG-104507
Change-Id: If6a78f8c9b1458f0e3ae719bfd3703a0b965449c
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Simply cast from uint to qsizetype: All supported compilers will already
complain long before we reach an argument can that can represented by
unsigned int but not by qsizetype.
Change-Id: I455bde34db6b50ae9e017c7e2e811e22df926614
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Refactoring of module exports in qwasmintegration.cpp was not followed
by adjusting the qtloader. Do this now.
Fixes: QTBUG-105264
Change-Id: Ibb0a4a20c0df1409cdcbba04ebd42c1569ae586a
Reviewed-by: David Skoland <david.skoland@qt.io>
A window with alpha > 0 is no longer forced to using a legacy,
non-flip swapchain. Instead, the Win8+ DirectComposition API is used
in that case to get a properly composited semi-transparent window.
The remainings of the non-flip model swapchain support, that was left
after purging Windows 7 in order to support semi-transparent windows,
is now gone completely. Setting QT_D3D_NO_FLIP has no effect from now
on. DXGIFactory2 and flip model swapchains are now always required and
in use.
There is one downside when it comes to the swap effect: for
semi-transparent windows we will be stuck with SCALING_STRETCH as
SCALING_NONE is not supported on this path. Using NONE over STRETCH
was preferable for typical Qt applications because user interfaces
typically look "nicer" during resize without stretching when ending up
with a size-mismatched Present. For normal (non-translucent) windows
this will continue to be the case, but enabling alpha will now move
back to SCALING_STRETCH implicitly.
In addition, it looks like AlphaMode is ignored when using
CreateSwapChainForComposition. Setting DXGI_ALPHA_MODE_STRAIGHT fails
always whereas other values lead to an identical looking (with
transparency) result. Therefore we just set it to
DXGI_ALPHA_MODE_PREMULTIPLIED regaredless of which QRhiSwapChain alpha
flag is set.
Fixes: QTBUG-105271
Change-Id: Ie7a584e1656ccfdb506489ea21c41706f57c4018
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
This affects the users of the QVulkanInstance creation helper, which are
Qt Quick and the backingstore compositor for texture-based widgets.
Change-Id: I6c3eccfade3cf9be7811dda66aca9d63ece4534c
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Instead of disconnectFromHost where I accidentally put it.
Also change the condition for reading data to match.
Change-Id: I4c58f8e0fc04ff6a773158ca0150dd0a3098b36b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
When tst_QDateTime::fromStringStringFormat_localTimeZone_data() skips
due to feature timezone being undefined, it should report that as the
issue, rather than claiming the system doesn't support the particular
zones used in the test.
Change-Id: I9837ac95c6d92317fbec7fcca184f7b7e6f81441
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Also document the (seldom helpful) handling of over-long repeats of a
format. Add test to QDateTime and amend QLocale test.
[ChangeLog][QtCore][QDateTime] Doubling the 'z' format in a date-time
or time format string now produces the same output as a single 'z'.
Previously, this would have produced two copies of the milliseconds
field (eliding any trailing zeros in each). Contrast with 'zzz', which
produces the full milliseconds field, including any trailing zeros.
Change-Id: I4c60462b062fee4079370096d745c191c1939506
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>