summaryrefslogtreecommitdiffstats
path: root/tests/auto
Commit message (Collapse)AuthorAgeFilesLines
* QFileSystemEngine/Unix: avoid removing WasDeletedFlagThiago Macieira13 hours2-0/+61
| | | | | | | | | | | | | As the comment says, the flag can only come from a prior call that used fstat() on the file descriptor, so don't remove it when we couldn't have added it in the first place. Pick-to: 6.10 6.9 6.8 Fixes: QTBUG-137438 Change-Id: Ia75e29d28665c334dea6fffdb498a99c416bc3ac Reviewed-by: Lars Schmertmann <[email protected]> Reviewed-by: Ahmad Samir <[email protected]> Reviewed-by: Edward Welbourne <[email protected]>
* QUrl: use QHashCombine so we use the faster & stronger QString hashingThiago Macieira13 hours1-0/+4
| | | | | | | | | | | | | | | | We were only using the seed for hashing the port number, which is the weakest of all the uses of the seed, resulting in a weak hash for the QUrl itself. This commit changes it so QString components of the URL are themselves also hashed using the seed. As a side benefit, the aeshash() implementation in qhash.cpp where supported (ARM and x86) is faster than the siphash() one because it's vectorized. We're retaining the qHash(QUrl(), seed) == hashing of -1, but it's not qHash(-1, seed) because QHashCombine adds a constant. Pick-to: 6.10 Change-Id: If6466d054fd5a4f05205fffdfbc7b655eae5aefb Reviewed-by: David Faure <[email protected]>
* QAtomicScopedValueRollback: fix CTAD with with mixed (atomic<T>, V) argumentsMarc Mutz13 hours1-0/+89
| | | | | | | | | | | | | | [ChangeLog][QtCore][QAtomicScopedValueRollback] Added support for class template argument deduction (CTAD) when the type of the atomic and the type of the new value differ, e.g. as in `atomic<chrono::milliseconds> a; `QAtomicScopedValueRollback rb(a, 10s)`. Reported-by: Mitch Curtis <[email protected]> Pick-to: 6.10 Change-Id: I0472f0852f9fe8ad4c2ca41e14cc64e3aba7da74 Reviewed-by: Rym Bouabid <[email protected]> Reviewed-by: Thiago Macieira <[email protected]>
* QMetaObjectBuilder: Support setting the required flagFabian Kosmale14 hours1-1/+5
| | | | | | | | | | | | This is needed to properly represent QML defined properties in the QMetaObject. As a drive-by, do the sanity check in tst_metaobjectbuilder not only for required, but also for the bindable flag. Task-number: QTBUG-98846 Change-Id: I8ea894a589ec91a67fcbdb90ae35a4a0faedc662 Reviewed-by: Thiago Macieira <[email protected]>
* tst_qlocale: Add timezone abbreviation for EmscriptenPiotr Wiercinski14 hours1-2/+4
| | | | | | Change-Id: I77f9a0e52b6f3ee62a41b24feb55b24cae7b5254 Reviewed-by: Thiago Macieira <[email protected]> Reviewed-by: Edward Welbourne <[email protected]>
* QQuaternion: long live Axes / toAxes()Marc Mutz17 hours1-10/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Compilers hate out parameters, so provide a replacement for getAxes(), toAxes(), that returns the result in a struct Axes { x, y, z } instead. Then make getAxes() an inline wrapper around a toAxes() call, porting from Q_ASSERT(x && y && z) to Q_PRE(x); Q_PRE(y); Q_PRE(z); as a drive-by. The separation gives a more detailed error when triggered, and produces a shorter assertion string. Add tests, naturally, and port getAxes() calls that don't test getAxes() to the new function. There appear to be no other in-tree users that could be ported. For symmetry reasons, also add a fromAxes(Axes) overload. Take the argument by value, to avoid the compiler having to deal with aliasing analysis. At worst, pass-by-value is like pass-by-cref, and whether or not the extra copy is added or, since C++17, elided, depends on the specific call. Suppress Clazy's schizophrenic warning, which complains that we don't take (QVector3D, QVector3D, QVector3D) by value, but also if we take struct {QVector x,y,z} by value. [ChangeLog][QtGui][QQuaternion] Added toAxes(), a getAxes() replacement. Task-number: QTBUG-138199 Change-Id: Ie26e16528dc06806e59e54eff2d656a33c322bad Reviewed-by: Volker Hilsheimer <[email protected]>
* wasm: Re-enable tst_QDir::mkdirOnSymlinkPiotr Wiercinski17 hours1-4/+1
| | | | | | Change-Id: Ia00cc5139f1fb06ff3abcfcb11a0cd570266e7c3 Reviewed-by: Even Oscar Andersen <[email protected]> Reviewed-by: Morten Johan Sørvig <[email protected]>
* Fail builds on Apple platforms with invalid Info.plistMaximilian Blochberger17 hours4-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Information property lists (Info.plist) files are part of application bundles on Apple platforms and contain basic information about the application, such as the name of the application's executable. The Info.plist file can have multiple formats, such as binary or XML. Makefiles generated by qmake convert Info.plist files to XML by default, so that variables in the Info.plist can be substituted with values defined by qmake, such as the name of the application's executable. This is important if users use external tools such as Xcode for modifying the Info.plist file, which may save it in binary format. To convert the formats, the plutil tool shipped with macOS (or the Xcode command-line tools) is used. The Unix tool sed is then used to actually substitute variables. If the Info.plist file is invalid, e.g., due to an invalid tag name, the plutil invocation fails. However, the converted plist is piped into sed for variable substitution. The plutil command will simply write an error message to standard out and return with a non-zero exit code. Due to the pipe chain, make will not fail and the error message will end up in the Info.plist in the built application bundle. The application bundle is then invalid as well, as vital information such as the name of the executable of the application is missing. The change ensures that the pipe chain fails, if plutil exits with a non-zero exit code. The issue was introduced with my solution for QTBUG-45357. Beforehand, Info.plists and mistakes therein were simply copied into the application bundle. [ChangeLog][qmake] Fail builds on Apple platforms if the Info.plist is invalid instead of generating corrupt application bundles. Pick-to: 6.5 6.9 6.10 Change-Id: Ibdb2a18e9bbf35a654af8534aa61188f8389c55a Reviewed-by: Joerg Bornemann <[email protected]> Reviewed-by: Tor Arne Vestbø <[email protected]>
* Fix flaky tst_QWindow::windowExposedAfterReparent on Ubuntu 24.04Frédéric Lefebvre19 hours2-3/+4
| | | | | | | | | | | | tst_QWindow::windowExposedAfterReparent is flaky on Ubuntu 24.04. The child qwindow being reparented is not correctly converted to a toplevel window by the window manager. Close the child qwindow before reparenting it. Fixes: QTBUG-129023 Change-Id: I9152e4cc3acd3ac757cb5e3b18669a07acd82e33 Reviewed-by: Axel Spoerl <[email protected]>
* Unblacklist tst_qapplication::touchEventPropagation on openSuSeFrédéric Lefebvre19 hours1-3/+0
| | | | | | | tst_QApplication::touchEventPropagation is no longer flaky on openSuSe Change-Id: I4064c70700a7569b007d3384db310f792a6c5e0d Reviewed-by: Axel Spoerl <[email protected]>
* Fix threewaycompare selftestIvan Solovev19 hours7-100/+100
| | | | | | | | | | | | | | Commit 395d23fbb3f4a03d4d10d6ff2337db5abf3fdc5f changed how the TestLib represents FP numbers, but didn't update the expected output for the threewaycompare test. Do it now. As a drive-by, explicitly use UTC timezone when generating QDateTime in tst_ThreeWayCompare::checkWeakComparison() to avoid the dependency on the server's local time zone. Pick-to: 6.10 Change-Id: I0da52285ee90a1b54c3ff586e276f69f88b19b3b Reviewed-by: Marc Mutz <[email protected]>
* QArrayData: fix potential UB in QBasicAtomic initializationMarc Mutz31 hours1-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Until C++17 (inclusive), a default-constructed std::atomic object can, officially, only be initialized with a call to std::atomic_init, for which QBasicAtomic doesn't have API. It is even unclear whether zero-initialization of static and thread-local objects will cause the object to be initialized. Seeing as we can't rely on malloc's zero-initialization to properly initialize std::atomic objects (and therefore QBasicAtomic ones), and because it's the right thing to do, from a [basic.life] POV, anyway, port to placement new instead. The realloc() feels fishy, seeing as it reallocs a struct that contains an atomic variable (which we don't mark as Q_RELOCATABLE_TYPE even for our own types), but assume that part it ok, and in-place construct only if realloc() was passed nullptr (so is equivalen to malloc()). A final solution for this can probably only be implemented when we can depend on C++20's atomic_ref, which decouples the underlying object from the atomic operations performed on it. Rename the ref_ member to m_ref to catch any uses of the variable, incl. since removed ones in older branches. Amends 812a611dc05e5facd036856625ccb9274fdcb117 (which ported from QtPrivate::RefCount to QBasicAtomicInt; I didn't check whether QtPrivate::RefCount had a similar problem, because that commit is already much older than what I can pick back to at this point). Task-number: QTBUG-137465 Pick-to: 6.10 6.9 6.8 6.5 Change-Id: I188e05d09e20e0820af7cf1cbb651afa860bb9d6 Reviewed-by: Thiago Macieira <[email protected]>
* QRangeModel: consistently call roleNames() through the vtableVolker Hilsheimer33 hours1-0/+40
| | | | | | | | | | | | Calling the implementation of roleNames() directly breaks overrides, as we get inconsistent results. Add a testcase that verifies that we can call setData and itemData on a list of QObject subclasses. Pick-to: 6.10 Change-Id: Ia4fc7859bf9136a6c3452e1317a856c790916315 Reviewed-by: Fabian Kosmale <[email protected]>
* Restore testing of correct fall-back handling for unsupported localesEdward Welbourne38 hours1-3/+7
| | | | | | | | | | | | | | | Amends commit eca1e634b657e1e27adc863d196027406b12b00c - the update to CLDR v47 added data for en-FR, where previously en-FR was used to test we correctly converted that according to likely subtag rules to en-US. The initial update simply changed the expected results, thereby losing the testing that we fall back correctly when asked for an unsupported combination. Added tests for ar-US to restore testing of fall-backs. Pick-to: 6.10 6.9 6.8 Task-number: QTBUG-137782 Change-Id: I13e7a4729da5f65a7b3019da6fcfa3d195191097 Reviewed-by: Mate Barany <[email protected]> Reviewed-by: Ivan Solovev <[email protected]>
* tst_QPointer: add checks involving multiple inheritanceMarc Mutz43 hours1-0/+38
| | | | | | | | | | | | Add a check that we can compare QObjects implementing interfaces to said interface. We can. Pick-to: 6.10 6.9 6.8 6.5 Task-number: QTBUG-135626 Change-Id: I0e1164b43d9112e051add2c034dea50ab5192b2d Reviewed-by: Ivan Solovev <[email protected]>
* tst_selftest: skip benchlibcallgrind for asan buildsMarc Mutz2 days1-1/+8
| | | | | | | | | | | | | | | Valgrind and asan are incompatible. Says Valgrind: ==1602116==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD. Fix by excluding the test from asan builds. Amends the addition of -sanitize options; didn't look it up, since it was certainly before Qt 6.0. Pick-to: 6.10 6.9 6.9 6.5 Change-Id: I4c9922323c4e9457a6d721ca594652da6a0a55fb Reviewed-by: Alexey Edelev <[email protected]>
* QMetaObject::normalizedType: handle nullptrIvan Solovev3 days1-1/+12
| | | | | | | | | | | | | | | | The type normalization code was crashing when passing a nullptr. Fix it by explicitly checking the begin == end case in QTypeNormalizer code. Modify the test code to make the difference between a nullptr and an empty string obvious, and add test-casees to cover these corner cases. Amends 4dbac23e5354638224d8d99ba3342067c015a04b which was added for Qt 6.0, so pick to all active Qt 6 branches. Pick-to: 6.10 6.9 6.8 6.5 Change-Id: I0f6855d19146f18170c34061f0631f9192df8bad Reviewed-by: Ahmad Samir <[email protected]>
* moc: add line numbers to properties, methods, etcSami Shalayel4 days2-0/+204
| | | | | | | | | | Those are needed by qmlls to be able to jump to C++ definitions. Task-number: QTBUG-119143 Task-number: QTBUG-128393 Change-Id: I4fb9394b0a22a02501bafdbe95a7cd8998adfe11 Reviewed-by: Ulf Hermann <[email protected]> Reviewed-by: Fabian Kosmale <[email protected]>
* tst_moc: add missing dependency to mocSami Shalayel4 days1-0/+2
| | | | | | | | Add missing dependency to MOC such that the .json files are regenerated automatically when moc was modified. Change-Id: Ie874443b0c11cc7c7feefe1bc1a555c3bd135257 Reviewed-by: Fabian Kosmale <[email protected]>
* QAnyStringView: support single wchar_t arguments also on UnixMarc Mutz5 days3-5/+20
| | | | | | | | | | | | | | | | | | | | | | We support char32_t, so there's no reason to not support a 4-byte-wchar_t. This also fixes a nasty asymmery between QString::arg(L'ä') (integral output) and QL1SV::arg(L'ä') or QString::arg(L'ä', L'ä') (characters) [ChangeLog][Important Behavior Changes][QtCore][QString] The unary arg() function now treats wchar_t as a character (string-like; was: integer), so u"%1".arg(L'ø') will now return "ø" and not '248". This makes the function consistent with both QString multi-arg() and QLatin1StringView::arg(). [ChangeLog][QtCore][QAnyStringView] Supports construction from a single wchar_t on all platforms now (was: only on Windows). Fixes: QTBUG-126054 Pick-to: 6.10 Change-Id: I21b7a9782f03d04686207db30d1b1c9d50bc8169 Reviewed-by: Thiago Macieira <[email protected]>
* Add missing qquaternion.h includesMarc Mutz5 days1-0/+2
| | | | | | | | | | | | | | | | | | | The qquaternion.h include will vanish from qmatrix4x4.h soon, but some TUs depended on on the transitive include. This patch includes qquaternion.h into all TUs that use QQuaternion, but didn't include its header. I didn't check all the individual TU's history to make a detailed "amends", so I'll just pick this all the way back, knowing there may have been more users in older branches, or some TUs don't exist there, but it since we're not picking the removal of qquaternion.h from qmatrix4x4.h further than 6.10, I don't need to do detailed checking. CI will tell me when something's wrong. Pick-to: 6.10 6.9 6.8 6.5 Change-Id: Icf0db8ba4f12421fd46f9d1041f235bf4cc2c12b Reviewed-by: Volker Hilsheimer <[email protected]>
* QIdentityProxyModel: call data() from subclasses in match()David Faure5 days1-0/+34
| | | | | | | | | | | | | | | The implementation of match() was only looking into the source model, without considering the fact that data() could be reimplemented in a QIdentityProxyModel subclass (a very common usage pattern for the class, part of the documentation). The simplest solution is to let the default implementation from QAbstractItemModel do matching the usual way, calling data(). Fixes: QTBUG-78013 Pick-to: 6.10 6.9 6.8 Change-Id: If984ffa5f8dbdfe9a76eaec8b82648d705cfecd4 Reviewed-by: Volker Hilsheimer <[email protected]>
* Replace one-shot uses of QSemaphore with QLatchThiago Macieira5 days1-5/+5
| | | | | | | | | | | | | | | This commit replaces one-shot synchronization of threads that were using QSemaphore with QLatch. QSemaphore is efficient on Linux and Windows, but allocates memory elsewhere. Even on those platforms where we have futex-like OS support, QSemaphore is heavier than what we really need here. All but one uses of QSemaphore in qtbase libraries (I didn't change examples or tests) were replaced. The remaining use of QSemaphore in qnetworkproxy_libproxy.cpp is a proper producer-consumer. Change-Id: Ib5ce7a497e034ebabb2cfffd1761a4fcb2be9a6c Reviewed-by: Volker Hilsheimer <[email protected]>
* tst_QQuaternion: fix spelling of 'expected'Marc Mutz5 days1-7/+8
| | | | | | | | | | | | | | | | | | As a drive-by: - replace direct by copy initialization and reflow the line with the ternary - make objects const - don't compute the cross product twice; it's anti-commutative, so if a × b is 0, then so is b × a = -(a × b). Amends 95d034a14f78aaefd6990de180f715c8b4d510b1. Pick-to: 6.10 6.9 6.8 6.5 Change-Id: I4dc4582854b3d93a6e3468e8b19afe28d77c6c1c Reviewed-by: Volker Hilsheimer <[email protected]>
* Android: update to Gradle 8.14.2 and AGP 8.10.1Assam Boudjelthia7 days1-1/+1
| | | | | | | | | | | | | Update to latest versions for Gradle: * Gradle 8.12 -> 8.14.0 * Android Gradle Plugin 8.8.0 -> 8.10.1. [ChangeLog][Third-Party Code] Updated Gradle to 8.14.1 and AGP to 8.10.1. Task-number: QTBUG-137782 Change-Id: Ifbc808e18412f6e2e45612612d36a1f9bf57c1a9 Reviewed-by: Ville Voutilainen <[email protected]>
* Replace `QT_NO_CREATE_TARGETS` with an automated and scoped logicCristian Le7 days1-6/+0
| | | | | | | | | | Effectively check if we are importing while still building the current project Task-number: QTBUG-135233 Change-Id: If172617463157e84e1b16fc2354147fabae41084 Reviewed-by: Alexandru Croitor <[email protected]> Reviewed-by: Alexey Edelev <[email protected]>
* Long live QLatchThiago Macieira8 days3-0/+289
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Like std::latch[1][2]. Originally proposed by N3666, it only became a reality after the atomic wait functionality in C++20. We can't depend on that yet in Qt because a) we don't depend on C++20 yet, and b) the implementations of atomic waiting and std::latch are too recent in the Standard Library implementations (GCC 12, LLVM 12, MSVC 19.28). This implementation therefore builds the functionality from scratch, like the original proposal did[3]. We'll probably keep our implementation for the long run, because it's more efficient than the Standard Libraries' implementations. The MS STL implementation is the closest to ours and to bare OS functionality: uses WaitOnAddress / WakeByAddress as expected, but it generates a bit more code than is necessary. And it's Windows-specific, of course. Both cross-platform implementations (libstdc++ and libc++) do far more work than necessary for platforms that offer a OS futex-like support. Both of them busy-loop waiting for the atomic value to change and then exponentially back off using sched_yield(). Those aren't useful to us, as the majority of our uses are with threads that have just been created and have therefore likely made little progress. They can be actively harmful in some cases. The libc++ implementation is even worse by using std::high_resolution_clock to time this looping up to 64 µs in inline code before making a system call to sleep and wait (and it can't / won't use the latch's address for the futex itself). Both implementations also use an extra atomic out of a global pool (16 in libstdc++, 256 in libc++) to indicate whether there is any waiter on this address and therefore avoid the system call to wake them. See the next commit for an efficient implementation for QLatch. This implementation uses the limited atomic-wait functionality added by the previous commit for platforms that don't support futexes. [1] https://wg21.link/p1135 [2] https://en.cppreference.com/w/cpp/thread/latch/latch [3] https://github.com/ogiroux/atomic_wait/tree/master/include Change-Id: Ib5ce7a497e034ebabb2cfffd1761a3a6ff2598d3 Reviewed-by: Mårten Nordheim <[email protected]> Reviewed-by: Fabian Kosmale <[email protected]>
* Short live q20::atomic_wait!Thiago Macieira8 days3-0/+322
| | | | | | | | | | | | | | | | | | | atomic_wait() and atomic_notify_{one,all}() are available in C++20, which we can't depend on right now. So we implement our own fallback implementation. This is a simple implementation for systems which don't have either futexes or the C++20 atomic wait API. That means it's not very efficient, just simple. The unit test tests the fallback implementation only: it is not Qt's business to test the Standard Library. The fallback implementation and the Standard Library's are not binary-compatible and cannot be mixed. Callers must ensure that all sides use the same implementation and the easiest way to do that is to only use this in non-inline code, or at worst inline code that isn't shared across libraries/modules/plugins. Change-Id: Ib5ce7a497e034ebabb2cfffd1761a0e497dd17d4 Reviewed-by: Mårten Nordheim <[email protected]>
* tst_QNetworkInterface: fix localAddress() for point-to-point connectionsThiago Macieira9 days1-4/+9
| | | | | | | | | | | | | | | | | | When the IPv4 netmask is 255.255.255.255 (point-to-point interface), we were calculating our own local IP. That meant we would route through the loopback interface to connect to it, not the interface, resulting in test failures. So just flip one bit and hope that it will work. FAIL! : tst_QNetworkInterface::localAddress(vpn0-10.124.222.242) The computed value is expected to be less than or equal to the baseline, but is not Computed (pmtu) : 65535 Baseline (outgoingIface->maximumTransmissionUnit()): 1422 $ ip r get 10.124.222.242 local 10.124.222.242 dev lo table local src 10.124.222.242 uid 1000 Pick-to: 6.10 6.9 6.8 Change-Id: I3d18ad117dd0c49fcec2fffdcb29534e64a438d9 Reviewed-by: Mårten Nordheim <[email protected]>
* moc: disable name clash bug for faulty MSVC verisonsFabian Kosmale9 days3-69/+19
| | | | | | | | | | | | | | | | | We still want to test the code on non-affected MSVC versions, so we - remove the header from the manual qt_wrap_cpp call, - instead, let automoc pick it up by making it part of the target, - include the moc file to prevent CMake putting the generated file in the combined C++ file, - but include it only conditionally to avoid the compilation issue on MSVC. This has the side effect that we no longer consider the file in the JSON output, but that is less important. Pick-to: 6.10 6.9 Change-Id: I46d93aac9721eba081221586b66a3742c863da90 Reviewed-by: Oliver Wolff <[email protected]>
* Add test collection for `find_package`Cristian Le10 days5-0/+29
| | | | | Change-Id: I78e339762206e0bb3408c55b09f0dba08dae22c9 Reviewed-by: Alexandru Croitor <[email protected]>
* no-thread: enable using QFutureMorten Sørvig11 days2-3/+46
| | | | | | | | | | | | | | | | | | | | | | | | Enable using QFuture for handling async tasks, which is a use case which can work also for the no-thread configuration. Add implementation files and headers for the QFuture dependencies to the no-thread build. These files build, but as with no-thread QThread there is no guarantee that they will do anything useful. Stub out some more functions in QThread, and also add stubs for no-op QSemaphore. Enable the tst_qfuture test and skip tests which require threads. tst_qfuture now runs with: Totals: 70 passed, 0 failed, 13 skipped, 0 blacklisted, 6373ms Pick-to: 6.10 Change-Id: Icd82590915d6034ae7829ead3fb4ebaf1e9c2aad Reviewed-by: Tim Blechmann <[email protected]> Reviewed-by: Artem Dyomin <[email protected]>
* tests: fix a typo in tst_QWindow::touchInterruptedByPopup()Liang Qi11 days1-1/+1
| | | | | | Pick-to: 6.10 6.9 6.8 Change-Id: I6d846c7bfdaa6034994057725dd65c7ab75c9273 Reviewed-by: Shawn Rutledge <[email protected]>
* Wayland: skip tst_QWindow::touchInterruptedByPopup()Liang Qi11 days1-0/+6
| | | | | | | | | | | | | | | | | | | | and touchToMouseTranslationByPopup() Compositor will dismiss the request if we just use mInputDevices in the setGrabPopup() call in QWaylandXdgSurface::QWaylandXdgSurface(). We don't have a solution to fake it without hacking compositor. See also https://wayland.app/protocols/xdg-shell#xdg_popup:request:grab This request must be used in response to some sort of user action like a button press, key press, or touch down event. The serial number of the event should be passed as 'serial'. Pick-to: 6.10 Task-number: QTBUG-137020 Change-Id: I8c78fa8cc269125a4de56625433e313d5767b17d Reviewed-by: David Edmundson <[email protected]>
* tst_QMetaObject: add some more signature normalization testsAhmad Samir11 days1-0/+22
| | | | | | | | | | | | | | | | Add tests with nested template args. Add tests for empty and null signatures, requested in code review. Add a test for `char * const *` to verify that QTypeNormalizer::normalizeType() normalizes it as expected. Add a test for explicit void argument inside a template, suggested by Fabian in code review. Pick-to: 6.10 Change-Id: I040135355702e9c11d00a8685c274894dc46d848 Reviewed-by: Ivan Solovev <[email protected]>
* Update public suffix listMårten Nordheim11 days1-0/+0
| | | | | | | | | | | | Version 2025-06-16_09-45-02_UTC. [ChangeLog][Third-Party Code] Updated the public suffix list to upstream version 2025-06-16_09-45-02_UTC. Pick-to: 6.10 6.9 6.8 6.5 5.15 Task-number: QTBUG-137782 Change-Id: I8f4b430d5d01f73e9cc27ce6947d1fc595a97848 Reviewed-by: Alexandru Croitor <[email protected]>
* tests: skip tst_QWindow::modalWithChildWindow() on WaylandLiang Qi13 days1-0/+3
| | | | | | | | | | A nested window or a subsurface in wayland terms can't get focus. See also 0bd68fac97f4967f39715bf221f246c85371f3bf . Pick-to: 6.10 Task-number: QTBUG-137020 Change-Id: I563b8cfab84c136fa2a1e82f9feecafafc63d4a5 Reviewed-by: Tor Arne Vestbø <[email protected]>
* QByteArray: replace(view, view): don't detach the underlying data arrayAhmad Samir14 days1-6/+141
| | | | | | | | | | | | | | | | | | | | | | If the byte array would detach or reallocate it would copy the data over, then do the replacements; instead create a new byte array and copy the data and replacement to it as needed, then swap it with `this`. Use QVLA to hold the indices of the replacement locations into the byte array, this way we can do the replacements in one go, instead of chunks of 4096. Since we collect the indices, now there is no need to guard against `before` being part of `this`. Use qsizetype instead of size_t, so as not to convert from/to each other. Using an unsigned type to avoid negative values doesn't work, indices[size_t(-1)] could be out of bounds anyway. Task-number: QTBUG-133737 Task-number: QTBUG-106185 Change-Id: I8fe87d56227e3c4b2b39b7625659eb61c6b174d1 Reviewed-by: Thiago Macieira <[email protected]>
* Fix flaky tst_QProgressBar::setMinMaxRepaint on openSuSE and UbuntuFrédéric Lefebvre14 days1-1/+7
| | | | | | | | | | Set a fixed size to the progressbar and verify it before testing minimum and maximum repaint. Remove setActiveWindow as this anti-pattern is no longer necessary for Linux environments. Remove flakiness on openSuSE 15.6 and Ubuntu 24.04 Change-Id: I7b0deea5964abbebe31c24d98cacaf7336e82157 Reviewed-by: Axel Spoerl <[email protected]>
* Update TIKA mimetypes from upstreamDavid Faure2025-06-191-1/+1
| | | | | | | | | [ChangeLog][Third-Party Code] Updated TIKA mimetypes from upstream Pick-to: 6.10 Task-number: QTBUG-137782 Change-Id: Ic8437e94eaf334feb5c4896bc2ceccb162e2fb16 Reviewed-by: Mårten Nordheim <[email protected]>
* QByteArray: replace: add tests for `after` pointing into thisAhmad Samir2025-06-191-0/+48
| | | | | | | | Also `before` points into this. Pick-to: 6.10 6.9 6.8 Change-Id: I0d1aa522e96c046ea26fc0948546e0625c1a83e7 Reviewed-by: Ivan Solovev <[email protected]>
* Android: auto-tests: Add missing lib to tst_qapplication Android apkKonsta Alajärvi2025-06-193-4/+20
| | | | | | | | | | | | | | | | | | | | | | | | | tst_qapplication is missing the modal_helper executable from the apk. Set the libmodal_helper.so as a target property for the tst_qapplication with QT_ANDROID_EXTRA_LIBS property. Change the name of qtbug_12673() test function to modalDialog(), I think this better represents what's being tested. The bug ticket representing qtbug_12673() can be found from the ticket linked to this commit. Construct a full path to the modal_helper.so and pass that to QProcess.start instead of relative path to filename when targeting Android. Add a shared utility function androidAbi() that returns the currently defined Android ABI. Change the function name in BLACKLIST file. Task-number: QTQAINFRA-6908 Pick-to: 6.8 6.9 6.10 Change-Id: I13904acda0f5608ea31df49bd95824e1412f2786 Reviewed-by: Assam Boudjelthia <[email protected]>
* Update CLDR to v47Mårten Nordheim2025-06-191-11/+11
| | | | | | | | | | | | | | Some of the changes required updating the tests. Like spanish separators and (English,France) now returning France instead of United States for territory. [ChangeLog][Third-Party Code] Updated CLDR data, used by QLocale, to v47. Pick-to: 6.10 6.9 6.8 Task-number: QTBUG-137782 Change-Id: Ic939666b9718d59ab28c51f65ac38cf84b97bf93 Reviewed-by: Ivan Solovev <[email protected]>
* QUrl: ensure setUrl() / operator=() erase any previous stateThiago Macieira2025-06-191-3/+54
| | | | | | | | | | | | | | | | | | | | | | QUrlPrivate::parse() did not clear all the state because it was designed for parsing from the QUrl constructor. The few conditions under which it retained some memory weren't obvious and weren't tested anywhere (it was the fragment and query). This will shed memory from the QStrings if we were the last reference, only to allocate again. There is some value in attempting to reuse their buffers by doing resize(0) and then appending in qt_urlRecode(), but that introduces complexity I didn't want to deal with. This incidentally fixes the qHash() inequalities too. Changelog in the previous commit. Pick-to: 6.10 6.9 6.8 6.5 Fixes: QTBUG-134896 Fixes: QTBUG-134900 Change-Id: I1885d0750ac1109aab61fffdbf7fad775706e61f Reviewed-by: David Faure <[email protected]>
* QUrl: fix comparisons of URLs with password but no explicit usernameThiago Macieira2025-06-191-0/+11
| | | | | | | | | | | | | | | | | | When a URL like "http://:[email protected]" is parsed, we will set the username field to "present", but if you parse "http://example.com" and then set the password, the field would still be marked as absent. This commit fixes that, while restoring its absence if the password is later removed. [ChangeLog][QtCore][QUrl] Fixed a number of bugs in QUrl where a URL modified using the setXxx() functions would fail to compare equal to itself after going through toString() and setUrl() round-trip. Pick-to: 6.10 6.9 6.8 6.5 Task-number: QTBUG-134900 Task-number: QTBUG-134896 Change-Id: I490cfd3d01260823ffdffffd4d9ac92dd42723b0 Reviewed-by: Ahmad Samir <[email protected]>
* tst_QShortcut: Test that modifier only shortcuts are not triggeredVlad Zahorodnii2025-06-181-0/+38
| | | | | | | | | | | | | | | | | | | | The QShortcutMap triggers shortcuts on key press. It's okay with normal shortcuts but modifier only shortcuts require extra care. Depending on the context, they can be triggered either on key press or key release. For example, for push to talk, they should be triggered on key press, but if a modifier only shortcut is assigned to a dashboard or something, then it should be triggered on key release so the dashboard is not accidentally opened when pressing another shortcut that starts with the same modifier. The QShortcutMap currently doesn't provide support for modifier only shortcuts. The proposed new test case verifies that a modifier only shortcut will not be accidentally triggered if there is a normal shortcut with the same modifier keys. Task-number: QTBUG-132435 Change-Id: I612d0239b29f8c1730016d10257def039b5e6cf1 Reviewed-by: Tor Arne Vestbø <[email protected]>
* QDBusMessage: add move-constructorIvan Solovev2025-06-181-0/+26
| | | | | | | | | | | | | | | | | | Since the class was not desigend to support a nullptr d_ptr, this change requires modifications in the destructor and copy-ctor. The change in destructor is straightforward - simply add a check that d_ptr is not null. The copy-constructor was using a qAtomicAssign() helper, which was relying on the fact that the passed pointers are not null, so we cannot use it anymore. Use copy-and-swap instead. The other methods do not require any changes, because the moved-from object can only be destroyed or assigned-to. [ChangeLog][QtDBus][QDBusMessage] Added move constructor. Change-Id: Ic8a0d913b9cf2f881369f7ad4f3a88c1f3fb345f Reviewed-by: Marc Mutz <[email protected]>
* QJsonObject/QCborMap: Add asKeyValueRange()Johannes Grunenberg2025-06-182-0/+217
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds {QJsonObject,QCborMap}::asKeyValueRange() which returns a range over key-value pairs of the object/map (`pair<QAnyStringView, QJsonValueRef>` and `pair<QCborValueConstRef, QCborValue>`). This uses QKeyValueIterator under the hood. QJsonObject's iterator only iterates over the items, so using it in a range-based for loop won't give users access to the key. With `asKeyValueRange` one can iterate over both keys and values and conveniently use structured bindings. QCborMap's iterator already iterates over key-value pairs, so `asKeyValueRange` is provided for API symmetry. In `QKeyValueIterator`, this adds a fourth template parameter `Traits` to support custom `key()` and `value()` functions. This is specifically needed for `QJsonObject`, as its actualy key is a string view, but `key()` returns a `QString`. [ChangeLog][QtCore][QJsonObject] Added asKeyValueRange to iterate with a range-based for loop over key-value pairs with support for structured bindings. [ChangeLog][QtCore][QCborMap] Added asKeyValueRange to iterate with a range-based for loop over key-value pairs with support for structured bindings. Pick-to: 6.10 Change-Id: I68d97fada8b2d7ef7224f1beb5aa685aac3d1b16 Reviewed-by: Thiago Macieira <[email protected]>
* QScopeGuard: add commit()Marc Mutz2025-06-182-3/+17
| | | | | | | | | | | | | This method executes the wrapped function ahead of destruction, and can alleviate the need to hold QScopeGuards in optional<>s to emulate the functionality. Port such a case in tst_QEventLoop as demonstration. [ChangeLog][QtCore][QScopeGuard] Added commit() method. Change-Id: Ie2674e1c82e242bdeb1eeaf183607e5c71c1448a Reviewed-by: Thiago Macieira <[email protected]>
* Test QDBusMessage move-assignment operatorIvan Solovev2025-06-183-0/+77
| | | | | | Pick-to: 6.10 6.9 6.8 6.5 Change-Id: Ic7fec96c13c1a1b8c4b748070fbe656fdff6e24c Reviewed-by: Marc Mutz <[email protected]>