Commit Graph

57488 Commits

Author SHA1 Message Date
Marc Mutz
0beb58cf58 Pull some processing out of environmentMutex critical sections
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>
2022-08-04 23:33:35 +02:00
Marc Mutz
c25cc34a05 Port qenvironmentvariables.cpp to qsizetype
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>
2022-08-04 21:33:35 +00:00
Øystein Heskestad
15368fb31b Add Latin 1 case-insensitive Boyer-Moore searcher
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>
2022-08-04 23:12:39 +02:00
Sona Kurazyan
26a73e1b31 QDomDocument: Add a way to enable spacing-only text nodes
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>
2022-08-04 22:17:05 +02:00
Thiago Macieira
7ceba9c472 moc: use C++ constexpr to generate the meta object string data
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>
2022-08-04 12:50:12 -07:00
Thiago Macieira
c23b595769 moc: move some of the helpers into a header dedicated to it
Change-Id: Id0fb9ab0089845ee8843fffd16f9d080029f2f7f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2022-08-04 12:50:12 -07:00
Thiago Macieira
a8ebadac59 Fix several more improperly placed #include moc
Like commit qtbase/638893bea083b619b73b33a7dd5589fb2c4c4242.

Script to find them:

 git grep -l '#include.*moc' \*.cpp \*.mm | \
   xargs awk '/QT_BEGIN_NAMESPACE/ { i=1 } /QT_END_NAMESPACE/ { i=0 } /#include.*moc/ && i { print ARGV[ARGIND], $0 }'

Pick-to: 6.4
Change-Id: I6f936da6f6e84d649f70fffd17058fd05cfc5c6d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-08-04 12:50:12 -07:00
Marcus Comstedt
d2fcccd3f1 Fix composition of render-to-texture widgets on big endian
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>
2022-08-04 21:50:12 +02:00
Edward Welbourne
dcaa05f697 Fix a date-time with invalid QTime to use a valid one
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>
2022-08-04 20:39:52 +02:00
Edward Welbourne
607c5a90c5 Fix initialization of QDateEdit and QTimeEdit
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>
2022-08-04 20:39:52 +02:00
Edward Welbourne
a46a426b43 Fix handling of invalid input to Q(Date|Time)Edit constructors
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>
2022-08-04 20:39:52 +02:00
Edward Welbourne
d1d43b231f Expand QDateTime edit constructor tests to cover Q(Date|Time)Edit
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>
2022-08-04 20:39:52 +02:00
Edward Welbourne
4579ec04a4 Simplify the data tables for some QDateTimeEdit constructor tests
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>
2022-08-04 20:39:52 +02:00
Laszlo Agocs
f6dc0b4b20 Skip potentially costly features in QVulkanWindow
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>
2022-08-04 20:39:52 +02:00
Marc Mutz
8128abeaec Fix qYieldCpu() for ARM < ARMv7
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>
2022-08-04 18:21:06 +00:00
Sona Kurazyan
fd681d3e85 Move q{,Utf8, Utf16}Printable to qstring.h
Task-number: QTBUG-99313
Change-Id: I76ef84e4c90ab04a3e04c165ba46800e27ea6122
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-08-04 20:21:06 +02:00
Michael Saxl
e995bfc0ea update function argument of SSL_CTX_set_options
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>
2022-08-04 18:47:10 +02:00
Laszlo Agocs
e00e215e00 rhi: vulkan: Enable all but one of the 1.0 core features
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>
2022-08-04 14:53:28 +02:00
Sona Kurazyan
9cbdc0f14c qoverload.h: add the missing QT_{BEGIN, END}_NAMESPACE macros
Amends ff8de321e2

Change-Id: I2437274ae365ef896b22408bc90f763141359618
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-08-04 14:53:08 +02:00
Oliver Wolff
9a5ac4bcb3 Add keyword msvc-2022 to testlib blacklisting
Pick-to: 6.2 6.3 6.4
Change-Id: I04942dc9474fd2abfc341a1dd6434f7c78b6b5bd
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-08-04 10:18:41 +00:00
Mårten Nordheim
373285857f QtHttp: Lower the severity of some log output
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>
2022-08-04 11:23:55 +02:00
Thiago Macieira
e0eb93d9a2 QLatin1StringView: delegate operator== to QByteArrayView
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>
2022-08-04 00:37:35 -07:00
Thiago Macieira
751919d4de QByteArray: delegate more of operator== & !+ to QByteArrayView
QByteArrayView is capable of dealing with null pointers.

