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>
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>
Amends a452e22546. No new tests, existing
tests fails when QPlatformTheme returns a QIconEngine implementation
that provides the tested icons. However, the existing test fails when
the platform icon engine provides and address-book-new icon, and depends
on the order of test functions, as the name() test function modifies the
global theme name and search path. Fix those issues in the test.
Pick-to: 6.6
Change-Id: Ie1c1d14f08fad5e906296bab662df5cfacdbbf07
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Looping over the entries had a typo in it and was quite unnecessary,
as it just made a fresh copy of a list we already had.
Pick-to: 6.6 6.5 6.2 5.15
Change-Id: I0f3023b06163e5854d425d816e465785cda5fc91
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Allocate participating threads and objects on the stack, not the heap.
As a drive-by, port from QList to C arrays (never use a
dynamically-sized container for statically-sized data™).
Code predates the public history, all active branches are affected.
Pick-to: 6.6 6.5 6.2 5.15
Change-Id: If8def658c1c7b505074938d637e78ad2d1f9fd57
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Like in 9f8449a054, for
doubleProxySelectionSetSourceModel(), the sortStable() test also
leaked _everything_. Fix in the same way, by allocating model and view
on the stack intead of the heap.
With this patch, tst_QSortFilterProxyModel is now asan-, but not
ubsan-clean (and, because of
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110704, asan still
reports a leak in cp-demangle.c, which should be™ gone once we fix the
rest of QTBUG-99563).
Pick-to: 6.6 6.5 6.2 5.15
Task-number: QTBUG-115264
Change-Id: Ic0e833d7336435e324457f9d9667ee8573a7dafc
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
QThreeWidgetItems that have been removed from their parents (or the
widget) must be deleted manually. The treeWidgetModel() test forgot
that, driving asan nuts.
Code predates the beginning of the public history, so picking to all
active branches.
Pick-to: 6.6 6.5 6.2 5.15
Change-Id: I139549b0bd8baf4abfb90f926f6290119471046f
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
A caller of Q(Abstract)NetworkDiskCache::data() is supposed to delete
the returned value, and this caller forgot.
Do it now; better late than never.
Amends feb1afc782.
Pick-to: 6.6 6.5 6.2 5.15
Change-Id: I1b27663df9ad49e0203172265d224fdb6ec06646
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
A text editor commonly wants to display a list of codecs that are
supported. With the introduction of the ICU based QStringConverter, that
list is no longer statically known. So provide the necessary
functionality.
Fixes: QTBUG-109104
Change-Id: I9ecf59aa6bcc6fe65c8872cab84affafec4fa362
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
The user might not be aware of, or able to see, the difference between
Unicode's assorted horizontal spacing characters, leading them to
expect their input to be accepted for a format despite differences in
spacing. So treat the various horizontal spacing (other than tab)
characters as equivalent when matching the separators in a date-time
format. Add a test-case that failed before this fix.
Fixes: QTBUG-114909
Pick-to: 6.6 6.5
Change-Id: I3e798d3e5b89adb8e86168ebd3954904b258d630
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
The QUuid(quint128) ctor was handing the incoming data differently
from the QUuid(Id128Bytes) ctor. Same was valid for the return
values of QUuid::toUint128() vs QUuid::toBytes().
The provided test didn't reveal it, because it was treating the same
128-bit input value as BE in one place, and as LE in another place.
This patch fixes the test, and updates the implementation of
QUuid(quint128) ctor and toUInt128() method to verify that the
updated test passes.
This commit amends 8566c2db85
Pick-to: 6.6
Change-Id: I24edb8ba0c8f7fd15062ba0b2a94ad387c3e98b6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
earlyConstructedSockets is a QObject, but had no parent and was never
deleted, leaking all the data is holds.
Fix by giving it a parent.
The code predates the begin of the public history.
Pick-to: 6.6 6.5 6.2 5.15
Change-Id: Ibc5688afd6111e84f591c37e39b6bb618d76c47a
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QTest::toString() returns a new[]'ed char array, which needs to be
manually deleted and QVERIFY2() doesn't take ownership of its second
argument.
Fix by wrapping in unique_ptr<char[]>(...).get().
Bug exists since the dawn of the public history.
Pick-to: 6.6 6.5 6.2 5.15
Change-Id: I19ec09f46ec0ce5eacf1437f62dc625bc9343831
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Setting the parent of a QObject to nullptr means the ex-parent no
longer owns and deletes the object as its child, leaking it.
Fix by creating a scope-guard to defer deletion until the tests have
run.
This is simpler than the alternatives:
Putting it into unique_ptr would require a new variable name, or a
larger refactoring of the function, because the `test` variable is
being re-used for many different objects in the course of the
function, most of which should not be deleted.
Using QAutoPointer would drag in QtWidgetsPrivate, and the class is
probably not available in all active branches.
Finally, deleteLater() would require reliably returning to the event
loop, which may not happen if the test is run in isolation.
Bug exists since the dawn of the public history, and QScopeGuard is
available in all active branches.
Pick-to: 6.6 6.5 6.2 5.15
Change-Id: Ib4fcb44b0b68d4ccbcf5af144a18ffb378a72213
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
In C++20 std::basic_string_view has gained a range constructor (like
QStringView always had), but that range constructor has been made
explicit. This means we can't just pass a QString(View) to a function
taking a u16string_view. The consensus seems to be that that types that
should implictly convert towards stdlib's string views should do that
via implicit conversion operators. This patch adds them for
* QByteArrayView => std::string_view
* QString(View) => std::u16string_view
* QUtf8StringView => std::string_view or std::u8string_view, depending
on the storage_type
QLatin1StringView doesn't have a matching std:: view so I'm not enabling
its conversion.
QByteArray poses a challenge, in that it already defines a conversion
towards const char *. (One can disable that conversion with a macro.)
That conversion makes it impossible to support:
QByteArray ba;
std::string_view sv1(ba); // 1
std::string_view sv2 = ba; // 2
because:
* if only operator const char *() is defined, then (2) doesn't work
(situation right now);
* if both conversions to const char * and string_view are defined, then
(1) is ambiguous on certain compilers (MSVC, QCC). Interestingly
enough, not on GCC/Clang, but only in C++17 and later modes.
I can't kill the conversion towards const char * (API break, and we use
it *everywhere* in Qt), hence, QByteArray does not get the implicit
conversion, at least not in this patch.
[ChangeLog][QtCore][QByteArrayView] Added an implicit conversion
operator towards std::string_view.
[ChangeLog][QtCore][QString] Added an implicit conversion operator
towards std::u16string_view.
[ChangeLog][QtCore][QStringView] Added an implicit conversion operator
towards std::u16string_view.
[ChangeLog][QtCore][QUtf8StringView] Added an implicit conversion
operator towards std::string_view (QUtf8StringView is using char
as its storage type in Qt 6). Note that QUtf8StringView is planned to
use char8_t in Qt 7, therefore it is expected that the conversion will
change towards std::u8string_view in Qt 7.
Change-Id: I6d3b64d211a386241ae157765cd1b03f531f909a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
I cannot get it to fail on my local machine
Change-Id: Iec30858df6bf5ef51a805745745cc0e98e8db03a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We need deduction guides to turn the AtomicPointer template argument
(the pointee) into a pointer:
QAtomicPointer<int> → QAtomicScopedValueRollback<int*>
Extend a test to cover pointers, too.
Fixes: QTBUG-115105
Pick-to: 6.6 6.5
Change-Id: Ib416c6a43e4da480b707a0bf6a10d186bbaad163
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Different mime types are widely used on mobile devices. For example all
text copied from gmail is copied as text/html type.
After 2937cf91c7 commit there is a
regression that makes it impossible to paste any text different than
"text/plain".
To fix it, any "text/*" mime type should be treat as it contains a text
(not only "text/plain"). That will allow to paste different text mime
types.
During this work also tst_qclipboard testset was turned on for Android
and new test (getTextFromHTMLMimeType) was added.
Pick-to: 6.6 6.5 6.2
Fixes: QTBUG-113461
Change-Id: I3ef9476b8facdc3b61f144bd55222898390127c9
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
The test was relying on the fact that, having written 1 byte to both
writeEnd1 and writeEnd2 (and ensured those bytes were written with
waitForBytesWritten()), both read ends would be activated by the next
event loop. It turns out that this was an unreliable assumption, because
the processing of that 1 byte on the second socket may not have happened
yet. So firm up by waiting that both read ends are readable before even
creating the QSocketNotifiers we will read on.
I'm not entirely sure what this test is attempting to test. Its
documentation says it's testing a QAbstractSocket condition, but the
read ends aren't QAbstractSocket (this test should have been in
tst_QAbstractSocket if so). It may be testing the condition that caused
that QAbstractSocket behavior, but that wouldn't be a good test.
Drive-by remove redundant flush()-after-waitForBytesWritten() calls.
Fixes: QTBUG-115154
Pick-to: 6.5 6.6
Change-Id: I61b74deaf2514644a24efffd17708f8071f707ed
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Register the directory tokenError in the build system to expose it to
embedded devices / for cross compiling.
Do not fail the test function, when a test file isn't found. The tested
functionality is platform independent and will be tested on other
platforms.
Task-number: QTBUG-92113
Task-number: QTBUG-95188
Pick-to: 6.6 6.5 6.2 5.15
Change-Id: I885d8fdfbbf8ec60e6326bfd871fa85a4390247d
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
As a result of the fix for QTBUG-75214, Qt inadvertently no longer
reads the AND mask that specifies transparency for 16-bit and 24-bit
ico files. This is because it tries to detect 32-bit icons by checking
icoAttrib.depth == 32, but icoAttrib.depth is set to the depth of the
QImage, not the depth of the icon, and 32-bit QImage is used for all of
the non-indexed cases (16-bit, 24-bit and 32-bit.)
This commit instead uses icoAttrib.nbits, which should reliably
determine whether or not the icon is 32-bit. This makes the behavior
consistent with other ico reading software, including Windows.
Also, adds a unit test that verifies correct behavior of icon masks,
checking for both QTBUG-75214 and QTBUG-113319.
Amends 1d128ed1df.
Fixes: QTBUG-113319
Change-Id: I89ac86ff16054c8925fff6afc8c530fa737f8385
Pick-to: 6.6 6.5 6.2 5.15
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
ASSERT: "size_t(i) < size_t(size())" in file qbytearray.h, line 492
due to info being emptied out completely and then the code does
while ((info.at(0) == '*')
info was empty because the recent fix "that wasn't the function argument
list" would exit the loop with pos at end.
Incidentally, this change fixes the fact that qCleanupFuncInfo was
removing lambdas:
main(int, char**)::<lambda()>
became
main(int, char**)::
which was, well, shorted, but weird.
Pick-to: 6.6 6.5
Change-Id: Ic7e8f21ea0df7ef96a3f25c4136a727dc0def207
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Amend 3e59a88e89, which incorrectly used
isHidden() to test whether the scrollbar is visible or not.
QWidget::isHidden() is only true for child widgets that are explicitly
hidden (or created for visible parents, which the scrollbars are not).
Since the scrollbars are children of a container that is hidden and
shown, isHidden always returns false.
Instead, use QWidget::isVisibleTo, passing the scroll area, as that
tells us if the scrollbar's visibility is relevant for the layout of the
scroll area.
Add a test case for QAbstractScrollArea, verifying that the scrollbar's
size is correctly taken into account when calculating the size hint.
This change revealed an instability in the tests introduced in the
earlier commit: the layout process is asynchronous, requiring event
processing to update the visibility of the scrollbars. Add a call to
processEvents before storing the reference size hint. Also, explicitly
set a style that doesn't use transient scrollbars as otherwise we cannot
control when the scrollbars are shown.
The chagne also revealed an inaccuracy in the QListView test, which
only passed because the width of the vertical scrollbar was included.
We cannot use font metrics results to compare expected width, as the
item delegate's text rendering uses text layouts.
Task-number: QTBUG-69120
Fixes: QTBUG-109326
Fixes: QTBUG-113552
Pick-to: 6.6 6.5
Change-Id: I1f06f9e88046a77722291ac17c56090f8dff7cf3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
QXmlStreamReader accepted multiple DOCTYPE elements, containing DTD
fragments in the XML prolog, and in the XML body.
Well-formed but invalid XML files - with multiple DTD fragments in
prolog and body, combined with recursive entity expansions - have
caused infinite loops in QXmlStreamReader.
This patch implements a token check in QXmlStreamReader.
A stream is allowed to start with an XML prolog. StartDocument
and DOCTYPE elements are only allowed in this prolog, which
may also contain ProcessingInstruction and Comment elements.
As soon as anything else is seen, the prolog ends.
After that, the prolog-specific elements are treated as unexpected.
Furthermore, the prolog can contain at most one DOCTYPE element.
Update the documentation to reflect the new behavior.
Add an autotest that checks the new error cases are correctly detected,
and no error is raised for legitimate input.
The original OSS-Fuzz files (see bug reports) are not included in this
patch for file size reasons. They have been tested manually. Each of
them has more than one DOCTYPE element, causing infinite loops in
recursive entity expansions. The newly implemented functionality
detects those invalid DTD fragments. By raising an error, it aborts
stream reading before an infinite loop occurs.
Thanks to OSS-Fuzz for finding this.
Fixes: QTBUG-92113
Fixes: QTBUG-95188
Pick-to: 6.6 6.5 6.2 5.15
Change-Id: I0a082b9188b2eee50b396c4d5b1c9e1fd237bbdd
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
It's a bit cumbersome, but works, in principle, using CTAD.
Pick-to: 6.6 6.5 6.2
Task-number: QTBUG-114200
Change-Id: Ib7354180e870a695a978edabf684aedfcf9d9ecc
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This reverts commit c2a92199b57b195176d2a0d68d140d72c1cbfb71
"QLibrary::setFileNameAndVersion: reset the tag after findOrCreate".
This restores the behavior of resolve() and compatibility with Qt 4 and
5, which is documented to imply a call to load().
Do note that if you call load() or resolve() and don't call unload(),
the library you've loaded can never be unloaded now. So don't leak!
[ChangeLog][Important Behavior Changes] QLibrary::isLoaded() now reports
whether this instance of QLibrary has succeeded in loading the library,
via direct or indirect call to load(). Previously, it used to reported
whether the actual library was loaded by any QLibrary instance.
The change to QLibrary::resolve() itself is effectively a no-op in this
patch, because isLoaded() would have returned false, but it ensures that
the implementation does what it says it will do.
Fixes: QTBUG-114977
Pick-to: 6.6
Change-Id: I907aa7aea8ef48469498fffd176d7a76ae73e04a
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
We are gradually enabling more tests for WebAssembly platform
for better test coverage.
Long linking time is no longer an issue due to test batching.
Change-Id: I7ee9f877ecda726bc23d8dd2507c616bb381ebc1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
The test hasn't failed on Windows for a long time, but regularly fails
on macOS in CI, so replace the entry accordingly.
Task-number: QTBUG-115154
Pick-to: 6.6
Change-Id: Ib89d15cb9edafad5dd71f6e3f830d03aaeb16331
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Its single parameter is a pointer that defaults null, so don't bother
passing nullptr, much less 0, as it.
Change-Id: Iec68bf388d848c020359001699c971e12266a335
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Previously only toDateTime() was tested. Adding a test-case for
toTime() provoked adding full testing for both it and toDate(), based
on toDateTime() tests.
Pick-to: 6.6 6.5
Task-number: QTBUG-114909
Change-Id: I5c24b3869b3deefc36a7125133822e8f41cd24ba
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
As happens for other widgets
(s. QAccessibleWidget::parentObject), report the app
as accessible parent for item views that don't
have another parent set.
Otherwise, the accessible tree is broken when
there's a top-level item view:
The application has the item view as a child,
but the child does not have any parent set.
Extend a QListView autotest accordingly.
Fixes: QTBUG-115135
Pick-to: 6.6 6.5
Change-Id: Ie06874681180a30fc6248dc98f80c4158d837278
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
onExit is called whenever the application exits, i.e.
when the app canvas should no longer be displayed and
the loader/embedder code should take some action.
Emscripten provides two callbacks which can be used
here:
- onExit, called when the app exits (but see EXIT_RUNTIME)
- onAbort, called on abort errors.
These map to the two cases Qt's onExit supports. onExit
is not called when EXIT_RUNTIME is disabled, which means
we don't need the special case for exit code 0.
In addition call onExit on any exception. The second
call to showUi() in html_shell.html is then not needed
any more and we avoid duplicating the UI state handling
in user code.
Update the qtloader_integration test to handle changes in
behavior (we no longer set the error text on exit). Use
emscripten_force_exit() to simulate application exit -
using this function makes Emscripten call onExit even
when EXIT_RUNTIME is disabled.
Pick-to: 6.6
Change-Id: I72b5463c1836e8d5054e594abbd304fbc67032b7
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
This is done as one of the last steps inside QProcess itself, so the
child modifier and all other tasks still run with the parent process'
permissions. On Linux, setting the UID to non-zero will also
automatically clear the effective capabilities(7) set.
This feature is only useful for setuid or setgid applications, so this
commit updates the QCoreApplication::setSetuidAllowed() documentation to
mention the QProcess flag.
Change-Id: I3e3bfef633af4130a03afffd175e940c0668d244
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Doing setsid() and disconnecting from the controlling terminal are, in
addition to resetting the standard file descriptors to /dev/null, a
common task that daemons do. These options allow a QProcess to force a
child to be a daemon.
QProcess ensures that the operations are done in the correct order.
Change-Id: I3e3bfef633af4130a03afffd175e9451d2716d7a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The QProcessunixProcessParameters sometimes fails in CI with an XPASS.
Unclear under what conditions QNX behaves correctly, so accept that it
is unpredictable and only expect a failure when a failure is imminent.
Amends f9c87cfd44.
Change-Id: Icf70861343747e6323c7953a2462b7bbc46549b3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Spin the event loop with QTRY_VERIFY when checking the dialog box's
focus widget, to stop flaking.
Pick-to: 6.6 6.5
Change-Id: I24fab1264796e05645da4c12e4672daec9b06067
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
SQLite does not provide a proper case folding for non-ascii characters
due to a lack of a proper ICU library. Therefore add an option so Qt can
do it for SQLite.
[ChangeLog][SQL][SQLite] Add new option
QSQLITE_ENABLE_NON_ASCII_CASE_FOLDING for correct case folding of
non-ascii characters.
Fixes: QTBUG-18871
Change-Id: Ib62fedf750f05e50a581604253cf30d81e367b42
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Testcase appearsAndSort failed when running the complete testcase but
not as single test. More irritating was the fact that the error was in
QAbstractItemModelTester::headerDataChanged() but the affected test did
not change any header nor does it use the blamed model...
The reason for this is, that QAbstractProxyModel emits a queued
headerDataChanged signal when the header item count changes and
therefore only evaluated when the event loop is run.
Fix it by calling processEvents() after the rowCount change in
filterColumns().
Amends 72e802f3b0
Pick-to: 6.6 6.5
Change-Id: I10cb5aa9c40a6925113cc9c23616774bf15784a4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
a611a9f537 (in Qt 5) added support for
mixed-type comparisons through QCOMPARE. That commit added a new
overload for qCompare taking two types, T1 and T2; but it also left the
same-type qCompare(T, T) overload around, guarded by a Qt 6 version
check.
The mixed-type version is however not a generalization of the same-type
one, because it won't work if one of the arguments doesn't participate
in FTAD. Case in point: braced-init-lists. In Qt 5 this worked:
QCOMPARE(some_container, {42});
but in Qt 6 it does not work any more. The mixed-type overload fails
deduction (can't deduce T2); in Qt 5 the same-type overload deduced
T=SomeContainer, and {42} was used to select a constructor for
SomeContainer.
--
There's a partial, straightforward workaround for this: default T2 to
T1 in the mized-type overload. In that case T2 has a "fallback" if it
cannot be deduced. This is partial because of course doesn't address
the case in which T1 cannot be deduced, but I don't think that is
common at all.
QList is special here, because it has qCompare overloads that makes it
comparable with arrays, initializer lists and more. I don't like that
very much -- we should probably have a qCompare(input_range,
input_range) overload, but that's an exercise for C++20.
Change-Id: I344ba33167829984978cd8d649a1904349a9edab
Pick-to: 6.5 6.6
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Replace D-BUS with correct splling D-Bus in the source code,
Keep the old spelling inside XML DTD declarations for compatibility.
Change-Id: Ifa5d43f9fa1417431c81cf1bce0d897a966409b9
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>