summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/kernel/qinputdevice/tst_qinputdevice.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Change license for tests filesLucie Gérard2024-02-041-1/+1
| | | | | | | | | | | | According to QUIP-18 [1], all tests file should be LicenseRef-Qt-Commercial OR GPL-3.0-only [1]: https://contribute.qt-project.org/quips/18 Pick-to: 6.7 Task-number: QTBUG-121787 Change-Id: I9657df5d660820e56c96d511ea49d321c54682e8 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* Port from container.count()/length() to size()Marc Mutz2022-10-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is semantic patch using ClangTidyTransformator: auto QtContainerClass = 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'. <classes> are: // sequential: "QByteArray", "QList", "QQueue", "QStack", "QString", "QVarLengthArray", "QVector", // associative: "QHash", "QMultiHash", "QMap", "QMultiMap", "QSet", // Qt has no QMultiSet Change-Id: Ibe8837be96e8d30d1846881ecd65180c1bc459af Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-161-27/+2
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* gui: return first default device when seatName isNullLiang Qi2022-03-131-6/+45
| | | | | | | | | | | | | for QInputDevice::primaryKeyboard() and QPointingDevice::primaryPointingDevice(). This also reverts ae9fefe3c89fd5720ccaad0687f125e32f7c3fe6. Fixes: QTBUG-100790 Pick-to: 6.3 Change-Id: Id02f277db25f823eb29e939e25801325df8e4076 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* tests: XFAIL tst_QInputDevice::multiSeatDevices() on WaylandLiang Qi2022-02-171-0/+7
| | | | | | | Task-number: QTBUG-100790 Pick-to: 6.3 6.2 Change-Id: Ieec4791e4322286fedeeabacc43b9cb84ea27962 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Replace QtTest headers with QTestDavid Skoland2020-12-221-1/+1
| | | | | | | | | | | Complete search and replace of QtTest and QtTest/QtTest with QTest, as QtTest includes the whole module. Replace all such instances with correct header includes. See Jira task for more discussion. Fixes: QTBUG-88831 Change-Id: I981cfae18a1cabcabcabee376016b086d9d01f44 Pick-to: 6.0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Separate QPD::tabletDevice into priv tabletDevice and queryTabletDeviceShawn Rutledge2020-07-071-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There doesn't seem to be any reason users will need to query tablet devices by their IDs, because every event comes with a complete instance already, and we have QInputDevice::devices() to list them all. QPointingDevicePrivate::tabletDevice() can create a new instance if a matching one is not found (and complains about that); it's intended for use in QtGui, as a way to find the device if it was not part of the QWSI event. Now it sets the parent of those auto-created instances to QCoreApplication to avoid a memory leak. On the other hand, queryTabletDevice() is intended for use in platform plugins that need to check whether an instance exists; but they will take care of creating new instances themselves, and thus have more control over the parent and the details being stored. Now that the systemId can also be given, the search is more likely to have a unique result, on window systems that provide device IDs. Rename id() to systemId() to clarify that it's a system-specific unique device ID of some sort, not the same as the uniqueId that a stylus has. However it seems that in practice, this will often be 0; so clarify that if it's not unique, QInputDevicePrivate::fromId() and queryTabletDevice() may not always find the right instance. Clarify the function usage via comments. Change-Id: I82bb8d1c26eeaf06f07c290828aa17ec4a31646b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Replace "no devices registered" warnings with qCDebugShawn Rutledge2020-06-221-4/+0
| | | | | | | | | | The idea was to keep nagging us to update all the platform plugins to do device registration. But besides being annoying, it would cause test failures if we start adding QTest::ignoreMessage() all over, and then some platforms start doing device registration properly. Change-Id: Ia0fbb64cf86f33532be032ec9eebe6e4ad607f20 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Don't return a touchscreen from QPointingDevice::primaryPointingDevice()Shawn Rutledge2020-06-191-1/+1
| | | | | | | | | | | This was causing some bogus failures in Qt Quick autotests. Existing APIs like QQuickWindow::mouseGrabberItem() are not really compatible with the idea of a mouse-less system; but perhaps we can revisit this later. Task-number: QTBUG-85114 Change-Id: Id1c2e5894e5cf13a79998aaea28d5f42fad920cf Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Begin writing tst_QInputDevice autotestShawn Rutledge2020-06-181-0/+86
...starting with a new feature: registering different devices at different seats and verifying their capabilities and that we can get them back again. Change-Id: I8e58a49080633753d02a76e5fdc4932f5c674e0a Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>