Avoids the conversion from UTF-8 for uses that are not dumping a string.
Mass conversion of Qt sources left for future opportunity.
Fixes: QTBUG-85811
Change-Id: I4ca4a35b687b46c39030fffd1626ae6c3294cacf
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
We can end up in a situation where a (soon to be destroyed) observer is
owned by a binding which is about to be deleted. If in that situation
the binding is destroyed first, we end up with a dangling pointer
and ensuing memory corruption. Instead, we now first transfer the
ownership of the observer and only destroy the binding afterwards.
Fixes: QTBUG-85824
Change-Id: I721c0319281ada981ae7896bd2e02e9a0cc901b8
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Fixes warning by Clang:
warning: 'const volatile' type qualifiers on return type have no effect
[-Wignored-qualifiers]
const volatile unsigned long long * const volatile func_KVPKVull() {...}
^~~~~~~~~~~~~~~
Change-Id: Ia4aae6521c84f4a18d92ad5035af5b247d283140
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Made QPromise::swap public, added free standing swap() for
QFutureInterface and QPromise. Updated QPromise special member
functions. Extended tests
Task-number: QTBUG-84977
Change-Id: I5daf6876df306d082441dbcdf5ae4dee3bfc0ead
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
We already had append(const QList &) and now there's an overload
taking an rvalue reference.
Change-Id: Id2fbc6c57badebebeee7b80d15bb333270fa4e19
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
I don't know why std::shared_ptr allows this, but why not.
[ChangeLog][Important Behavior Changes] QSharedPointer objects will now
call custom deleters even when the pointer being tracked was null. This
behavior is the same as std::shared_ptr.
Fixes: QTBUG-85285
Pick-to: 5.15
Change-Id: I24006db8360041f598c5fffd161c260df0313b55
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
‘t’
Specifies that the argument is a ‘ptrdiff_t’.
This modifier was introduced in ISO C99.
We use qsizetype, which is the same width as ptrdiff_t, so it makes no
difference in va_arg().
Change-Id: Iea47e0f8fc8b40378df7fffd16255730109413a5
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Deprecated in 5.15 in favor of CBOR.
Fixes: QTBUG-81239
Change-Id: I711d4bd7dd1247f58e77ac9fa53304cbe5028918
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Our hardware optimized conversions of float to qfloat16 rounds to even
where our table based conversion truncated to zero.
The rounding is not in this patch exactly round to even like the
hardware implementation but much closer.
Change-Id: I4c5e72c15fef9079d3660680b2727ff7ba4e768a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
BLAKE2 does not specify requirements about specific hash sizes and
since QCryptographicHash does not support dynamic hash sizes, only the
most common hash sizes could be covered by this.
The supported hash sizes were chosen to match the ones supported by the
Linux kernel.
The new hashing algorithms for QCryptographicHash are:
* BLAKE2b (160 bit, 256 bit, 384 bit, 512 bit)
* BLAKE2s (128 bit, 160 bit, 224 bit, 256 bit)
[ChangeLog][QtCore][QCryptographicHash] Added BLAKE2b and BLAKE2s
hashing algorithms.
Fixes: QTBUG-78198
Change-Id: Id9e0180a974093982fdf1cdd6180988a2e5e9f4f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Only keep 3, 4, and 5 because 3 is the lowest version where binary JSON
is not used anymore.
Change-Id: Id0319e8eceb845017ed493d0ef6902b53050d5a6
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
We already have the information in the QMetaTypeInterface, and provide
functions to access sizeof. Adding alignof support seems natural, and
should make it easier to handle over-aligned types.
This should also be helpful in QVariant.
Change-Id: I166be76f4b7d2d2e524a3a1e513bd2f361e887c1
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Some compilers implicitly captures, and will warn about the unused capture.
Change-Id: Ib5e1cc3956c7eb0dc87cee834cce8a2b3dd0d30b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The previous implementation multiplexed callback-based event
notification into a single proxy event (cf. 85403d0af), which was
in turn object-waited for (this was the case since the beginning
of public qt history). It makes more sense to multiplex into a
posted message, because that also works with foreign event loops
that do not know anything about our event objects.
Task-number: QTBUG-64443
Change-Id: I97945ac8b5d7c8582701077134c0aef4f3b5a18f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Not sure why this was disabled in the first place.
Change-Id: I66329b55fd46d03fd96818c6c7004718ddea5c79
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The tests are testing deprecated functionality, which we
still want to test.
Change-Id: Iad6ed35800896170c17fe019c7a6ecda22398ac3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Infinite is only when the mantissa is 0, everything else is NaN.
std::isnormal returns false on zero.
Pick-to: 5.15
Change-Id: I897fc0dc3b8a9c557bb1922ea7ca8df501e91859
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Move QWindowsMime (which was a public class in Qt 4 and moved to the QPA
plugin in Qt 5) to the platform namespace and add register functions to the
native application.
Move in test code from QtWinExtras.
Task-number: QTBUG-83252
Change-Id: Iaac440e2d5cb370110919921b1eeb779600b5b65
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Also, remove the deprecated function and its auto-test.
Change-Id: If04a54c4b91e0f76523960c7b1a5bcb8fe883ac6
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QTest::toString allocates memory by calling qstrdup; that memory must
be freed by the caller.
Change-Id: I9724db0c617884cf08592968b1411f002ef23204
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Since 5.14: intersect(), angle(). Also removed definition of M_2PI
from test, since its last use was in the tests being removed.
Change-Id: Ie3a12247e3760e8bfdd3a659cd06245c86b198c2
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
QUrl::fromEncodedComponent_helper() only existed to support some old
methods deprecated since 5.0, that I recently removed.
It was the only caller of qt_urlRecodeByteArray() aside from that
function's own autotest.
Both were private.
Task-number: QTBUG-85700
Change-Id: I5d09fd44e768847ce51a1ae7043150922cb5314c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Don't attempt the remote test if we don't have a remote server.
Don't add error returns from read to byteCounter.
Don't cast from ASCII to QString in URL components.
Don't waste time encoding a path for which it's a no-op
(especially as I recently deleted the method used to do it).
Name the time-out, both for clarity and to give anyone who needs to
debug the test only one line to edit so as to increase the time-out
enough to make debugging practical.
Change-Id: I378aa96c0501f7033ca4abb82734b03b8c807f08
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Two methods that have gone away or been renamed,
an enum that now doesn't support being assigned from int.
QTime should no longer be used as a timer.
Removed a test of deprecated code that's gone away.
Task-number: QTBUG-85700
Change-Id: Idc6d59542625d22b9937084411b54b0d8aa87f00
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
warning: comparison of integers of different signs: 'qsizetype' (aka 'long long') and 'unsigned long'
Change-Id: I03acb1f7aed782169a0a42cd8afc84b85991cd1e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
warning: format specifies type 'int' but the argument has type 'qsizetype' (aka 'long long')
Change-Id: I6099b53efecea46d191d5dc019c986f99e49c1f1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Add conversions from/to HBITMAP, HICON to QImage. Split the pixmap
conversion functions apart to use them.
Task-number: QTBUG-81876
Change-Id: Ic0c41a402a1f6e9bec572fc4d691357bd48e6423
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
As of 951d490750, high-DPI support
for pixmaps is enabled by default, which makes this test fail
when running on a local system with a high-DPI display.
Change-Id: I3fe4674d19a57bf82aa32b01d470c714092f7e62
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Avoid parsing over the buffer limit, or interpreting non-hex
as hex.
This still leaves parsing of lines longer than 300 chars
unreliable
Change-Id: I1c57a7e530c4380f6f9040b2ec729ccd7dc7a5fb
Pick-to: 5.15 5.12
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
As defined by https://llg.cubic.org/docs/junit/
Change-Id: Ic7683f3d49c529674f8467d591528d4a65d3add8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
The attributes are, like the elements, maintained in reverse
order in the underlying QTestCoreList, so we need to iterate
them backwards when printing out the resulting XML to reflect
the order they were added.
This results in e.g.:
<testcase name="passingBenchmark" result="pass">
Instead of:
<testcase result="pass" name="passingBenchmark">
Change-Id: Ic2eeab8de05ffedd0c41977358d5b40ff77878b1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
It doesn't understand the arguments we usually pass to testlib.
Change-Id: Iea83d1d8c31a510b2bc442cbfc810eac631322e7
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Deprecated since 5.0. Renamed a function in a manual test that no
longer needs to say it's Qt5-specific.
Change-Id: I6f2159c702f389d378a0e4d86bd4fe633298b100
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
We don't want the signal dumper to pick up signals that our own
test machinery produces, such as the ones emitted from the watchdog
thread startup and shutdown. This would otherwise produce:
tst_Signaldumper::initTestCase() Signal: QThread(7fc969e0d870) started ()
At startup, and at shutdown even more confusingly:
tst_Signaldumper::UnknownTestFunc() Signal: QThread(7fc969e0d870) finished ()
Change-Id: I9e81fa168eaa92551d38d5576973bbf95ac23364
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The logic was changed in eb52d78e90 to only produce a single
result for all the benchmark iterations, but only the plain text
output was rebaselined. This was not caught by the test since we
only run this test with the plain test logger. Regenerating the
results with the python script however runs it with all loggers,
so let's fix the baseline.
Change-Id: I9ebe8a59ac3ab36694a739f98dbfffbae9a08552
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Exercise the touch settings of the native interface.
Task-number: QTBUG-41433
Task-number: QTBUG-48849
Task-number: QTBUG-83252
Change-Id: I5ae95a79c00b55236dbbed9d8549f4fdf5b10b8e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
A QWindow should only become Active when it's inside an
NSWindow that is Key. If the NSWindow is not key, we need
to wait for it to be so, and handle window activation
from QCocoaWindow::windowDidBecomeKey() instead. Otherwise
Qt will report a QWindow as Active when, in reality, it
is not.
Change-Id: Ib7e63b374f26af527a668c7f7d863c4168a4446d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The -arch_blank argument to lipo is no longer supported.
Pick-to: 5.15
Pick-to: 5.12
Change-Id: I47efcb3633f23b7a18d66211bc16d5c9dbc067c8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It is unnecessary to create a QList container just for comparison.
Split out helpers for comparing sequence sizes and sequences from
qCompare(QList) and add a template for an array with a non-type template
parameter for the size.
One can then write something like:
const int expected[] = {10, 12,...};
QCOMPARE(QFontDatabase.pointSizes(...), expected)
Unfortunately, any commas in such an array will be misread by macro expansion
as macro argument separators, so any expected array with more than one entry
needs an extra macro expanding __VA_ARGS__.
Change-Id: Ie7c8dc20bf669bbb25f6d7f8562455f8d03968c8
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
We don't want to print the QString as represented by the debug
operator, but instead want to expand line feeds and other character
codes as normal.
Change-Id: I7261d8f94e7b4382733f06eb22f9a740a5c0488f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Before 0a93db4d82 we would polish the
application palette even when it was the default palette, as we
always recreated the system palette each time a style was set.
After the change we skipped polishing the palette unless it was set
by the user, under the assumption that the style would set its
own default palette if it wanted to override the system palette.
This turned out to break the style's ability to slightly tweak the
palette via polish (versus the more full on standardPalette approach).
We now polish both the default palette and user palettes, and we do
so as part of the normal palette update logic. This ensures that
the style also gets a chance to polish the palette when the platform
theme changes.
The polish will not have an effect on the resolve mask of the palette,
as the polish is conceptually the same as a base palette, and should
not affect e.g. Qt::AA_SetPalette.
Fixes: QTBUG-85469
Fixes: QTBUG-85188
Pick-to: 5.15
Change-Id: I869e9c442b177de4f1dc49eb75220709306f4d12
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Qt6 package was not found the tests were configured in-tree as opposed
to standalone tests.
Use the same trick we do for building examples in-tree.
Specify the path to the build tree packages, and don't create targets.
Amends 96e3ee0659
Change-Id: Ia60de416ce0afff5bd40be8c0c6e3c7898fd7ebf
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Since 5.8: setHidden(), isHidden()
Part of the QCommandLineParser test also used setHidden().
Change-Id: I05a1c63ff3beb1167ed75632c1b71d7fff17f09e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Since 5.0: QUrl's image of the QUrlQuery API
Remove deprecation-suppression from tst_qurl.cpp, too.
Change-Id: Ide826283cb4e177fb34fb4080502f5a4620bd5d7
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Since 5.3 joining() and old Joining type
Replaced by JoiningType joiningType()
Change-Id: Iefee50aaf94cec6d67b5fc004b3e68357b2015c5
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Hardcode the tests which were previously scanned from the source.
See qtbase/24e83de8d1924b8003c84f1df05b7befea2c5120.
Change-Id: I8fb05568977f86726b20948a9c2d1cfce5cba161
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
At the moment it just exposes QTBUG-84676, that is, OpenSSL
and non-OpenSSL backend act differently. Went a bit overkill
in making it data-driven, so if someone wants to add more
samples it should be easier to do so.
Change-Id: I96538c9563d12d69c217415ba85e244dda5e0cd0
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This only arises when the system locale tells us to use its zero as
our zero digit, since no CLDR locale uses it by default. Adapt an
MS-specific QLocale::system() test to use Suzhou numbering, so as to
test this.
While updating the locale-restoration code to also restore the digits
being set in that test, add restore code for the long time format,
where previously only the short time format was restored. Add a
comment to make it less likely one of those shall be missed in future.
Fixes: QTBUG-85409
Change-Id: I343324bb563ee0e455dfe77d4825bf8c3082ca30
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This adds a namespaceURI parameter to the following methods of QDomNode:
firstChildElement(), lastChildElement(), nextChildElement() and
previousChildElement()
Those methods can now be used to filter for elements with a specific
namespaceURI without the need to use QDomNodeList.
[ChangeLog][QtXml][QDom] Added namespaceURI parameter to browse methods
like firstChildElement() to filter for elements with certain namespaces
without the need of QDomNodeList.
Change-Id: Ic2cfe8c6d5d5f6b5fcf27165df15bce54ad0f23a
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
The tests/auto/cmake project can be configured separately as a
standalone project with qt-cmake, or as part of the overall qtbase
standalone tests.
To do that a bunch of things were done
- Ported all Qt5 strings to Qt6
- Replaced in all projects the use of add_definitions and
include_directories with a target based approach, except for 2 tests
where we check that the old-style approach works, otherwise the
tests would file
- Removed some (possibly unneeded) EGL / OpenGL tests
- Fixed some C++ code
- Added setup code to tests/auto/cmake/CMakeLists.txt to figure out
which modules are available and should be tested
- Fixed Qt6CTestMacros.cmake to be loaded by Qt6Core
- Removed the CMake tests to not be run in qmake builds of Qt because
they would fail anyway
- Enabled the CMake tests to be part of standalone tests
- Disabled auto-passing of the C and CXX compiler cache vars when
cross-compiling so that the tests can somewhat pass on boot2qt.
This is the issue we encountered in
e2b2cd9397
- Ultimately disabled tests for boot2qt, because the -rpath-link
flag is not generated by CMake for some reason.
- Added code to setup the environment when running an executable that
was built as part of the test, so that the proper Qt libraries are
found. This handles both the standalone tests case and separate
project case.
The remaining unported tests are test_import_plugins which requires
quite a bit of work to get some modules and plugins built that were
done as part of the qmake .pro files, test_plugins that checks
some Network plugins which I'm not sure about, and
test_add_big_resource which doesn't work with namespaced builds
and there's no good way of detecting those at the moment either.
Change-Id: Ic8809c72817d1db81af6c6014c11df6473ad8c75
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Expand the getSetCheck to include all properties, and add a test to
verify the fallback logic for the tooltip property.
Use the meta object system to set and check properties in the
tooltip-test to verify that things don't break when migrating to
the new property system.
Change-Id: I56355e8b436ede46701a124a9241ed26d2c706c5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
QEasingCurve has a richer variety of curves and curveShape was already
implemented by changing the easingCurve property.
[ChangeLog][QtCore][QTimeLine] Deprecated QTimeLine's curveShape
property in favor of the easingCurve property.
Pick-to: 5.15
Change-Id: I7261c0f24d7e02bc94624f0b74d699df62de1a52
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
For types that don't have an operator==(), always trigger the binding
and the changed notification.
Task-number: QTBUG-85578
Change-Id: I41374f6d13c88106f4de83864e82172f3a248150
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Smart pointers like QSharedPointer<T> do have a value_type, but their
equality does not depend on T being comparable. Therefore, instead of
simply checking for T::value_type, test for a few other container
requirements.
This also required to add an additional check for std::optional, as that
one has an unconstrained operator== on MSVC.
Change-Id: Iefd048f7aa360f4713ecd79f80acd7dae72ee18c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Previously, only QNotifiedProperty was supported. As moc cannot
determine by itself whether the backing property is a QProperty or a
QNotifiedProperty, allow NOTIFY false to indicate that it is a plain
QProperty. For symmetry, NOTIFY true is also allowed and means that the
backing property is a QNotifiedProperty.
Change-Id: I66f3105c976ef084198ce8658bc07499a3cb1cd8
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Read three more values from CLDR and add a byte to the bit-fields at
the end of QLocaleData, indicating the three group sizes. This adds
three new parameters to various low-level formatting functions. At the
same time, rename ThousandsGroup to GroupDigits, more faithfully
expressing what this (internal) option means.
This replaces commit 27d1391280 with a
fuller implementation that handles digit-grouping in any of the ways
that CLDR supports. The formerly "Indian" formatting now also applies
to at least some locales for Bangladesh, Bhutan and Sri Lanka.
Fixed Costa Rica currency formatting test that wrongly put a separator
after the first digit; the locale (in common with several Spanish
locales) requires at least two digits before the first separator.
[ChangeLog][QtCore][Important Behavior Changes] Some locales require
more than one digit before the first grouping separator; others use
group sizes other than three. The latter was partially supported (only
for India) at 5.15 but is now systematically supported; the former is
now also supported.
Task-number: QTBUG-24301
Fixes: QTBUG-81050
Change-Id: I4ea4e331f3254d1f34801cddf51f3c65d3815573
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
During review of a refactor (coming shortly), Thiago wondered what the
magic numbers were. On closer examination, I concluded that they were
wrong and wrote some tests to prove it. This commit adds those tests;
replaces the misguided old code with something that passes them; and
documents the reasons for the various parts of its decisions.
In the process, tidy up QLocaleData::doubleToString() somewhat and
rename some of its variables to conform to Qt coding style.
Change-Id: Ibee43659b1bdb0707639cdb444cfe941c31d409f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Use aggregation instead. Prepare for using QPromise instead of QFutureInterface.
Task-number: QTBUG-84702
Change-Id: Ic88564dca8c83a178a281cb843032292210a6d25
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Change the functions to operate in float and add the
QPoint versions as overload calling them. This is
more in-line with the event accessors using float
and allows for removing some workarounds using a delta when
converting touch points.
Leave QPlatformWindow::map(To/From)Global() as is
for now and add helpers for float.
Change-Id: I2d46b8dbda8adff26539e358074b55073dc80b6f
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Passing QDBusUnixFileDescriptors over peer-to-peer connections currently
does not work, because QDBusConnectionPrivate::setPeer() does not set
this->capabilities (unlike QDBusConnectionPrivate::setConnection()
which is executed for bus connections).
Keep track of whether the connection already has been authenticated, and
once the connection does get authenticated, update this->capabilities.
Note that sending a message directly after connecting (before any
message has been received from the peer) might still fail if the message
contains a QDBusUnixFileDescriptor.
Pick-to: 5.15
Fixes: QTBUG-85396
Change-Id: Ib83213ebcd3255fb091c6faefb3618745b8d736c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
In this case the srb represents the layout only, and can still be used
to create a pipeline. For setShaderResources() one will then need to use
another, layout compatible, srb that references valid resources.
Change-Id: I3ea5b63df3be8847540ca4c0c40fbd29dbed8fb7
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Given we optimize for the case where the new value is of the
same type of the one already stored in the variant, enable move
assignment for that case.
As a drive-by, avoid a path to detach() for data() if we know
we're detached.
Change-Id: I9abbdc10637ce77ebb747b49d83e1ef914d997bb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
And mark some methods as inline.
Performance is critical for our new property system. Compiling
it in one unit makes it possible for the compiler to do a much
better job at inlining and generating optimized code.
Improves performance of binding evaluations by another 20%.
Change-Id: I5a2aa93c74d2b68418b0a9d2e34d8199bb71e3ad
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Avoid any QVariant or type dependent code in the cpp files.
Instead, let the binding wrapper determine if the value
has changed and return true/false accordingly.
This required also some reworking of the guard mechanism
for notified properties, where the guard function wrapper
now calls first the binding evaluation function and then
passes the result to the guard.
Change-Id: I350d07a508ccc0c5db7054a0efa4f270b6a78ec3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
There's no point in returning a usually empty error when
evaluating bindings, adding overhead to the regular code
path.
Instead, the error can be set on the currently evaluating
binding if required. This streamlines the functor used to
wrap the binding and should thus expand to less code and
execute faster in the regular case.
To achieve this, expose a pointer to the currently evaluating
binding in the private API (as QtQml needs it to be able to
report errors).
The error case now requires one additional TLS lookup, but
we don't really care about performance in that case anyway.
Change-Id: Iecb450e765244930a41d813fcf8eb4013957a6a3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Remove location(). The method would always return an empty value. If you need the location,
the binding itself has it.
Remove setDescription() and require that the description gets passed
in the constructor. Never create a d pointer if type is NoError, so we
can quickly check for it inline.
Change-Id: I7eb8a94786281069d6ea2d82567c09aa50c52ef6
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Some goals that have hopefully been achieved are:
- make QPointerEvent and QEventPoint resemble their Qt Quick
counterparts to such an extent that we can remove those wrappers
and go back to delivering the original events in Qt Quick
- make QEventPoint much smaller than QTouchEvent::TouchPoint, with no pimpl
- remove most public setters
- reduce the usage of complex constructors that take many arguments
- don't repeat ourselves: move accessors and storage upwards
rather than having redundant ones in subclasses
- standardize the set of accessors in QPointerEvent
- maintain source compatibility as much as possible: do not require
modifying event-handling code in any QWidget subclass
To avoid public setters we now introduce a few QMutable* subclasses.
This is a bit like the Builder pattern except that it doesn't involve
constructing a separate disposable object: the main event type can be
cast to the mutable type at any time to enable modifications, iff the
code is linked with gui-private. Therefore event classes can have
less-"complete" constructors, because internal Qt code can use setters
the same way it could use the ones in QTouchEvent before; and the event
classes don't need many friends. Even some read-accessors can be kept
private unless we are sure we want to expose them.
Task-number: QTBUG-46266
Fixes: QTBUG-72173
Change-Id: I740e4e40165b7bc41223d38b200bbc2b403e07b6
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This way we can return a nullptr for cases where the class does not want
to provide a property at all. For example outside of bindings when
reading the default value. The moc-generated code can check for such
nullptrs and handle them.
Change-Id: I7ff478cb254012147bb7aed3feb160e3e679cb6d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The issue has been introduced when refactoring QByteArray::count
implementation (see 631127126c).
Because the last argument of QByteArrayMatcher::indexIn() method
has a defult value, it has been compiling without issues, but was being
called with incorrect size parameter. Fixed it to pass the length of the
input data correctly.
Change-Id: Ic9c2f33733131ec17276aa889f2d7ea40ec79b01
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Qt::UNICODE_ACCEL had no effect since at least Qt 4.0. We can drop
it in Qt 6. The whole Qt::Modifier enumeration is still widely
used, so we can't drop it yet, but we should aim at doing so in
Qt 7. Add a note.
[ChangeLog][QtCore][Qt::Modifier] The Qt::UNICODE_ACCEL enumerator
has been removed. It had no effect since Qt 4.0.
[ChangeLog][QtCore][Qt::Modifier] Usage of the enumerators in
the Qt::Modifier enumeration is discouraged. The enumeration
will likely get removed in the next major version of Qt.
Change-Id: If25f30d920878d32903b91a38044f5da042c7eab
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
And generate a few more test projects that were missing.
Change-Id: I5df51106549aa5ae09bc3c42360e14b143719547
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Use pro2cmake with '--api-version 2' to force regenerate
projects to use the new prefixed qt_foo APIs.
Change-Id: I055c4837860319e93aaa6b09d646dda4fc2a4069
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This is in preparation for regenerating them with the new qt_foo
prefixed APIs.
Change-Id: Iff34932d642b1c0186ee39f952adf3ad367fd602
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This removes the fully manual registration of comparison operators in
QMetaType and replaces it with an automatic registration through
Q_DECLARE_METATYPE().
[ChangeLog][QMetaType] The QMetaType::registerComparator() and
QMetaType::registerEqualsComparator() have been removed.
Q_DECLARE_METATYPE() now automatically registers any
operator==() and/or operator<() for a type visible where
it is used on that type, as part of declaring its meta-type.
Change-Id: I3df451b652b735c093533838bf32f3cc785439f8
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Containers often define an operator==() or operator<() which is very useful
for generic code. But those operators can usually not be instantiated if
the template argument doesn't implement the operator.
This sometimes leads to the compiler trying all possible template expansions
and implicit conversions for the type, giving extremely long error
messages. The traits support can be used to safely constrain those
operators.
Being able to safely detect this will also allow us to fold the comparison
support that is currently a large cludge for user types directly into
QMetaType.
Change-Id: Ib84afb5348c3eb0be5161d6ba9d5fe237709c65f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
If you pass "STORED false" the name is interpreted as function to be
invoked in order to access the property. This allows storage of a
property in a lazily allocated data type.
Change-Id: I4d3a9cac6985c6419ce687868cb74b91921595a6
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Created a QByteArrayView in symmetry with QStringView.
Added the basic tests symmetrical to QStringView tests.
Moved the implementations of non-modifying methods of QByteArray to
namespace QtPrivate, to be reused inline from both QByteArray and
QByteArrayView. Changed QByteArray's counterparts of those methods to
take QByteArrayView as argument instead of QByteArray. Removed
QByteArray's operator QNoImplicitBoolCast(), because it was causing
ambiguity when calling those methods with QByteArray argument (it was
there to perevnt if(!ba)/if(ba) from compiling, but currently that would
be ambiguous and won't compile anyway).
[ChangeLog][QtCore][QByteArrayView] New class.
Task-number: QTBUG-84321
Change-Id: I05f92e654cf65c95f2bb31b9c9018746ac110426
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Created tst_QByteArrayApiSymmetry test for the common APIs of
QByteArray and QByteArrayView. Moved the tests for startsWith(),
endsWith(), indexOf(), lastIndexOf(), compare(), from tst_QByteArray
to tst_QByteArrayApiSymmetry and adapted them to check different
QByteArray/QByteArrayView combinations. Added tests for first(),
last(), sliced(), chopped(), chop(), truncate(), count(), contains()
(test inputs are taken from corresponding tst_QStringApiSymmetry
tests).
Task-number: QTBUG-84321
Change-Id: I4e712b1692e3c1271d51ddcda6c9eb8bb01e11d4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The reason for setting this variable was removed in commit 300bd7fff8.
Task-number: QTBUG-25078
Change-Id: Id06072c099481a258cb65b4603efe010e306b7b2
Reviewed-by: hjk <hjk@qt.io>
As we require C++17 now. The configure-time test checking for
future/async is left in for the moment being.
Change-Id: Ifde39d420673f70a2277f5a645bfaad30935a381
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
There doesn't seem to be any reason users will need to query tablet
devices by their IDs, because every event comes with a complete
instance already, and we have QInputDevice::devices() to list them all.
QPointingDevicePrivate::tabletDevice() can create a new instance if a
matching one is not found (and complains about that); it's intended
for use in QtGui, as a way to find the device if it was not part of the
QWSI event. Now it sets the parent of those auto-created instances
to QCoreApplication to avoid a memory leak.
On the other hand, queryTabletDevice() is intended for use in platform plugins
that need to check whether an instance exists; but they will take care
of creating new instances themselves, and thus have more control over the
parent and the details being stored. Now that the systemId can also be given,
the search is more likely to have a unique result, on window systems
that provide device IDs.
Rename id() to systemId() to clarify that it's a system-specific unique
device ID of some sort, not the same as the uniqueId that a stylus has.
However it seems that in practice, this will often be 0; so clarify that
if it's not unique, QInputDevicePrivate::fromId() and queryTabletDevice()
may not always find the right instance.
Clarify the function usage via comments.
Change-Id: I82bb8d1c26eeaf06f07c290828aa17ec4a31646b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This is required to remove the ; from the macro with Qt 6.
Task-number: QTBUG-82978
Change-Id: I3f0b6717956ca8fa486bed9817b89dfa19f5e0e1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
After API discussions, agreement was that from(n) is a bad name
for the method. Let's go with sliced(n) instead.
Change-Id: I0338cc150148a5008c3ee72bd8fda96fb93e9c35
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This keeps the API symmetric with what we have in our string
classes.
Change-Id: I94c5b39b718ca2472f9ca645e7a42e4314636f67
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The change creates a slight source incompatibility. The main
things to take care of are
* code using printf statements on list.size(). Using qsizetype in
printf statements will always require a cast to work on both 32
and 64 bit.
* A few places where overloads now get ambiguous. One example is
QRandomGenerator::bounded() that has overloads for int, uint and
double, but not int64.
* Streaming list.size() to a QDataStream will change the format
depending on the architecture.
[ChangeLog][QtCore][QList] QList now uses qsizetype to index into
elements.
Change-Id: Iaff562a4d072b97f458417b670f95971bd47cbc6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Also adjust qCalculateBlockSize() to be able to handle large
allocations.
QVector::length() is currently still limited to 2G items, that will
get changed in a later commit.
Change-Id: I3a92fbfd7f281d30844c5fafa3b9a474bc347c19
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Remove the last places where those got used and avoid
allocations when we resize to 0.
Change-Id: Ib553f4e7ce7cc24c31da15a55a86d18bdf1cc5c3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
As a side effect, data() can now return a nullptr. This
has the potential to cause crashes in existig code. To work
around this, return an empty string from QString::data()
and QByteArray::data() for now.
For Qt 6 (and once all our internal issues are fixed), data()
will by default return a nullptr for a null QString, but we'll
offer a #define to enable backwards compatible behavior.
Change-Id: I4f66d97ff1dce3eb99a239f1eab9106fa9b1741a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
When the default format has letter and word spacing set then these
should be exported in the HTML's body tag. This also adds support
for the reading of letter-spacing and word-spacing set too, so that
the same html outputted can be read back in.
Fixes: QTBUG-83718
Change-Id: Ic4afca21eb05efb779dbf99c6b3c13373e851f15
Pick-to: 5.15
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This improves the readability and avoids code duplication
in tst_Collections::forwardDeclared. Also some warnings
are fixed:
* qSort is deprecated.
* The = operator for LargeStatic needs to be implemented
explicitly when a copy constructor is given.
* QMap::insertMulti is deprecated, a MultiMap is required.
Task-number: QTBUG-82978
Change-Id: I577f851394edfaa30154bd3417ce391635cc546d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This change only happens to files touched
by the commit to add missing ; to Q_UNUSED.
Task-number: QTBUG-82978
Change-Id: I10e6993a2bb3952cf9a262708b8573550e0dbe63
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
No client of QDateTimeParser actually uses it unless datestring was
enabled, nor is it any use without datestring. Various methods
conditioned on datestring are broken unless datetimeparser is enabled.
We can't condition public API on datetimeparser, as it's a private
feature, but client code can condition use of it on the private
feature. All string-to-date/time conversions that use a string format
(this includes all locale-specific formats) depend on feature
datetimeparser.
Change #if-ery (or add it) in all client (including test) code to test
the right feature.
Tidied up some code in the process. Killed some already-redundant
textdate #if-ery. Renamed a test whose name claimed it involved
locale, which it doesn't, in the course of #if-ing it.
This simplifies the condition for feature datetimeedit (which overtly
depended on textdate, redundantly since it depends on datestring which
depends on textdate; its dependence on datetimeparser now makes its
dependency on datestring also redundant).
It also removes the need for assorted datestring checks in
QDateTimeParser itself.
Change-Id: I5dfe3a977042134b2cfb16cbcc795070634e7adf
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Recent changes in .pro files hadn't been propagated.
Re-ran pro2cmake.py and saved the results.
Change-Id: I91e4cd513329bce10ce8cbd0ddae8240af050213
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The API is available by including qopenglcontext.h as usual,
but scoped in the QPlatformInterface namespace. The namespace
exposes platform specific type-safe interfaces that provide:
a) Factory functions for adopting native contexts, e.g.
QCocoaGLContext::fromNative(nsContext, shareContext);
b) Access to underlying native handles, e.g.
openGLContext->platformInterface<QCocoaGLContext>->nativeContext()
c) Platform specific functionality, e.g.
static QWGLContext::openGLModuleHandle()
openGLContext->platformInterface<QEGLContext>->doSomething();
The platform interfaces live close to the classes they extend,
removing the need for complex indirection and plumbing, and
avoids kitchen-sink modules and APIs such as the extras modules,
QPlatformFunctions, or QPlatformNativeInterface.
In the case of QOpenGLContext these platform APIs are backed
by the platform plugin, so dynamic_cast is used to ensure the
platform plugin supports the requested interface, but this is
and implementation detail. The interface APIs are agnostic
to where the implementation lives, while still being available
to the user as part of the APIs they extend/augment.
The documentation will be restored when the dust settles.
Task-number: QTBUG-80233
Change-Id: Iac612403383991c4b24064332542a6e4bcbb3293
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
The tab has to be repainted even f the mouse release event happened
outside the tab bar, otherwise it will look like the tab is still
pressed.
As a drive-by, replace the repaint() call with update(); there is
no need for synchronous painting in an event handler.
Pick-to: 5.15
Fixes: QTBUG-81637
Change-Id: Ia55182be906511ac3b462f00add8a621c6c05fc3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Rather than naming a "GMT" string so as to repeatedly test whether a
date-time's string representation ends in it, use a simple lambda to
do the test, so that the string is only used in one place anyway.
Makes the test code more readable.
Change-Id: I5afad9ad5d58702bea7f24e5e5688ea4d738ae0d
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Skip crashing tests and ignore failing tests on CMake platforms.
Add missing QTEST_ENVIRONMENT=ci env var assignment to Coin test
instructions. This was hardcoded by the Coin code for qmake
configurations.
Task-number: QTBUG-85364
Change-Id: Id2312e504a0d36b8f8596d4cebaa49c63731406e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Amend d934fd7f54, which was too naive in
assuming that any change to the popup stack while a popup had been
pressed into should result in mouse move events to be delivered without
buttons.
Instead, add a new flag that is set explicitly when the qt_popup_down
widget is closed, and remove buttons from the move move events only when
that flag is set.
Add the sorely missing test case as well, even if we have to accept that
not all behavior can be tested reliably. Ie. on macOS, the simulated
mouse event differs from the event we do get from the QPA plugin or the
system; on Xcb, some of the behavior depends on the window manager.
This is something we could try to clean up for Qt 6.
Change-Id: Ibf0a0a6fb7d401915057365788947e5a35aa20c3
Fixes: QTBUG-84926
Task-number: QTBUG-82538
Pick-to: 5.15
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Liang Qi <liang.qi@qt.io>
We had such an overloaded version in QSslSocket, it was deprecated without
providing any alternative. Now this function has some use and may be
introduced in Qt6, as QSslConfiguration::setCiphers(const QString &).
Last but not the least - a useless and strange auto-test was removed
(it was creating a list of 5 QSslCiphers each with isNull() == true).
That's becasue '!MD5' or 'ALL' (for example) is not a cipher to be found
in supportedCiphers.
Change-Id: I47eb4c0faa9b52885e883751dd992cd9cb3d26fe
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Becaues the database objects were created as globals, there was a
possible use-after-free issue when deleting the objects on application
exit.
Move the initialization of the database objects into static variables
inside the test constructor.
As a drive-by, also add one missing test to the CMake projects.
Fixes: QTBUG-85357
Change-Id: I2c8f2c5daee96bb9d1d21dae37950a2da5ffdf27
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
The platform plugins are implemented to grab the entire screen if
no window ID is provided. They do not grab the entire virtual
screen, just the screen the method is called on.
On macOS, the implementation ignored the window parameter, and
always grabbed the entire virtual screen. This change fixes the
cocoa implementation. The test passes in local tests (with two
displays with different dpr). Since grabbing a screen returns an
image with managed colors, we need to convert it to sRGB color
spec first, otherwise displaying a grabbed image will produce
different results. This will need to be changed once Qt supports
a fully color managed flow.
The test does not cover the case where a window spans multiple
displays, since this is generally not supported at least on macOS.
The code that exists in QCocoaScreen to handle that case is
untested, but with the exception of the optimization it is also
unchanged.
Done-with: Morten Sørvig <morten.sorvig@qt.io>
Change-Id: I8ac1233e56d559230ff9e10111abfb6227431e8c
Fixes: QTBUG-84876
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Not to pollute the global namespace with rather generic names
(especially in case QT_NAMESPACE is none); also drop the
(now)redundant 'Q' prefix in the names.
Change-Id: I57ea7e3996cced705f7ddbdbc1e0231191b31c43
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
It's supposed to return the same as toLocalFile(), for local files,
which means passing QUrl::FullyDecoded just like QUrl::toLocalFile()
does.
But a few code paths were testing component formatting options without masking
other FormattingOptions like RemovePassword, so this had to be fixed.
Fixes: QTBUG-84594
Change-Id: I82f15148b6d93516200f9ad6258d474e7f10924a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We don't really know why, but using the ctest
--force-new-ctest-process flag stops the test from hanging.
Also re-enable the test.
Task-number: QTBUG-78449
Task-number: QTBUG-81365
Change-Id: I33094696dfe3f610dc257089074b1c2a9926f651
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
The QMAKE_CROSS_COMPILED define isn't used since 2011.
Change-Id: I9f03791e9f7c0ef439db5e65d930c0b7cb928974
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This test calls qmake on a project that generates a .qrc file. On
Windows, where debug_and_release is on by default, the generated qrc
file ends up in a "debug" or "release" subdirectory. On other
platforms the file is generated directly in the build dir.
To guess the right location, the preprocessor defines RELEASE_BUILD
and DEBUG_BUILD were passed to tst_qmake.cpp by the test's .pro file.
While the mapping from debug_and_release was fine for the .pro file,
it was commented out in the automatically converted CMakeLists.txt.
Instead of trying to fix the condition, we're going the easier route
that's used in all other .pro files of tst_qmake: make sure that
debug_and_release doesn't get in the way. In other tests this is done
by setting
DESTDIR = ./
which doesn't work for the generated qrc file. That's why we simply do
CONFIG -= debug_and_release
to make sure that everything is generated directly in the build dir.
Change-Id: I557ac4e21d7b385004d369fae8a3f727d76d4d88
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Required by OpenXR. A VkPhysicalDevice or an adapter LUID + feature
level pair should be adoptable while leaving the rest (device, queue,
etc. setup) to QRhi as normal.
Change-Id: Iada0972671b037b4efb03e7831b7c9b8c5f2393d
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
The functional style interface is nice, but does feel alien in some
contexts, so better also have explicit encode and decode methods.
Change-Id: Ic07ced15f65cdb3a7f1cf044041e341d2ef87f79
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Applied to headers only. Source file to be changed separately.
Omitted statemachine for now to avoid conflicts.
Omitted qmetatype.h for now - to be handled later.
Task-number: QTBUG-84469
Change-Id: I317376037a62467c313467d92955ad0b7473aa97
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Adding support for a static notifier within QProperty itself - through a
QProperty "sister" class - is more efficient in terms of memory
consumption and run-time performance.
The MemberChangeHandler permanently takes up at least three pointers,
while the notified properties only cost one pointer in the binding.
Change-Id: Ia1a8c2b66f1f3c2fe13ae0ad9f12cdb6bdcc35ef
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
A guard callback is a predicate which takes the new value set by
setValue or computed as the result of a binding expression. If it
returns false, the value is discarded and the old value is kept.
Note that due to lazyness, when setting a binding, we still notify
everyone as the binding is only evaluated on demand, and the guard can
thus only run when someone actually queries the value.
Note further that a guard is allowed to modify the value that is passed
to it (e.g. to clamp it to a certain range).
Task-number: QTBUG-85032
Change-Id: I3551e4357fe5780fb75da80bf8be208ec152dc2a
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Check at compile time whether the static callback takes an argument
(which has to be of the same time as the type of the property). If so,
retrieve the old value and pass it to the callback.
Change-Id: Ib1c4c9e05b826b6be492b03f66fa72ad015963ee
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
[ChangeLog][QtCore][QByteArray] Remove method overloads taking
QString as argument, all of which were equivalent to passing the
toUtf8() of the string instead.
Change-Id: I9251733a9b3711153b2faddbbc907672a7cba190
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Add overloads for qMin and friends where the arguments are of different
type, but one can be easily promoted to the other. Return the promoted
type. Promotions are only allowed if both types are either signed,
unsigned or floating point numbers.
This should simplify writing code in many case (as for example
qMin(myint64, 1)) and also help reduce source incompatibilities between
Qt 5 and Qt 6, where the return types for sizes of our containers changes
from int to qsizetype.
Change-Id: Ia6bcf16bef0469ea568063e7c32f532da610d1cd
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Fixes regression introduced in b4981f9d4c,
due to which it was possible to back-tab into a widget even though it or
its focusProxy had a NoFocus policy.
As a drive-by, split the complicated if-statement up a bit for improved
readability.
Change-Id: Ib0ac2604076e812e340b11534c23ae8ae958d082
Fixes: QTBUG-76924
Pick-to: 5.15 5.12
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Breaks the build if any global header has
using P = SomeType;
statement, and unnecessary to do so before the headers are included.
Change-Id: I3b8cc705bf662f768b8895e4b3ec1428ab39ef27
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
When I wrote the QCborValue to QJsonValue conversion, I used
QJsonValue::Undefined because it allowed to keep some level of
compatibility in CBOR, despite the function documentation saying that
CBOR undefineds became JSON nulls. Which they did.
But when we converted QJson{Array,Object} to be backed by CBOR classes,
that Undefined meant the insertion into the array/object actually
deleted the entry.
[ChangeLog][JSON] Fixed a regression from 5.14 that caused values of
default-constructed QVariants in QVariantLists, QVariantMaps and
QVariantHashes to disappear when converting to JSON via
fromVariant{,List,Map,Hash}.
Fixes: QTBUG-84610
Pick-to: 5.15
Change-Id: Ic0987177fe463f352db9bd84993f116e2bdacc75
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We have no doubt it does, because it's compiler-synthesized, but
we might want to implement the tuple protocol for QPair in the
future and then this will act as a safety net, emulating what
users are currently already doing with QPair.
Change-Id: Ie37f0214bb1aa64210d25be8a256606f4572febe
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This (and use of Q_SLOTS for the test slots) makes it possible to
enable QT_NO_KEYWORDS and QT_NO_FOREACH in all the corelib/time/
tests.
Change-Id: I85fd358f3d1a72c9269d5260d0224640c1751f2d
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Use the overload-with-template trick from P1423 to avoid ambiguities
when existing callers pass 0 or nullptr.
Add a qdoc-ignored macro to hide the fact that the overload is a
template.
[ChangeLog][QtCore][QString] Added char8_t overload of fromUtf8().
Change-Id: Iaa2d365bfa161ef36cc73fa3bad50aabf34d01db
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
All our tests were find() == end() or !=, which depends on the
evaluation order of the arguments to operator==(). If end() is called
first, then the detach happens before find() and all is well. But if
find() is called first, it may return end() before end() detaches.
[ChangeLog][QCborMap] Fixed a bug that could cause the iterator returned
from a failing key search with find() not to match end(). Now, every
call to find() will detach in shared QCborMaps; to avoid this, use
constFind() and constEnd().
Fixes: QTBUG-84583
Pick-to: 5.15 5.12
Change-Id: I552d244076a447ab92d7fffd161793496a8d03a8
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
A QVLA is copyable, so it should be movable, too.
Added a helper function a la P1144's uninitialized_relocate_n to deal
with the QTypeInfoQuery stuff. This way, the code is re-usable
everywhere it's needed. The same cannot be said for QArrayDataOps,
which only a parent can love...
[ChangeLog][QtCore][QVarLengthArray] Added missing move constructor
and move-assignment operator.
Task-number: QTBUG-39111
Change-Id: If0dc2aa78eb29062d73dcd3dc4647ba345ae39e6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
They were deprecated with replacements in QSslConfiguration proposed (and
some without alternative, which we'll provide if there is any demand
in such an API). Special thanks to M.N. for a nice hint on how to
amend the test without introducing a new API.
Change-Id: I7841a5b3f30469d8204b61cb65921c34275e0650
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The idea was to keep nagging us to update all the platform plugins to
do device registration. But besides being annoying, it would cause
test failures if we start adding QTest::ignoreMessage() all over,
and then some platforms start doing device registration properly.
Change-Id: Ia0fbb64cf86f33532be032ec9eebe6e4ad607f20
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
This enables the order of boundValues to be consistent as with a QMap
it could have been reordered which can be a problem for positional
bindings.
[ChangeLog][QtSQL] Changed signature of QSqlQuery::boundValues() to
return a QVariantList
Fixes: QTBUG-51609
Change-Id: I1c80fa8522fa7352723420b6fc9ec466406315fb
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Even it was not marked as deprecated the replacement function initFrom()
is available since Qt4 times (and init() is deprecated since then)
Change-Id: I09a4ebbf66b01fbe7aec67691dc68d2e42d1cd78
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
And name the main class QList. That's also the one we document.
This gives less porting pain for our users, and a lot less churn
in our API, as we use QList in Qt 5 in 95% of our API.
In addition, it gives more consistent naming with QStringList and
QByteArrayList and disambiguates QList vs QVector(2|3|4)D.
Fixes: QTBUG-84468
Change-Id: I3cba9d1d3179969d8bf9320b31be2230d021d1a9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Assume UTF-8 on all Unix like systems
* Export some functions to be able to compile QTextCodec once
moved to Qt5Compat.
Task-number: QTBUG-75665
Change-Id: I52ec47a848bc0ba72e9c7689668b1bcc5d736c29
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
There is no reason for keep using our macro now that we have C++17.
The macro itself is left in for the moment being, as well as its
detection logic, because it's needed for C code (not everything
supports C11 yet). A few more cleanups will arrive in the next few
patches.
Note that this is a mere search/replace; some places were using
double braces to work around the presence of commas in a macro, no
attempt has been done to fix those.
tst_qglobal had just some minor changes to keep testing the macro.
Change-Id: I1c1c397d9f3e63db3338842bf350c9069ea57639
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This was causing some bogus failures in Qt Quick autotests.
Existing APIs like QQuickWindow::mouseGrabberItem() are not really
compatible with the idea of a mouse-less system; but perhaps we can
revisit this later.
Task-number: QTBUG-85114
Change-Id: Id1c2e5894e5cf13a79998aaea28d5f42fad920cf
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
We want every QInputEvent to carry a valid device pointer. It may be
some time until all QPA plugins are sending it, but it's necessary to
provide the functions for them to start doing that.
We now try to maintain the same order of arguments to all the functions.
handleTouchEvent(window, timestamp, device, the rest) was already there
(except "device" has changed type now), and is used in a lot of platform
plugins; so it seems easiest to let that set the precedent, and modify
the rest to match. We do that by adding new functions; we can deprecate
the older functions after it becomes clear that the new ones work well.
However the handleGestureEvent functions have only ever been used in
the cocoa plugin, so it's easy to change their argument order right now.
Modify tst_qwindow::tabletEvents() to test new tablet event API.
Task-number: QTBUG-46412
Change-Id: I1828b61183cf51f3a08774936156c6a91cfc9a12
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Documented QPromise. Added snippets under auto tests
to ensure they are compiled and run in CI.
Task-number: QTBUG-81586
Change-Id: I20084e38f9d2f6fc8540f95ee03ec3d2827177e8
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Change the meaning of Q_PRIVATE_QPROPERTY to imply that the property is
implemented using a QNotifiedProperty. That requires passing the owner
object instance to the value and binding setters.
Similarly, detect QNotifiedProperty members like QProperty.
Change-Id: If49bbb04c8ccd4a661973888c50d2d556c25034f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
...starting with a new feature: registering different devices at
different seats and verifying their capabilities and that we can get
them back again.
Change-Id: I8e58a49080633753d02a76e5fdc4932f5c674e0a
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
- stop using deprecated accessors in QTabletEvent and QMouseEvent
- position() and globalPosition() provide high resolution so
we don't need to display hi-res global pos separately
- keep a pointer to the last-seen QPointingDevice instance
rather than copying fields out of it; it will only be deleted
if the platform plugin does that (usually only at exit or
when it's unplugged)
- show seat ID
- show platform-specific device ID
Change-Id: Ic34e1d1256d6956867992db831c2e66bdda7001e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
We have seen during the Qt 5 series that QMouseEvent::source() does
not provide enough information: if it is synthesized, it could have
come from any device for which mouse events are synthesized, not only
from a touchscreen. By providing in every QInputEvent as complete
information about the actual source device as possible, we will enable
very fine-tuned behavior in the object that handles each event.
Further, we would like to support multiple keyboards, pointing devices,
and named groups of devices that are known as "seats" in Wayland.
In Qt 5, QPA plugins registered each touchscreen as it was discovered.
Now we extend this pattern to all input devices. This new requirement
can be implemented gradually; for now, if a QTWSI input event is
received wtihout a device pointer, a default "core" device will be
created on-the-fly, and a warning emitted.
In Qt 5, QTouchEvent::TouchPoint::id() was forced to be unique even when
multiple devices were in use simultaneously. Now that each event
identifies the device it came from, this hack is no longer needed.
A stub of the new QPointerEvent is added; it will be developed further
in subsequent patches.
[ChangeLog][QtGui][QInputEvent] Every QInputEvent now carries a pointer
to an instance of QInputDevice, or the subclass QPointingDevice in case
of mouse, touch and tablet events. Each platform plugin is expected to
create the device instances, register them, and provide valid pointers
with all input events. If this is not done, warnings are emitted and
default devices are created as necessary. When the device has accurate
information, it provides the opportunity to fine-tune behavior depending
on device type and capabilities: for example if a QMouseEvent is
synthesized from a touchscreen, the recipient can see which touchscreen
it came from. Each device also has a seatName to distinguish users on
multi-user windowing systems. Touchpoint IDs are no longer unique on
their own, but the combination of ID and device is.
Fixes: QTBUG-46412
Fixes: QTBUG-72167
Task-number: QTBUG-69433
Task-number: QTBUG-52430
Change-Id: I933fb2b86182efa722037b7a33e404c5daf5292a
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
The QPair changes trigger warnings about size_t vs. quint32.
We made offsets and sizes 32-bit in the QRhi API to emphasize that
some of the graphics APIs are using 32-bit sizes still. It's a bit
unfortunate that pairs now generate warnings when the size does not
match. Just cast as needed.
Change-Id: I88504eed8be6f4bdb2205b3671e2c2a9db9fcb1e
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
The Vulkan spec changed the behavior for VkApplicationInfo::apiVersion
in 1.1, conveniently breaking compatibility with all existing 1.0 logic.
We can no longer assume that the 1.0 behavior, which was failing instance
creation with VK_ERROR_INCOMPATIBLE_DRIVER for an unsupported version,
is always in place. So do not rely on this in the test, and add a
reminder in QVulkanInstance docs as well.
Fixes: QTBUG-85040
Change-Id: I8f5c7a7830877b72d106c444aebfaea191083ee0
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
They are justified in using huge memory.
Pick-to: 5.15
Change-Id: Id16d2ea67cfac0e031d05258173391e222b41097
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>