Request 16 bit floating point backbuffers and set the color space
of the CAMetalLayer to kCGColorSpaceExtendedLinearSRGB if we set
up the swap chain to use extended SRGB.
Unfortunately the required CAMetalLayer.wantsExtendedDynamicRangeContent
property is not yet available on iOS, so for now this is a macOS
only feature.
Change-Id: I28ab12cc0b829eded721061da2679be8e31d6b9d
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Required for porting away from QLatin1Char/QLatin1String in scope of
QTBUG-98434.
Change-Id: Ibe32a11699f67df2aa80505ba2944f33e5e823e0
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Ensure that it's safe to call readAllStandardError()
when process channel mode is set to MergedChannels.
Pick-to: 6.3 6.3.0
Task-number: QTBUG-102177
Task-number: QTCREATORBUG-27196
Change-Id: I01073255d9347dee4654d602802a12d341372b73
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
There is no use case for QProxyStyle to forward events to its base
style. QApplication does not send events to it; a style using e.g.
timers or so will have them active on *itself*, not on the proxy.
Moreover, forwarding *all* events is broken: QTBUG-96213 has been
triggered by forwarding DeferredDelete events sent to the proxy (thus
accidentally deleting the base style). But one can concoct many other
similarly broken situations; for instance, setting a proxy onto a base
style will make the style a child of the proxy. That sends a
QChildEvent to the proxy (ChildAdded), and that event is then passed on
the base style, resulting in the base style receiving an event saying
"you have yourself as a child".
Change-Id: I3b92bb168ce3c54a32469c36b6d1da4380ed564f
Reviewed-by: Rafael Roquetto <rafael.roquetto@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
because the old xcb_randr_monitor_info_t was invalid very often
during update.
Pick-to: 6.3
Change-Id: I8c0bda93bde4e816fc98cde1a7205c6369ab39e1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
tst_qmltc_examples failed because m_accessibilityContext
could become a dangling pointer if the object in points to gets
deleted. This resulted in a crash.
Amends e0c61193ea.
Task-number: QTBUG-101865
Task-number: QTBUG-95764
Pick-to: 6.3 6.2 5.15
Change-Id: Ie85118429b1afa6e4a41f899ca065f493e166570
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Jarkko Koivikko <jarkko.koivikko@code-q.fi>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
When PCRE2 is compiled using cmake, a pcre2 cmake file is installed
and Qt fails to configure because components isn't specified for
find_package.
In recent PCRE2 releases components needs to be specified for
find_package.
Fixes: QTBUG-102358
Pick-to: 6.2 6.3
Change-Id: Ib842b2c4b1c0bf38aa5da5475eaa2b3c56c6b822
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
The QBoolBlocker would end up using a stale d-pointer if the window
was deleted during delivery of the close event.
Fixes: QTBUG-102327
Pick-to: 6.3 6.2
Change-Id: I8f458581eeabf0d0f27a348ad1f926295caa3a58
Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
getDisplayName() now returns QString instead of QJniObject. It's more
clear and allows to save some QJniObject::toString() calls in other
parts of code.
Pick-to: 6.3 6.2
Change-Id: I0f2061cf1dff21c09c2272bf1e9126ff1ea0ed3e
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Before the patch we tried to create a java Locale object by passing the
human-readable language, territory and variant strings. However, the
Locale constructor accepts ISO-defined codes.
Fix it by using a factory method Locale.forLanguageTag() [0] that
constructs a Java Locale object based on BCP 47 tag.
[0]: https://developer.android.com/reference/java/util/Locale#forLanguageTag(java.lang.String)
Fixes: QTBUG-101460
Pick-to: 6.3 6.2 5.15
Change-Id: If414c66cf0e5b7e8299ffc3a6038b6f9eb79d5ec
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
When the date-time string falls in a spring-forward (so is invalid)
and one of the fields of the parsed string doesn't match the format
it's meant to (e.g. a single-digit seconds field when format ss was
specified), a check that the current fall-back date-time is between
the minimum and maximum for the parser object failed, triggering an
assertion.
In any case, an invalid default-value wasn't useful to the code that
parsed a single section of the date-time string, so brute-force the
current value to a valid date-time (when possible) using the usual
round-trip via milliseconds since the epoch.
Added the test-case which first revealed the problem, plus a couple
more informed by it, to exercise the same code-paths with fewer things
failing.
Fixes: QTBUG-102199
Pick-to: 6.3 6.2 5.15
Change-Id: I658308614505ef25f4c97d0de6148acb54a65a0f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Use of QSKIP() means the whole test is skipped; when all applicable
parts of a test have passed and some part of the test is inapplicable,
merely report that it is skipped, rather than discarding the PASS for
all the parts that do work.
In the process, eliminate a spurious layer of indentation; the earlier
test only needed a scope to contain its declaration, a goal adequately
achieved by the scope of the if constexpr block.
Task-number: QTBUG-99123
Pick-to: 6.2 6.3
Change-Id: Ie4790a24ebf49a7f3035ffad42d78450e1560832
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Recent fixes to include the "We mean it" comment in the header also
lead to that comment appearing in the generated .cpp file, which also
lacked the "This is a generated file. DO NOT EDIT." comment. The
generated header also lacked a blank line after the "We mean it"
comment, so include that (and take it out, too, in the .cpp). The
"Please see" line of the "DO NOT EDIT" comment also used the name of
the generator script as seen from the Makefile that drives the
regeneration; replace this with the README.md file that actually
explains how to regenerate the files in corelib/global/.
This amends commit 71af0d7059
and commit b852584556
Change-Id: I4b5b4dbef5954819632bb625d1914a9ec46e15d9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
... a leftover from the initial patch-set not required in the one that
merged.
Change-Id: I0c5e94d8a0409faf4f7f9a354e98e239f7186da3
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
For such widgets, QBackingStore::flush() takes both a region and an
offset. Both must to be DPR scaled to the native backingstore
coordinates. When the DPR is fractional, it can happen that the
rounding of both effectively accumulate into an off-by-one error.
Detect and adjust for this situation to avoid painting glitches.
Task-number: QTBUG-96223
Fixes: QTBUG-102366
Pick-to: 6.3 6.2 5.15
Change-Id: I9ccd4ee54660419a1db8c27358f1419de58ae932
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Most likely related to qemu network configuration which cannot be
modified. Reason is that in QNX there is tool which can be controlled
qemu configuration, and it does not provide options for more finer
grade network configuration.
Pick-to: 6.2 6.3
Task-number: QTBUG-101274
Change-Id: I660466e36252e902a2314fb3f4988c531cda9214
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Using QFileDialog::setMimeTypeFilters() with a list of mime types may
in some cases result in the same name for two different mime types,
for example both "image/heic" and "image/heif" will result in the
name "HEIF image (*.heic *.heif)".
When the resulting name filter is propagated to the platform layer,
we add entries to a NSPopUpButton, but the convenience API we used,
addItemWithTitle:, does not allow duplicates. As a result, the entries
in the menu didn't match the list of name filters we then looked up
and applied to the actual file name filtering, causing off by one
errors.
Ideally we'd make sure the name filters are unique and well formed
all the way from the QFileDialog to the platform and back, but for
now we work around issue by using the NSMenu API directly, which
does allow for duplicate entires.
Fixes: QTBUG-101361
Pick-to: 6.2 6.3
Change-Id: Iee3db4e6c5adfdbdd7f0094b4efd65aa2ecc0f57
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This allows us to use the properties of the application font as a way to
distinguish whether the font has been populated or not.
Change-Id: Iccce32b23c1b987f2f75fef955227bddc2495fa3
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
I always meant to remove the note and update it with a link, but forgot.
Qt 6.2 details only so it can be easily cherry-picked there.
Pick-to: 6.3 6.2
Change-Id: I4db3919b71971a997ac8a988951b01c984a8a791
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
[ChangeLog][QtCore] Added literal operators for _s and _ba for QString
and QByteArray respectively in the Qt::Literals::StringLiterals
namespace.
Task-number: QTBUG-101408
Change-Id: I5cd4e7f36f614ea805cfecc27b91c5d981cd3794
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Calling deleteLater on an object of type QProxyStyle (or inheriting from
QProxyStyle) results in this object never deleted, since it simply
passes the event to its base style, which in case of deleteLater is
not right. QProxyStyle inherits QCommonStyle which in turn inherits
QStyle (which is QObject's descendent). So for the style to be deleted
we pass DeferredDelete to its base class - QCommonStyle::event (which
means QObject::event, since neither QCommonStyle nor QStyle override
QObject::event()).
Pick-to: 6.3
Fixes: QTBUG-96213
Change-Id: I99b8f413624e2f18ddae3fb331997f767de219d0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Makes it more transparent what's going on, rather than the opaquely
named static helper function.
Change-Id: I9a5bd348007e9ed11214f1e55c4b39d4734328dc
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Makes it clearer where and how they are used, and to set breakpoints on them.
Change-Id: Id2aaeb51ff80676ad3316d29e23661b2cad79478
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
The QPlatformBackingStore::scroll() API takes a QRegion as input, but
we have no guarantee that the individual source and destination rects
of the region will not overlap each other when applying the scroll offset,
so we can't naively iterate the rects and call qt_scrollRectInImage for
each one.
The reason this didn't cause any issues in practice was that the QWidget
repaint manager was always passing in a single rect as the region.
On the other hand, the client has requested a scroll of the given
region, so it might assume any other part of the backing store is
preserved as is. Scrolling the bounding rect of the region violates
this assumption.
Amends 19ef76b0606621f189d3bc56549d200f2f5ebb25.
Pick-to: 6.2 6.3
Change-Id: I27934dd6685311c0b53ea2adb60fa5997e360f6c
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
It's one of our best tools to improve compile times.
In some places, we can't do the change, yet, because there's no .cpp
file for the header file.
Also mark Q_DECLARE_METATYPE macros that are in the wrong place. We
shouldn't have Q_D_M markup for public classes in .cpp or _p.h files.
Fixes: QTBUG-102206
Change-Id: Iec0a39e4745571b24d07dacc87593321967c10e3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
QGraphicsView enables autoFillBackground on the viewport widget, so
the dirty area is cleared before repaint. Then QGraphicsView fills the
same area with the background color. However, under fractional DPR
scaling, the scaled version of the dirty rect may end up covering only
a fractional part of the pixels on the edges. If antialising is
enabled, such pixels will be only partially filled with the background
color, leaving the clear color partially visible as glitches. This can
be seen in the dragdroprobot example.
Fix by disabling AA during background filling, as it has no purpose
then anyway.
Task-number: QTBUG-96223
Pick-to: 6.3 6.2 5.15
Change-Id: Ica00997141701faa0cf368caced84ae50ba017d0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
We already have similar logic in the QWidget variant.
Pick-to: 6.3 6.2
Task-number: QTBUG-102253
Change-Id: Idf1e3474f3189909f1cba7d5dedc2cde12f1338e
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Raise the CMake log level to STATUS when the 'verbose' argument is
passed to the configure script.
Change-Id: I736d95ab66b115f8416eec7f9e2ee96d1580c78d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The value of the 'qt_host_path' option needs to be resolved fully
before assigning it to 'QT_HOST_PATH' env.
This icludes expanding ~ constructs, resolving symlinks, expanding vars
and relative paths.
Pick-to: 6.2 6.3 6.3.0
Change-Id: Ia338105ccb4a203796864304f463b222163c5193
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
When calling QHash::reserve(), or when creating the
internal QHashPrivate::Data structure, the value 0
for the size parameter is reserved for performing
the squeeze operation.
However commit 8a984ab772
broke it, by using the 0 value in QHashPrivate::Data
constructors as a mark that no resizing needs to be done.
This patch reverts the problematic commit (also applying
some later fixes to the code), and adds the missing
tests for Q[Multi]Hash::squeeze().
Pick-to: 6.3 6.2
Change-Id: Id644df7b2beb008e6a37b2c89b709adfbd893e25
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Calling Q[Multi]Hash::reserve(n) when n is much smaller than the
current amount of elements in the hash, could result in an infinite
loop, because at some point the algorithm could not find a free bucket
for the element.
Fixing it by returning early if the new desired capacity is less than
current.
Fixes: QTBUG-102067
Pick-to: 6.3 6.2
Change-Id: I38ef0b2168c4e2a317eedf91b2155b1fdffb1c27
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Make sure androidtestrunner reports the following cases as failures:
* XPASS test case
* The test output doesn't have closing block.
* The test result read from output.txt is empty
Pick-to: 6.2 6.3
Fixes: QTBUG-100312
Task-number: QTBUG-100470
Change-Id: Ifbb3c31fa22159df0c39b264e95e2f1ccd16e5ff
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Different platforms and drivers hae different defaults, so make sure
to request what we need.
Pick-to: 6.3 6.2
Change-Id: I54ae6e0770fea53fbf59c86d7e55aa5897292b67
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
It's one of our best tools to improve compile times.
Can't backport to Qt 6.2 because the macros don't exist there.
Pick-to: 6.3
Task-number: QTBUG-102206
Change-Id: Ic8f3870d8eec6211c4be506dc67717cc4e0ff7d6
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Use new QByteArray::resize(n, ch) method to resize the buffer
directly, instead of first allocating a QByteArray full of NULs and
then using public write() API to append it.
Change-Id: Ibdb082b970de0ba24534a570ecb23304c5f1470c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
QList and QString had them, so add them to QByteArray and
QVarLengthArray, too.
In the QVLA case, we need to jump though a hoop or two to avoid having
to duplicate all the reallocation logic. Nothing a few template tricks
cannot solve.
[ChangeLog][QtCore][QByteArray] Added resize(n, ch) overload.
[ChangeLog][QtCore][QVarLengthArray] Added resize(n, v) overload.
Fixes: QTBUG-102270
Change-Id: I0d281ae5b574f440f682e4a62427b434dcf5b687
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
By the time setNodeValue() gets its hands on the removed object, the
removeChild() function has already called removed->ref.deref(), which
performs an acquire fence if the ref-count drops to zero.
IOW: if removed->ref == 0 now, then an acquire fence has been
executed. If ref != 0, then we're not reaching into removed, so we
need no acquire.
Therefore, a relaxed load suffices (as opposed to the loadAcquire()
the implicit conversion operator performs).
Found by disabling QAtomic<T> -> T implicit conversions.
Change-Id: I367754fde0ad82db797161b5e94e2ebc08a90c0b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Clazy complained about this polymophic class being copyable.
Change-Id: I05087bb7fcf7112136e5d62c108ea460569f2aa0
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Destructors in C++ are implicitly noexcept, so the try-catch around
QSettingsPrivate::flush() is not to prevent throwing from a dtor
(anymore), but to prevent a throw statement inside flush() from taking
down the whole application.
We don't need to care about abi::__forced_unwind here, since we
couldn't re-throw it even if we wanted to (throw in noexcept function
is direct std::terminate(); at least by not re-throwing, the user will
get a nice complaint message from the runtime).
Pick-to: 6.3
Change-Id: I3b24a4be9aeb74637a58725540990b535d005bdd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>