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>
When using qt-cmake-standalone-test, we didn't tell CMake to use the
same C++ language standard that Qt used when it was configured.
We did tell CMake to do that when configuring tests with
qt-internal-configure-tests via the qt_build_tests macro.
To ensure the proper standard is set, we also need to
find_package(Qt6Core), because the std flag is derived from the
QT_FEATURE_cxxyz flag which is set by Core.
Change-Id: Ia41f2a24983ddab0107a6446743f7b054df8c033
Pick-to: 6.2 6.3 6.4
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
https://developercommunity.visualstudio.com/t/C:-constinit-for-an-optional-fails-if-/1406069
does not only affect constinit thread_local but also constinit in
general on MSVC compilers when C++20 is being used. So disable the
feature for these compilers in general for now.
This commit amends d9531593a2
Fixes: QTBUG-105234
Pick-to: 6.4
Change-Id: I1855f0857d85487895460fc7c56675fb864bfa73
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Microsoft recommends to use CoInitializeEx()
and SetWindowLongPtr()/GetWindowLongPtr() in new code.
Use COINIT_DISABLE_OLE1DDE to avoid overhead of
initializing and using obsolete technology.
Pick-to: 6.4
Change-Id: I9d16943e864d4487dd4f46fd9325579c298c52b9
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
CMakeLists.txt and .cmake files of significant size
(more than 2 lines according to our check in tst_license.pl)
now have the copyright and license header.
Existing copyright statements remain intact
Task-number: QTBUG-88621
Change-Id: I3b98cdc55ead806ec81ce09af9271f9b95af97fa
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Previously if qtbase was built with feature A set to ON, then building
qtsvg, then rebuilding qtbase with feature A set to OFF, trying to
build qtsvg would fail with an error message at configure time saying
that the feature value has changed.
This check was added quite early in the Qt CMake port, presumably to
catch accidental reconfigures that might cause long rebuilds.
This has dubious benefit though. We constantly had people telling us
they get the error without knowing what to do. The usual advice was to
remove CMakeCache.txt and reconfigure.
Instead of forcing people to suffer this dance, relax the constraint
by issuing a warning instead of an error, and make it more clear why
a rebuild might happen (a changed feature value might change
the generated module C++ header file which in turn might be included
by various project sources).
Amends 20633d97ab
Pick-to: 6.2 6.3 6.4
Fixes: QTBUG-95834
Change-Id: I992bd61024958869f3b995471b4c7ff75e3a33a0
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
CLASS_NAME should be used instead.
There should be no user projects that use CLASSNAME. It was only added
for internal use for a transitional period.
Change-Id: I450f912c395907a72e2078b5d458c1c3bd115b8f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
All references to these variables have been removed from Qt
repositories.
Change-Id: Icca4668ec183ff543d04097600f8a8869066f8cc
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
...from qt6_extract_metatypes.
All usages of this option have been removed.
Change-Id: I82e624ead8292db476c09969addeecf66accce80
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Previously it wasn't exposed to the metatypes system.
Change-Id: I096fb505c957ff30a5dc43b30f02530513e5f85a
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Add an option to limit the number of tests for building and testing
Android multi-ABI configurations in CI. Currently only Core tests
supposed to run.
Change-Id: Ibb8a41d60d108259ef2675ec54bde2482f87c8b2
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Pointer comparison is not sufficient on most platforms.
Change-Id: I6f936da6f6e84d649f70fffd1706f8b1f0654a1e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
The rewrites in a1c34d8bd0,
0f76e55bc4 and in commit
b73ab954df didn't do this right, though no
problem ended up happening. In particular, the constructor one failed to
check if there were even more parameters.
Change-Id: I6f936da6f6e84d649f70fffd1706f827ba635584
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Commit 3695b35dfc accounted for pointer to
other incomplete types, but pointer-to-void was missed. This caused an
inconsistency in the stored metatype for void*, which is a built-in type
(QMetaType::VoidStar) but no pointer was recorded.
The test in tst_moc hadn't been enabled because the functions in
questions weren't extracted by moc. That is fixed in this commit.
Change-Id: I6f936da6f6e84d649f70fffd1706f613517a75fb
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Previously, we were storing all binding-observers in a list, so that we
can later revisit them during the notification loop.
However, there is no point in doing that when the binding did not
actually change.
Pick-to: 6.4
Change-Id: I0b3343cc442eca2586c7c6a10c31d780f04730e6
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
The problem was introduced in the atomic code path only, the legacy
one has always specified the correct crtc id.
Amends 56149c0fbb.
Pick-to: 6.4 6.3 6.2 5.15
Change-Id: Ie3a99ec4bc24901e1303631097a395fde8dbe110
Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
...by removing the entire adjustedFormat() helper.
Qt Quick has never used this, which indicates it is not that
useful. Same goes for Qt Multimedia or Qt 3D. Ensuring depth and
stencil is requested is already solved by using
QSurfaceFormat::setDefaultFormat() or by adjusting the formats
everywhere as appropriate.
The helper function's usages are in the manual tests that use it as a
shortcut, and in the GL backend itself. Remove it and leave it up the
client to set the depth or stencil buffer size, typically in the
global default surface format. (which in fact many of the mentioned
manual tests already did, so some of calls to
window->setFormat(adjustedFormat()) were completely unnecessary)
By not having the built-in magic that tries to always force depth and
stencil, we avoid problems that arise then the helper cannot be easily
invoked (thinking of widgets and backingstores), and so one ends up
with unexpected stencil (or depth) in the context (where the GL
backend auto-adjusts), but not in the window (which is not under
QRhi's control).
It was in practice possible to trigger EGL_BAD_MATCH failures with the
new rhi-based widget composition on EGL-based systems. For example, if
an application with a QOpenGLWidget did not set both depth and stencil
(but only one, or none), it ended up failing due to the context -
surface EGLConfig mismatches. On other platforms this matters less due
to less strict config/pixelformat management.
Pick-to: 6.4
Change-Id: I28ae2de163de63ee91bee3ceae08b58e106e1380
Fixes: QTBUG-104951
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Problem description:
--------------------
Assume we have two properties, P1 and P2. Assume further that we assign
a binding to P2, so that it depends on P1. Let the binding additionally
capture some (non-QProperty) boolean, and only create the dependency to
P1 if the boolean is true.
The state afterwards is
P1:[p1vaue|firstObserver]
|
|
v
---[p2binding]
/
P2:[p2value|binding]
If the boolean is set to false, and P1 changes its value, we still
correctly re-evaluate the binding and update P2's value. However, during
binding evaluation we will notice that there is no further dependency
from P2 on P1, and remove its observer.
The state afterwards is
P1:[p1vaue|firstObserver=nullptr]
---[p2binding]
/
P2:[p2value|binding]
Then, during the notify phase, we traverse the observer's again,
starting from P1's firstObserver. Given that it is nullptr now, we never
reach P2's binding, and thus won't send a notification from it.
Fix:
----
We store a list of all visited binding-observers (in a QVarLengthArray,
to avoid allocations as long as possible). After the binding evaluation
phase, we then use that list to send notifications from every binding
that we visited. As we already have a list of all bindings, we no longer
need to recurse on binding-observes during the notification process;
instead, we only need to deal with static callbacks and ChangeHandlers.
The pre-existing notification logic is still kept for the grouped update
case, where we already have a list of all delayed properties, and should
therefore not encounter the same issue. Unifying its codepath with the
existing logic is left as an exercise for a later patch.
Fixes: QTBUG-105204
Task-number: QTBUG-104982
Pick-to: 6.4 6.3 6.2
Change-Id: I2951f7d9597f4da0b8560a64dfb834f7ad86e757
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Until Qt 5.15, PlaceholderText color was automatically derived from the
Text color, dimmed by 50% (set alpha to 128, assuming the text color
is fully opaque).
This method has been adapted in the static qt_fusionPalette() method.
No other static method to populate palettes defines a PlaceholderText
color. As a consequence, the Text color is used to render placeholder
text characters.
This patch adds a static method, that sets missing PlaceholderText
colors by deriving them from the corresponding Text color.
It takes a dim factor by which the opacity is reduced versus the
corresponding Text color.
Fixes: QTBUG-105049
Pick-to: 6.4 6.3 6.2
Change-Id: Iebb9d15d56f5d72d7ec68b7a0babdf5825b92665
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Play nice with old renderers like the OpenGL paint engine for
QPainter.
When combining Qt Quick and QPainter targeting the same GL window,
calling QQuickWindow::beginExternalCommands() is not currently
sufficient to ensure problem-free operation, it also needs a
QQOpenGLUtils::resetOpenGLState() afterwards to get rid of the buffer
bindings. (which is important when using legacy code with client-side
vertex arrays) Which in turn is not what the documentation promises,
so resetting the bindings is now ensured on the rhi level when
Qt Quick calls beginExternal().
Pick-to: 6.4 6.3 6.2
Fixes: QTBUG-104801
Change-Id: Ibd82753996768aad0118bff87d4e1f8bcc388c58
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
The problem is reported in combination with the new 6.4 way of
handling texture-based widgets, but this looks like something that has
always been missing:
Setting WA_TranslucentBackground changes the QWidgetWindow's format,
and this is done upon calling setAttribute(). That's good for most
cases, but the changes to the QWindow's format are lost when the
window is destroyed and then the widget gets another window
later. This is not that common, but can happen.
For example, if a top-level widget is parented under something else,
and then later it is parented to null again, so that it is toplevel
once again, background transparency can be lost because nothing
re-evaluates the WA_TranslucentBackground flag after the initial
setAttribute(), and so the widget's second QWidgetWindow is not set up
accordingly (because this new QWindow may not have alpha specified in
the QSurfaceFormat which may or may not be a problem, depending on the
platform / windowing system)
The simple solution is to evaluate the attribute not just when setting
it, but also when a new QWidgetWindow is created for the widget.
Fixes: QTBUG-104952
Pick-to: 6.4
Change-Id: I92746caea5561544f90395d5473ac28d43143924
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The path for is_mac is unused. Use it by querying the platform from the
new WASM plugin web platform API.
Task-number: QTBUG-105213
Change-Id: I9a8922b5e9d215090dbdcc534c056c2cc068c009
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
We pass a pointer to uninitialized memory to QMetaType::create().
There's no harm because we're using the invalid QMetaType, but GCC is
actually right to complain for any other type.
qtestcase.h:54:25: warning: ‘buf’ may be used uninitialized [-Wmaybe-uninitialized]
qmetatype.h:454:11: note: by argument 2 of type ‘const void*’ to ‘void* QMetaType::create(const void*) const’ declared here
Pick-to: 6.3 6.4
Change-Id: I3859764fed084846bcb0fffd1703eb7967acf0d7
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
All of those are implicitly-shared Qt data types whose copy constructors
can't throw and have wide contracts (there aren't even any assertions
for validity in any of them). These are all types with a QVariant
implicit constructor, except for QCborValue, which is updated on this
list so QJsonValue (which has a QVariant constructor) is also
legitimately noexcept.
To ensure we haven't made a mistake, the Private constructor checks
again.
Change-Id: I3859764fed084846bcb0fffd17044d8319a45e1f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Commit 2f0a625fd4 added noexcept for
these, but didn't verify that the operation itself was noexcept. And it
wasn't on 32-bit systems, because sizeof(void *) is only 4 bytes, making
QVariant and QVariant::Private a mere 12 bytes. That's insufficient for
QUuid and for almost all geometric types when qreal==double.
We can't use sizeof() in qvariant.h because most of those classes are
only forward-declared.
Change-Id: I6f936da6f6e84d649f70fffd1705ce948891d06a
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
QRegularExpression::match (and globalMatch) is currently overloaded
for QString and QStringView. This creates a subtle API asymmetry:
QRegularExpression re;
auto m1 = re.match(getQString()); // OK
auto m2 = re.match(getStdU16String()); // Dangling
This goes against our decision that every time that there's a possible
lifetime issue at play, it should be "evident". Solving the lifetime
issue here is possible, but tricky -- since QRegularExpression
is out-of-line, one needs a type-erased container for the input
string (basically, std::any) to keep it alive and so on.
Instead I went for the simpler solution: deprecate match(QStringView)
and introduce matchView(QStringView) (same for globalMatch). This
makes it clear that the call is matching over a view and therefore
users are supposed to keep the source object alive.
Drive-by, remove the documentation that says that the QString
overloads might not keep the string alive: they do and forever will.
[ChangeLog][QtCore][QRegularExpression] Added the matchView()
and globalMatchView() functions that operate on string views.
The match(QStringView) and globalMatch(QStringView) overloads
have been deprecated.
Change-Id: I054b8605c2fdea59b556dcfea8920ef4eee78ee9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>