summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Correct executable name in server-buffer testBernd Weimer2024-04-111-1/+1
| | | | | Change-Id: I9fb321000f4ac33f67fc79a88b20707af4504614 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Correct license for test filesLucie Gérard2024-04-04106-106/+106
| | | | | | | | | | | According to QUIP-18 [1], all test files should be LicenseRef-Qt-Commercial OR GPL-3.0-only [1]: https://contribute.qt-project.org/quips/18 Task-number: QTBUG-121787 Change-Id: I35b93ca5f2fd27685eda4aafda48c24925c0c56f Reviewed-by: Kai Köhne <kai.koehne@qt.io>
* client: Implement dialog-v1 protocolDavid Redondo2024-03-276-0/+150
| | | | | | | | Allows to mark windows as modal dialogs. Change-Id: Ie4999552933e02fc473e621e7cc5e3f2928c0adb Reviewed-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* De-blacklist tst_seatv4::animatedCursor testVolker Hilsheimer2024-02-281-3/+0
| | | | | | | | | | The test has no history of BFAIL outcomes for the last 6 months in the dev branch. Fixes: QTBUG-78317 Change-Id: I49742be9f3eac6463b066ede69e2cd143e1b35dd Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: David Edmundson <davidedmundson@kde.org>
* client: Fix xdg shell setting only a minimum size hintDavid Edmundson2024-02-201-9/+50
| | | | | | | | | | | | | | | An unbound maximum size is sent across the protocol as 0. We need to make this change before the check that the minimum size is less than the maximum size. This fixes having only a minimum size set. This bug is currently masked by the platform forcefully applying the minimum size. Pick-to: 6.6 Pick-to: 6.7 Change-Id: Ifca4fa01e4c2ac1c34aeb72db1584e4a868d50bc Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
* Mark the whole repo with QT_NO_CONTEXTLESS_CONNECTAhmad Samir2024-02-153-43/+41
| | | | | | | | | | | | | | | | | | | | By adding it to the default build flags via .cmake.conf. tst_primaryselectionv1 and tst_datadevicev1: the connection type needs to be explicitly set to DirectConnection, otherwise the test fails. The sender and receiver are the same object, so typically would be in the same thread. The docs say: "If the receiver lives in the thread that emits the signal, Qt::DirectConnection is used." I suspect because the code is running inside CoreCompositor::exec() the signaling thread is different from the thread the objects live in, so leaving the type as AutoConnection when sender/receiver are the same object doesn't lead to the type becoming DirectConnection. Task-number: QTBUG-116296 Change-Id: Iad49889134a78fa723973ba6efbc237038f35b82 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Client: Map Qt::BusyCursor and Qt::WaitCursor to correct shape namesVlad Zahorodnii2024-02-061-2/+2
| | | | | | | | | | | This amends b1cae06cb65658dcddf01a596ea95cfd7c0ebdc2. They are mapped vice versa. The wait cursor displays only an hourglass, while the busy cursor usually displays an arrow and an hourglass. Pick-to: 6.7 6.6 Change-Id: I449086f71b00993c061e8a56983c77925246dc37 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Add CMake autotestJoerg Bornemann2024-01-153-16/+10
| | | | | | | | Task-number: QTBUG-84884 Change-Id: I7be48ae60c1b08dee6e95b042b9c72d809a9f72f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* client: Clean up text input proxy object in textinputv2David Edmundson2023-12-211-2/+1
| | | | | | | | | | This not only cleans up a tiny amount of memory, but also fixes a potential crash if a wayland event were to arrive on the object after the Qt level wrapper is destroyed. Pick-to: 6.5 6.6 6.7 Change-Id: I6fafdd848d61da893304c4467a57b52d3771c508 Reviewed-by: Liang Qi <liang.qi@qt.io>
* tests: Only track one data offer during a dragDavid Edmundson2023-12-112-8/+5
| | | | | | | | | | | A drag consists of one data source which in turn will be represented by one data device sent to each client. We don't need to manage a list Change-Id: Icd2aba3ced1d8254d15400b0b687888b0872cc35 Pick-to: 6.7 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* QWaylandMimeData: Check text/x-moz-urls for UTF-16Kai Uwe Broulik2023-12-041-0/+42
| | | | | | | | | | | | And fall back to UTF-8 if it's not. When dragging a picture out of Chrome, it sends a simple URL as UTF-8 under text/x-moz-urls. QXcbMime has this fall-back, too but I originally didn't consider it necessary. Pick-to: 6.6 6.5 Change-Id: I52378cfc354de342623e5dd3f7e1d028951e8dab Reviewed-by: David Edmundson <davidedmundson@kde.org>
* CMake: replace PUBLIC_LIBRARIES with plain LIBRARIESEdward Welbourne2023-11-272-2/+2
| | | | | | | This silences a warning from qt_internal_add_test(). Change-Id: Ie1afaa5789a488ad3190061c782a5bfb9f3d103c Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Fix CMake config after move of example to manual testsEdward Welbourne2023-10-241-1/+1
| | | | | | | | | | Amends commit acb68bd3bbbc0001bcf460dd175ff92cc3ce594a to change its use of qt_internal_add_example() - appropriate where it came from, not where it was moved to - to plain add_subdirectory(). Pick-to: 6.6 6.5 Change-Id: Ie5ea13f8ba57154c0ae1fb44be9a327c88e3b4e2 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Include what you need: <QPointer>Marc Mutz2023-10-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | All these TUs relied on transitive includes of qpointer.h, maybe to a large extent via qevent.h, though, given that qevent.h is more or less the only public QtBase header that includes qpointer.h, something else seems to be at play here. Said qevent.h actually needs QPointer in-name-only, so a forward declaration would suffice. Prepare for qevent.h dropping the include. The algorithm I used was: If the TU mentions 'passiveGrabbers', the name of the QEvent function that returns QPointers, and the TU doesn't have qpointer.h included explicitly, include it. That may produce False Positives, but better safe than sorry. Otherwise, in src/, add an include to all source and header files which mention QPointer. Exception: if foo.h of a foo.cpp already includes it, don't include again. Task-number: QTBUG-117670 Change-Id: I8eb00fbd2df16300b0cbfc4157612a45c72ac12c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* client: Implement QWheelEvent::invertedDavid Edmundson2023-09-293-14/+35
| | | | | | | | | | | | | | | "Natural scrolling" is a setting that makes trackpads act in the inverse; moving up moves content down to mimic behavior of touchscreens. However not all scroll events are used for scrolling, so it can be useful to know the real direction. This was exposed in QWheelEvent it just needs plumbing. Change-Id: I050b8b3e55796beff33badb7c073c0b93589294e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
* client: support Xdg Shell not_shown stateDavid Edmundson2023-09-251-0/+33
| | | | | | | | | | | | | This state is to indicate that a toplevel is not visible, either minimised on another desktop. This maps to QWindow::isExposed. In addition to XdgShell changes. QWaylandWindow is adjusted to check exposure state before sendingExposureEvents. Subsurfaces are un-exposed and re-exposed when the toplevel changes. Change-Id: I76932c2c58681f832c1c2efde3cfde1c32cd3e05 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Fix use-after-free error in autotestPaul Olav Tvete2023-09-191-5/+4
| | | | | | | | | | | | | zwp_primary_selection_device_v1::destroy_func() uses the object after calling zwp_primary_selection_device_v1_destroy_resource(). This means that we cannot do "delete this" at that point. Instead delete all the devices in the destructor of PrimarySelectionDeviceManagerV1, which conveniently already has a list of selection devices. Fixes: QTBUG-117068 Change-Id: I7012f801ef11283d5b66cefbf5481e9f1394f1b8 Reviewed-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org> Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Autotest: don't access object that has gone out of scopePaul Olav Tvete2023-09-181-3/+4
| | | | | | Fixes: QTBUG-117069 Change-Id: Iafa603ce9b31eb66beebf18d62661c4daaf2632b Reviewed-by: David Edmundson <davidedmundson@kde.org>
* tests: Fix tst_xdgshell::minMaxSize()Vlad Zahorodnii2023-09-151-0/+2
| | | | | | | | | Amends e8cff6fb39c0fd01548bce18542820a6612dbe49. The new size hints will be committed when the surface is committed. Change-Id: I94e944fee7dac63d5e9ac86fb348b5d24d54abfc Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Client: Remove some surface commitsVlad Zahorodnii2023-08-291-0/+2
| | | | | | | | | | | | | | | The buffer transform, input and opaque regions are double buffered state. They will be applied on the next surface commit. But the issue with them is that the relevant code makes surface commits too. It's undesired as it can lead to qtwayland committing partial state, for example it can break xdg surface window geometry. This change removes hidden surface commits. The relevant properties will be applied on the next frame. Change-Id: I1c40c9a5430fb6b91d7643b20d628f8a9a9d501a Reviewed-by: David Edmundson <davidedmundson@kde.org>
* QWaylandInputDevice: Reset cursor surface state when using shape cursorKai Uwe Broulik2023-08-251-1/+15
| | | | | | | | | | | CursorSurface::update only calls set_cursor if the hotspot or serial has changed. Reset its state when using a shape cursor to ensure switching back to a cursor surface (e.g. when switching from a shape to a bitmap cursor) works as expected. Pick-to: 6.6 Change-Id: Ia04dff468c251030a75e9f1eac642ed764879125 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* tests: Send frame callbacks by defaultDavid Edmundson2023-08-224-0/+12
| | | | | | | | | | | | Currently we have special handling for wl-shell to automatically respond to frame callbacks in the mock compositor. With the framecallback timer this results in flaky tests as the window becomes unexposed. Pick-to: 6.6 Change-Id: I2add44d59ba26368c031a381849891f49764bfb5 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* client: Convert text/x-moz-urls to text/uri-listKai Uwe Broulik2023-08-071-0/+44
| | | | | | | | | | Similar to how it's done in the XCB QPA. This format is used by both Firefox and Chrome for exchanging URLs. Change-Id: Icd4406ff6297ea2800f4e1389ffc2878ee1ccb65 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* DefaultCompositor: use explcit lambda capturesMarc Mutz2023-08-071-3/+3
| | | | | | | | | | | | | C++20 deprecates the capture of *this in [=], and using [&] in a connect() statement is a smell ("are we capturing local variables?"), so just be explicit about what variables we capture (it's mostly [this], anyway). Amends ddef100d9fa7014b21280b1380e6fbcef80277b3. Pick-to: 6.6 6.5 6.2 5.15 Change-Id: Ia594ffd5c0b9e82c54aa67c74b0d59684aa92840 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Fix C++20 deprecated capture of *this in [=]Marc Mutz2023-08-0214-142/+142
| | | | | | | | | | The exec() function is synchronous, so we can just replace [=] with [&]. Pick-to: 6.6 6.5 6.2 5.15 Change-Id: I1b672b0ef456977fa0b898dff9c88f48765a3e41 Reviewed-by: David Edmundson <davidedmundson@kde.org> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* client: Make sure screens stay virtual siblings during reconnectDavid Redondo2023-07-281-8/+26
| | | | | | | | | | | The virtual siblings of QWaylandScreen are constructed from the list of screens in QWaylandDisplay. It is important that when a window changes screens due to handleScreenRemoved that the screens are siblings otherwise the platformwindow is destroyed and window becomes hidden. Pick-to: 6.6 Change-Id: I7ceeee4e18fbdfa936fe987441d35b8a5cb1eefd Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Rename the tst_cursor CMake targetUlf Hermann2023-06-021-1/+1
| | | | | | | It clashes with another tst_cursor in QtGui. Change-Id: I55118393a22a2323691f634f194558b1df33d2be Reviewed-by: David Edmundson <davidedmundson@kde.org>
* client: Implement cursor_shape_v1David Edmundson2023-06-017-7/+204
| | | | | | | | | | | | | | A new wayland protocol allows clients to specify the cursor being used rather than load themes and attach buffers. Short term this has better behavior for scaling. Long term when this has universal compositor support we can drop the theme loading code. Change-Id: I119e1ca44d351e7b13b8ec56f2218d94b7da0705 Reviewed-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* tests: Cleanup cursor role objectsDavid Edmundson2023-05-232-2/+3
| | | | | | | They should have the same lifetime as the underlying surface Change-Id: I35ad0377a506a4e18e7d4f37691189f636ae54bf Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Properly clean up screens during reconnectDavid Redondo2023-05-171-0/+25
| | | | | | | | Otherwise the old screens are left dangling. Also create a placeholder screen so the windows get assigned a valid screen upon reconnect. Change-Id: Iea5d1da6f32be5e87464412447ae1449d91d8e75 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* QWaylandWindow: Init parent wl_surface when creating subsurfaceDavid Rosca2023-04-191-0/+4
| | | | | | | | | Fixes recreating subsurfaces after hiding and then again showing the window. Pick-to: 6.5 Change-Id: I2e3e7ceb42ec6b25cb64db260dfb74f6ebb10d27 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* QWaylandClientExtension: Allow specifying destructor for wayland objectsDavid Redondo2023-04-111-9/+4
| | | | | | | | | | | | | | | | | | | | | While the template takes care of creating proxies automatically, destroying them is harder since an interface can have 0 to multiple destructors. However in the most common case there is only one or always calling one is sufficient. An additional template parameter is introduced that allows user code to specify a callable taking a pointer to the scanner generated class that should be called when the wayland object is to be be destroyed. This is done when the global is removed or upon destruction of the C++ object itself. The clientextension test is changed how it can be used. Since it works via a non-type template parameter a pointer to a (member) function can be passed or when compiled in c++20 mode a lambda or for example a function object. This new functionality is opt-in and the default behavior is unchanged. The default value is nullptr used as a tag to do not enable the new behavior. Change-Id: I8043f7106fec0cd6f2a79682e5872cfa8da3d11b Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Client: Check for shell integration when initializing platform pluginIlya Fedin2023-04-031-1/+13
| | | | | | | | | | | | | | This makes QWaylandDisplay::initialize return a boolean and moves the QWaylandIntegration's failure check out of constructor as QWaylandIntegration::shellIntegration is a virtual method, this also removes the out-of-date comments about processEvents as it's no more used in QWaylandDisplay::forceRoundTrip. Fixes: QTBUG-102457 Pick-to: 6.5 Change-Id: I3c8f1d9fd195326b587b45318443c2beee1ebfc2 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: David Edmundson <davidedmundson@kde.org>
* client: Add support for xdg_popup_configureLiang Qi2023-03-101-2/+20
| | | | | | | | | | | | | | | | | This amends 59a5fe99e1569421b920d99c5b20cdafcdcf43a9. Since set_constraint_adjustment() was supported, popup should reposition itself from configure. Need to find a way to test clientSideMargins() and etc in the future. Fixes: QTBUG-110623 Task-number: QTBUG-87303 Pick-to: 5.15 6.2 6.4 6.5 Done-with: Ilya Fedin <fedin-ilja2010@ya.ru> Change-Id: I734acfcde3ba5a35b6f4222358bc93e49fa43f7c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Rename tst_reconnect to avoid clash with qtremoteobjectsEdward Welbourne2023-03-101-3/+3
| | | | | | | | Name is too generic, but I'll leave this module's maintainers to work out what to do about that. Left the source file with the old name. Change-Id: I0429f03ef06feeae95c2f72ac76cc75397051d9e Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Introduce path for surviving compositor restartsDavid Edmundson2023-03-079-8/+436
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces an optional mechanism for clients to survive a crash and reconnect seemingly seamlessly. In the event of a disconnect from the compositor socket we simply try to reconnect again and replay any data needed so that we maintain a consistent state to where we left off. From an application point-of-view any open popups will be dismissed and we we potentially get a new framecallback, but it will be almost entirely transparent. Users of custom QWaylandClientExtensions will be notified via the activeChanged signal and rebuild as though the compositor had withdrawn and re-announced the global. OpenGL contexts will be marked as invalid, and handled the same way as a GPU reset. On the next frame RHI will notice these are invalid and recreate them, only now against a new wl_display and new EGLDisplay. Users of low level EGL/native objects might be affected, but the alternative at this point is being closed anyway. The entire codepath is only activated via an environment variable. Change-Id: I6c4acc885540e14cead7640794df86dd974fef4f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Compile with -no-openglEskil Abrahamsen Blomfeldt2023-03-0610-10/+5
| | | | | | | | | | | A few of the tests were including Qt OpenGL for no good reason, and the link step should be optional. Pick-to: 6.2 6.5 6.5.0 Fixes: QTBUG-110420 Change-Id: Icb78c15e49070c6938bf9bb75abfed677af6785b Reviewed-by: Inho Lee <inho.lee@qt.io> Reviewed-by: David Edmundson <davidedmundson@kde.org>
* client: Force a roundtrip when an XdgOutput is not ready yetMarco Martin2023-02-273-0/+40
| | | | | | | | | | | | Is possible that the server sends a surface_enter before all the information of the XdgOutput have been processed by the client. in this case the associated QScreen doesn't exist yet, causing a QWindow::SetScreen(nullptr), which will fall back to QGuiApplication::primaryScreen(), having the QWindow being assigned the wrong screen Change-Id: I923d5d3a35484deafa6f0572f79c16c27b1f87f0 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Move server-buffer example to manual testsEskil Abrahamsen Blomfeldt2023-02-1620-0/+585
| | | | | | | | | | | This is undocumented and demonstrates an experimental feature which was never maintained or exercised. It's a nice feature, so we keep the example around for when we get the time to bring it back. Pick-to: 6.5 Task-number: QTBUG-110993 Change-Id: I045cb2ef02a50017a26226c493607100ea0f1b95 Reviewed-by: Inho Lee <inho.lee@qt.io>
* Move hwlayer-compositor example to manual testsEskil Abrahamsen Blomfeldt2023-02-147-0/+203
| | | | | | | | | | | This was never actually listed as part of the examples, and it demonstrates an experimental feature which was never really in use and hasn't been maintained. So lets move the example to manual tests so that it can easily be revived later if we decide it's needed. Change-Id: I5a70701d34d76b4a8d42cf5945341d1f6e37a28b Reviewed-by: Inho Lee <inho.lee@qt.io>
* Implement fractional_scale_v1 and wp_viewportDavid Edmundson2022-12-0710-0/+347
| | | | | | | | | | | | | This allows compositors to hint a non-integer scale to use on a window which we can hook to Qt's existing fractional scaling support. The viewport is used to communicate the relationship between buffer size and logical size to the compositor. It is a non-integer alternative to wl_buffer_scale Change-Id: I1a850f1bcd40e8d04e241e18a538b11f18bc671c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Client: Improve handling of 0xH and Wx0 xdg_toplevel configure eventsVlad Zahorodnii2022-12-053-1/+32
| | | | | | | | | The compositor can send a configure event with 0xH and Wx0 when it wants the window to have some concrete size along one dimension but wants the client to pick the size along the other dimension. Change-Id: I2e72017d4a71b19a930da24fa5c58b6ce672fb94 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Test: update MockClientInho Lee2022-11-102-1/+15
| | | | | | | | | add name and description functions in order to suppress warnings. This amends f1e71327d462d2dae0b46677bbc478afb0d1b2f7 . Change-Id: I0f638802773ce3da4574683e0783ec7405e7c0dc Reviewed-by: Liang Qi <liang.qi@qt.io>
* tests: fix tst_seatv4 to use 24 as default cursor sizeLiang Qi2022-11-081-2/+9
| | | | | | | | | | | | Also set default cursor size to 24 for client, which is correct both on KDE and GNOME at least. Fixes: QTBUG-104259 Pick-to: 6.4 6.2 5.15 Change-Id: Ie4ba27695974025b093a86d8c96fb23d25ad23f7 Reviewed-by: Inho Lee <inho.lee@qt.io> Reviewed-by: David Edmundson <davidedmundson@kde.org> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Disable/fix warningsJonas Karlsson2022-10-283-2/+6
| | | | | | | | missing-field-initializers and unused variable Change-Id: I1a5ceaf53ec706786c73eecab0c002fa9153b962 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Client: Add support for high-resolution scrollingVlad Zahorodnii2022-10-266-24/+182
| | | | | | | | | | | | | | | With wl_pointer version 8, the axis_discrete event is replaced with the axis_value120 event. The main difference between axis_discrete and axis_value120 is that the latter carries scroll deltas that can be fractions of 120, e.g. 30, etc. See also https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/72 Change-Id: I4f724ead7ba146dde6d8975fa4edfcfca761769d Reviewed-by: David Edmundson <davidedmundson@kde.org> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-108-14/+14
| | | | | | | | | | | | | | We've been requiring C++17 since Qt 6.0, and our qAsConst use finally starts to bother us (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace. Task-number: QTBUG-99313 Change-Id: Ia64c6615ee81f7ad5d0658449b0ee347c3db8c29 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Port from container::count() and length() to size()Marc Mutz2022-10-1013-74/+74
| | | | | | | | | | | | | | | | | | | | | This is a semantic patch using ClangTidyTransformator as in qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8: auto QtContainerClass = anyOf( expr(hasType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes))))).bind(o), expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o)); makeRule(cxxMemberCallExpr(on(QtContainerClass), callee(cxxMethodDecl(hasAnyName({"count", "length"), parameterCountIs(0))))), changeTo(cat(access(o, cat("size"), "()"))), cat("use 'size()' instead of 'count()/length()'")) a.k.a qt-port-to-std-compatible-api with config Scope: 'Container', with the extended set of container classes recognized. Change-Id: I574208abc90a8042b500b3f96e3862b0ff339eb6 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Replace qExchange with std::exchangeMarc Mutz2022-10-061-1/+1
| | | | | | | | | | None of these users require C++20 constexpr or C++23 noexcept, the only remaining difference between std::exchange and qExchange. Task-number: QTBUG-99313 Change-Id: Ic5a0bd36d715af2cbc5f9936fdff665ee6eeea4e Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Client: skip building tests which cannot be run on webOSJanne Juntunen2022-09-151-16/+20
| | | | | | | | | | | | WebOS developers have informed us via QTBUG-106114 that opening multiple (consecutive) windows from single webOS-QtWayland client is not supported and majority of our test cases try to do exactly that, causing a segmentation fault. Therefore we need to skip these tests. Fixes: QTBUG-106638 Pick-to: 6.4 Change-Id: Ifbdb2cfb663f8eccd3d68e30445e2a0f39b11355 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>