The android emulator launcher script is mainly used in CI and thus
makes sense to be moved there. This also makes it easier to make changes
without having to wait for submodule updates.
ANDROID_EMULATOR_RUNNER is defined in qt5's Android provisioning script.
Also, change the order of instructions execution to set COIN_CTEST_RESULTSDIR
env variable before running the emulator script. That var points to the path
to where the emulator logs are saved.
Task-number: QTQAINFRA-5596
Change-Id: If6ac285fecdc49611c398e8185e6e3e6b9c353fb
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
We do not need the Q_CC_GNU check, as the __SIZEOF_INT128__ check is
enough.
Pick-to: 6.6
Change-Id: I12bdd02186c4f5dad0ab3f4596f4b37e5c3f7eee
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Rewritten to be a bit simpler, added a few more yield/YieldProcessor
alternatives, added RISC-V support.
[ChangeLog][QtCore] Added qYieldCpu() function.
Fixes: QTBUG-103014
Change-Id: I53335f845a1345299031fffd176f59032e7400f5
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Use QT_DEPRECATED_VERSION_X_6_6 and provide reasons for deprecation
for the enum value and for the QPropertyObserver constructor.
Pick-to: 6.6
Change-Id: I0f9b4c6dc8bb9fd5eac692a6953c90059f3c77ef
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Provide a centralized overview of Qt's comparison types, available
for three-way comparisons.
Fixes: QTBUG-114402
Change-Id: Ib7229e753ef750d00c208794d1feb3e6d42133ad
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
It tried to reference the QXmlStream equivalent example, putting its
title in {...}, but neglected the \l prefix to that.
Change-Id: Iedc556ecd65103057d0dea65debe628b50d1190e
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
The description in terms of timeouts was confusing. Instead, say what
it actually does, in plain terms. Mention that you can do similar for
a duration.
Pick-to: 6.6
Task-number: QTBUG-115447
Change-Id: I4618d7fa290e7959ed3cb51e5c2576b041f77091
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Remove stray comment at the end of tst_qexplicitlyshareddatapointer.cpp
Pick-to: 6.6
Change-Id: I31a6c38002e56e7c43e527864ba3d9324950079f
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
Remove stray comment at the end of tst_qxmlstream.cpp
Pick-to: 6.6
Change-Id: I88550e2b75194e7895d8578ca0e8350af59d4dfe
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
This causes modern compilers (i.e., not MSVC) to emit a single
bit-test-and-set instruction instead of a cmpxchg. It's still an atomic
operation, so it's not that much faster (if at all), but it has simpler
encoding.
Previous:
000000000026bca0 <QEventDispatcherUNIX::wakeUp()>:
26bca0: mov 0x8(%rdi),%rdx
26bca4: xor %eax,%eax
26bca6: mov $0x1,%ecx
26bcab: lock cmpxchg %ecx,0x98(%rdx)
26bcb3: jne 26bcc5 <QEventDispatcherUNIX::wakeUp()+0x25>
26bcb5: mov 0x90(%rdx),%edi
26bcbb: mov $0x1,%esi
26bcc0: jmp c01d0 <eventfd_write@plt>
26bcc5: ret
Now:
26b3a0: mov 0x8(%rdi),%rax
26b3a4: lock btsl $0x0,0x98(%rax)
26b3ad: jae 26b3b0 <QEventDispatcherUNIX::wakeUp()+0x10>
26b3af: ret
26b3b0: mov 0x90(%rax),%edi
26b3b6: mov $0x1,%esi
26b3bb: jmp c11d0 <eventfd_write@plt>
Change-Id: I53335f845a1345299031fffd176fa8ac1de3ad13
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Linux has had it since 2.6.23, which is positively ancient from our
perspective. No one runs Qt on systems anywhere near that old (I'd be
amazed if anyone managed on CentOS / RHEL 7, which carries Linux 3.10).
And we don't deal with ENOSYS on FreeBSD either.
The removal is accomplished by dead code elimination: it's still
compiled on Linux and FreeBSD.
Drive-by
- use NSDMI in QThreadPipe
- remove EINTR_LOOP for eventfd_write(3): it can't be interrupted
Change-Id: I63b988479db546dabffcfffd1766e2c7acc6da46
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
And mark it private.
[ChangeLog][QtCore] Qt no longer sets the QT_NO_EVENTFD feature macro
on systems without eventfd.
Change-Id: I63b988479db546dabffcfffd1766e1df5255c930
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
The install-time code path that's supposed to propagate and install the
metatypes files was never executed, because of a wrong
PARENT_SCOPE assignment and because the code was overriding the meta
type file name retrieved from a property with an empty non-existent
argument.
This caused build failures in qtdeclarative when qmlcachegen generated
invalid cpp code without having access to the qtbase foreign types.
This only happened in prefix builds.
Use the appropriate variable for the PARENT_SCOPE assignment and
remove the incorrect file name assignment.
Amends c45c32af32
Task-number: QTBUG-115152
Change-Id: I120d53d44382a1ac6f62792ec1620add3e7b136c
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
The existing signal connection can cause a loop and undefined behavior
in the interaction between the line edit for a hex rgb color and the
individual rgb values.
=> Change connection to textEdited, to react only on manual editing.
Fixes: QTBUG-115189
Pick-to: 6.6 6.5
Change-Id: Ie3062c575652b905a8ab16edb2f5f77f8d150f36
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
QObject::tr() should not be used.
Amends c4301be7d5.
Task-number: QTBUG-92113
Task-number: QTBUG-95188
Pick-to: 6.6 6.5
Change-Id: I09547c3d048d6b3726e33be74b06035f0eec4f31
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
This is done in anticipation of another test for dragging
Change-Id: I56961eb1d16a4a6b6c58890c9c882dea813dfa08
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
Use qwasmwindow_harness_entry instead of the old createQtAppInstance.
Change-Id: I381dd43d9144fe70f055c19db4cd95f90313883b
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
Problem was, that qstorageinfo_unix.cpp is using sys/statvfs.h header, but this header is not available in Vxworks(Vxworks has
its own /sys/ directory).As this feature is not there in Vxworks, we are using a "_stub" file to omit whole implementation.
This is the same solution as it was used for Qt5 for Vxworks.
Change-Id: I1bc5a576e63f403c923cbc93571967184677305f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This functionality is now available in VSB
Change-Id: I761d73d8ae100b2e0eae8101479b325ddcbde6cc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
- rvalues, they work due to e.g. the implicit conversion to QString, so
the compiler picks the "const String &" overloads. (This may change by
adding rvalue overloads in a later commit, although that will mean
adding many more operator+() overloads to disambiguate the calls)
- QByteArray + QByteArrayView
- More P and more Q (even though in some cases P and Q are defined as
the same operator in some QStringBuilder unittest "scenarios")
Change-Id: I4e7daecdb6887fb52f45732cd32323af20b1b850
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
E.g. a group separator, a -/+ sign, or 'e' (exponent). Input ending with
one of these characters now returns Intermediate, as it can become
Acceptable if the user types more characters.
Remove a check from initialResultCheck(), as it's now covered by
QLocaleData::validateChars() checking that the last character in the
buffer is -/+, this works the same if buffer's size is 1.
Extended unittests based on the linked bug report; the other cases for
"last" are already covered by existing unittests.
Task-number: QTBUG-111371
Change-Id: I9b6979c29f07a5f57b040004cd3dbf4e27147c21
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Add an option to disable handling of positional binding so jsonb
operators are not screwed up
[ChangeLog][QtSql][QSqlQuery] Add setEnablePositionalBinding() to be
able to disable positional binding.
Fixes: QTBUG-96636
Change-Id: I428a9d3b10274b97292ab86a74d9b3971d6f10e9
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Drive-by change: use \code, better formatting especially for longer
lines of code.
Change-Id: I90dbde17a5bea276c86304bff64027dd9d248a21
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It actually takes one parameter, because in this overload the connection
type can't be specified, for example:
QTimer timer;
timer.callOnTimeout([]() { qDebug() << "slot"; });
The call chain is:
QObject::connect(timer, &QTimer::timeout, functor);
connect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal, Func2 &&slot)
connect(sender, signal, sender, std::forward<Func2>(slot), Qt::DirectConnection);
the connection type is always DirectConnection.
Spotted by Giuseppe in code review.
Pick-to: 6.6 6.5 5.15
Change-Id: Ia8bbd91e98a357244cbfae4e3ed63d4c73038fa2
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
It was defined in qlocale_tools_p.h which already includes qlocale_p.h.
Change-Id: I43464a27ec15266ce8632ca30dcd1c57d94b1f25
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Instead of returning just bool, return a result struct {State,
CharBuff}, a State is useful as it can have an Intermediate state
where the input isn't Acceptable yet, but not Invalid as such. The
example from the linked bug is in tst_QIntValidator::validateFrench(), a
string "1 ", which can be interpretted as a number with a group
separator, but the input shouldn't end with a group separator (changing
the unittest will be done as part of a separate commit).
CharBuff (QVarLengthArray<char, 256>) replaces the QByteArray input
parameter; a QVarLengthArray means no heap allocation in typical
use-cases with input text < 256 characters to validate. This required
minimum changes (QVLA doesn't have startsWith, replaced by comparing
with buff[0]; and for converting to double, wrapped it in a QBAV).
Task-number: QTBUG-111371
Change-Id: I4e0eb612d470ef03faf52031ddfe9c4bdb31e1e1
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
QDoubleValidator didn't return Intermediate if the buffer only had one
character, - or +, but it makes sense to check that there too.
In a later commit that check will be moved to QLocaleData::validateChars
(which will return "Intermediate" if the last character in the result
buffer is -/+, in this case it's the last and only character in the
buffer).
Change-Id: I2f9f5b92880b7e9cc1a3ab36b5ec322f57291ee9
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Take by const Str&, trimming a container/view of characters means
removing whitespace from the beginning and end, so the two args were
always cbegin() and cend().
Change-Id: Iac0eda59341f1981204d11013d591013eae3c4e0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The same _data() will be re-used with trim().
Change-Id: Ie9b794b7e8d40552d9cacb71df0f8a151d4348a5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Use [&] instead and remove overparenthefication as a drive-by.
Amends c888e3922d.
Pick-to: 6.6 6.5 6.2
Change-Id: Ic7930d5011c247122a1b3396ea0d6a9a2d6107de
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
They aren't used because the C++11 atomics are the only atomics we've
supported since commit 9d1fab424e (5.6).
Pick-to: 6.6
Change-Id: I53335f845a1345299031fffd176f84ccd054b804
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
By the time QObject::destroyed() is emitted from ~QObject(), sender no
longer is-a SenderObject, only a QObject, so calling a SenderObject
member function on it is UB.
Says UBSan:
tst_qfuture.cpp:3854:84: runtime error: member call on address 0x60200000e550 which does not point to an object of type 'SenderObject'
0x60200000e550: note: object is of type 'QObject'
00 00 00 00 e8 3f 96 c9 51 7f 00 00 80 3e 00 00 c0 60 00 00 02 11 00 00 08 00 00 00 16 00 00 72
^~~~~~~~~~~~~~~~~~~~~~~
vptr for 'QObject'
Fix by removing the QObject::connect().
This, of course, breaks the test's WHEN, but I don't see how to keep
that WHEN without the UB. At least the THEN part is not invalidated,
and there doesn't appear to be another test that tests that destroying
objects before signal emission results in a cancelled future.
Amends 612f6999c8.
Pick-to: 6.6 6.5 6.2
Change-Id: I38ca4611c071e8fd200393b600210e36d4030bc6
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
QSpan is Qt's version of std::span. While we usually try not to
reimplement std functionality anymore, the situation is different with
QSpan. Spans are non-owning containers, so the usual impedance
mismatch between owning STL and Qt containers doesn't apply here:
QSpan implicitly converts to std::span and vice versa, making STL and
Qt APIs using spans completely interoperable.
We add QSpan mainly for two reasons: First, we don't want to wait
until we require C++20 in Qt and can use std::span. Second, in the
view of this author, some design decisions in std::span hurt the
primary use-case of spans: type-erasure for containers. This results
in two major deviations of QSpan from std::span: First, any rvalue
container is convertible to QSpan, allowing seamless passing of owning
containers to functions taking spans:
void sspan(std::span<T>);
void qspan(QSpan<T>);
std::vector<T> v();
sspan(v()); // ERROR: rvalue owning container
auto tmp = v();
sspan(tmp); // OK, lvalue
qspan(v()); // OK
This author believes that it's more helpful to have compilers and
static checkers warn about a particular wrong usage than to make
perfectly valid use-cases impossible or needlessly verbose to code.
The second deviation from std::span is that fixed-size span
constructors are also implicit. This isn't as clear-cut, because an
explicit QSpan{arg} isn't per-se bad. However, it means you can't
transparently change from a function taking decltype(arg) to one
taking QSpan and back. Since that's exactly what we intend to do in Qt
going forward, in the interest of source-compatibility, the ctors are
all implicit.
Otherwise, the API of QSpan follows the std::span API very
closely. Like std::span, QSpan isn't equality_comparable, because it's
not clear what equality means for spans (element-wise equal, or (ptr,
size)-wise equal?). The major API additions are Qt-ish versions of std
API functions: isEmpty() on top of empty() and sliced() instead of
subspan(). The (nullary) first()/last() functions (Qt speak for
front()/back()) clash with the std::span function templates of the
same name, so are not provided.
This patch adds QSpan as private API. We intend to make it public API
in the future.
Pick-to: 6.6
Fixes: QTBUG-108124
Change-Id: I3f660be90eb408b9e66ff9eacf5da4cba17212a6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
When parsing a string whose time-zone part matches local time's name,
use local time in preference to the QTimeZone with that name. The case
is ambiguous, and the bug was already fixed (by something else) in
dev, but this caused a failure in 6.2 through 6.5; and using local
time is more natural to QDateTime in any case. The fix incidentally
makes the the logic of the zone-resolution code more straightforward
and a closer match to how findTimeZone() found the match.
The issue was hidden from 6.6 by a change [*] to the handling of POSIX
rules, that lead to plain abbreviations such as CEST and BST - for
which the IANA DB has no entry - no longer being considered "valid"
zones, despite being technically valid POSIX zone descriptors
(effectively as aliases for UTC).
[*] commit 41c561ddde
Pick-to: 6.6 6.5 6.2
Fixes: QTBUG-114575
Change-Id: I4369901afd26961d038e382f4c4a7beb83659ad7
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Since QDateTime uses some fall-backs if qTzName() doesn't give it
something useful (as happens on MS-Win when local time is UTC),
QDateTimeParser should check the result of those fall-backs as well as
the qTzName()s when checking for local-time as zone.
Pick-to: 6.6 6.5 6.2
Change-Id: Ic809b7e44cd0c83fb076b24c27547268345fa379
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
It's actually testing that the system locale (which it obtains via the
default constructor, relying on setDefault() not being called first in
the helper program - which I'll soon change) behaves as expected.
Change-Id: Iedd2c1bb549288661c910dfbaac509ede9506d04
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Although QSystemLocale is (to make its query enum usable) defined
despite the QT_NO_SYSTEMLOCALE define, it's not used in that case, so
tests based on it won't work. So extend the reach of the #if-ery to
include the test using a custom class based on it. Also rename the
test from systemLocale(), as that's the name the emptyCtor() test
really should have.
Change-Id: Ief69bf161251cde47ee45014cc2627d42cfcc526
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
The other Roman-based calendars share the same month names as
Gregorian, so it makes sense for them to use the same system fallbacks
as it when available.
Change-Id: Idf2f2901032c7a02d641f00a3993cc95b6bb8067
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Amends commit 94de5f9b25 so that every
change to the default locale is reflected in an update to the default
collator used by QString::localeAwareCompare().
Although the change to the system locale does update the QLocaleData
object shared by all system locale objects, the possible change to its
collator() may imply the default collator needs an update; and the
collator backend's init() may use the language, script and territory
that's changed in setting up the revised collator, even if the QLocale
instance referenced has the same QLocaleData.
Pick-to: 6.6 6.5 6.2
Change-Id: I957486c03c3d779fc9a2f0b889346ec13b1af868
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This is for consistency with QObject::connectImpl() and
QObjectPrivate::connectImpl(), if nothing else.
See the commit message of the QObject::connectImpl() porting patch for
why we leave the function signature unchanged (key-word:
tail-callability).
Pick-to: 6.6 6.5
Change-Id: I515d3be4a5126f9f4738dd7bde5174377faf2343
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
... removing the custom scope-guard which was .dismiss()ed too early
(the allocation of 'c' could theoretically fail, and the old code
would leak the slot object in that case; nothing we're generally
guarding against in Qt, but it's a nice drive-by gain, probably shuts
up static checkers, and makes readers wonder less about the lifetime
of the slot object).
As mentioned in the patch porting QObject::connectImpl(), leave the
unique_ptr out of the function's signature, see there for rationale
(key-word: tail-callability).
Pick-to: 6.6 6.5
Change-Id: Ib90371b9768a72fd62d080b71eef2c82f851db81
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>