Change-Id: I89c4eb48af38408daa7cfffd16fde9ab021ebf06
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-08-04 00:37:35 -07:00
Thiago Macieira
cfa955040c QVariant: pass the size and alignment to PrivateShared::create()
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>
2022-08-03 19:51:25 -07:00
Thiago Macieira
392e445393 QVariant: don't leak PrivateShared if the constructor throws
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>
2022-08-03 19:51:22 -07:00
Thiago Macieira
0db329e48d QVariant: add noexcept to fromValue when possible
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>
2022-08-03 19:51:21 -07:00
Thiago Macieira
181aec92b6 QVariant: reorganize the constructors in the header
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>
2022-08-03 19:51:18 -07:00
Sérgio Martins
9ccbbeecbd eglfs: Ensure correct z-order of windows
- 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>
2022-08-04 02:55:27 +01:00
Sergio Martins
40d781b7b5 eglfs: Fix mouse events not being delivered to the frontmost window
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>
2022-08-04 02:55:27 +01:00
Tor Arne Vestbø
8669949f0d Remove if_types.h workaround for watchOS
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>
2022-08-04 03:35:36 +02:00
Laszlo Agocs
651092c218 Bump QVulkan(Device)Functions to Vulkan 1.3
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>
2022-08-04 03:35:36 +02:00
Marc Mutz
011b68d3cd QByteDataBuffer: assert an undocumented precondition
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>
2022-08-04 03:35:36 +02:00
Marc Mutz
046a5a8f4f Eradicate QT_STRINGVIEW_LEVEL
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>
2022-08-04 01:35:36 +00:00
Marc Mutz
841ff3b73f Fix QString::arg() for format strings > 2Gi characters
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>
2022-08-04 03:35:36 +02:00
Marc Mutz
753079b707 Statically assert that the __mips_dsp code is only active on 32-bit
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>
2022-08-04 01:35:36 +00:00
Laszlo Papp
3698186f9d QAbstractNativeEventFilter: Fix the Mac example class name
Change-Id: I838350883fa6bd8c80f87fba18f006afd905ed61
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-08-04 00:49:01 +01:00
Tor Arne Vestbø
6ec21881dd CMake: Override simulator architecture to x86_64 for Xcode generator
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>
2022-08-03 21:40:08 +02:00
Andy Nichols
3f450a6ba0 Defer release of QMetalGraphicsPipeline objects
Pick-to: 6.4
Change-Id: Ia7ee1a1b13a8b5ac1ef4859330150f0558793dfe
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2022-08-03 20:46:30 +02:00
Fabian Kosmale
84ab6c1aa1 moc: handle attributes in class declarations
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>
2022-08-03 20:14:42 +02:00
Tor Arne Vestbø
d5580aa719 cmake: Share most finalizers between macOS and iOS apps
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>
2022-08-03 20:14:42 +02:00
Sona Kurazyan
7de21b268a QDom: use QDomDocument::ParseResult for storing the error info
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>
2022-08-03 20:14:42 +02:00
Sona Kurazyan
8cc389068b Improve QDomDocument::setContent() API
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>
2022-08-03 20:14:42 +02:00
Fabian Kosmale
b65e37b744 qmetaobject: Fix sign-compare warning
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>
2022-08-03 19:43:35 +02:00
Mikolaj Boc
b7802b401f Use the correct module exports in qtloader
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>
2022-08-03 19:43:35 +02:00
Laszlo Agocs
3ee65daa74 rhi: d3d: Switch to DirectComposition for semi-transparent windows
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>
2022-08-03 19:06:19 +02:00
Laszlo Agocs
71e3840f3a rhi: vulkan: Improve alpha swapchain logic
Fixes: QTBUG-105011
Pick-to: 6.4
Change-Id: Iea113d92e3261711b4fce88733cc2d7472b10829
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2022-08-03 19:06:19 +02:00
Laszlo Agocs
0fb4b49d1d vulkan: Request an 1.3 instance if supported
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>
2022-08-03 19:06:19 +02:00
Mårten Nordheim
5c0ce1b14c Schannel: move final read to disconnected()
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>
2022-08-03 18:38:53 +02:00
Edward Welbourne
a9b46b79dd Rearrange the skipping of a test to give a better message
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>
2022-08-03 18:38:53 +02:00
Edward Welbourne
0a36a7c1db Make 'zz' format an alias for 'z' in time format strings
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>
2022-08-03 18:38:53 +02:00