summaryrefslogtreecommitdiffstats
path: root/tests/auto/other
Commit message (Collapse)AuthorAgeFilesLines
* Include showMenuAction() if context menu policy is Qt::ActionsContextMenuTor Arne Vestbø26 hours1-0/+21
| | | | | | | | | | | | | | | | | | | | | | | We only report the action if we have any actions to present. For the other context menu policies we don't know if the user has overridden contextMenuEvent or connected to customContextMenuRequested, so we opt to not report the menu action in these cases. A user that wants to present the menu action will have to subclass QAccessibleWidget, override actionNames(), and install an accessible interface factory that returns the specialized QAccessibleWidget. As of now we do not report QAccessible::ActionChanged anywhere in Qt when the conditions for actionNames() change, and this includes this newly added behavior. Initial attempts at plumbing ActionChanged to the macOS a11y system failed as there is seemingly no way to trigger an update of this specific state, so this rabbit-hole has been left for further investigations. Pick-to: 6.10 6.9 6.8 Task-number: QTBUG-137126 Change-Id: I538df87603fbcae9ed2d9bcbb16f1de85a08f200 Reviewed-by: Volker Hilsheimer <[email protected]>
* QDockWidget a11y: Notify of role change when (un)dockingMichael Weghorn28 hours1-1/+5
| | | | | | | | | | | | | | | | | | | | | | The accessible role for QAccessibleDockWidget depends on whether it is floating or not, see QAccessibleDockWidget::role. Therefore, notify about the role change when the QDockWidget::floating property changes. This e.g. makes Accerciser (git master, in particular containing merged merge request [1]) display the new role when a dock widget gets (un)docked. Extend tst_QAccessibility::dockWidgetTest to verify a corresponding event is sent. [1] https://gitlab.gnome.org/GNOME/accerciser/-/merge_requests/98 Task-number: QTBUG-138206 Change-Id: If3aa872e30d69f4750d1a2da1e17c7ab1b10cdb6 Reviewed-by: Volker Hilsheimer <[email protected]>
* QDockWidget a11y: Only report as toplevel window if floatingMichael Weghorn28 hours1-3/+7
| | | | | | | | | | | | | | | | | | | | | | | The QAccessible::Window role is for toplevel windows only, and using it for non-toplevels e.g. breaks window-relative coordinates in AT-SPI for non-floating dock widgets and their content. A QDockWidget is only a top-level if it is floating, so only report the QAccessible::Window role in that case, otherwise use QAccessible::Pane ("A generic container.") because it's a container containing the QDockWidget::widget(). Adjust tst_QAccessibility::dockWidgetTest accordingly. Notifying about the role change when (un)docking a dock widget depends on introducing a new QAccessible::Event and will be implemented separately in an upcoming commit. Fixes: QTBUG-138206 Pick-to: 6.10 6.9 6.8 Change-Id: I9eb1bdc2a60260f169910671ebc82d9735e5ba13 Reviewed-by: Volker Hilsheimer <[email protected]>
* Fix permission handling for internal modulesAlexey Edelev30 hours1-1/+2
| | | | | | | | | | | | Update the code that generates <module>-android-dependencies.xml. Use the correct qt_internal_add_android_permission instead of setting permissions property manually. Amends f430c5ae81238b47939fca610f5d22ab030a4852 Change-Id: Icc46a54f6915bc344afe5507b3244225d750cb7c Reviewed-by: Alexandru Croitor <[email protected]>
* Move the 'Do not compress Qt binary resources file' commentAlexey Edelev11 days1-1/+1
| | | | | | | | Move the comment closer to the line that actually disables compression. Pick-to: 6.8 6.9 6.10 Change-Id: Ib65d5ddffa9b3e3cf97a2ce0e04219c651017653 Reviewed-by: Assam Boudjelthia <[email protected]>
* Add dynamic feature supportAlexey Edelev11 days10-0/+666
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce the qt6_add_android_dynamic_features function. The function marks the targets specified in the FEATURE_TARGETS argument as dynamic features, assigned to the specific Android application target. The dynamic feature target must be the SHARED_LIBRARY and not the Android target of type different from the DYNAMIC_FEATURE type. The design allows many-to-many component linking, so multiple Android applications may use same dynamic feature, and single Android application may use many dynamic features. Dynamic features are deployed as part of the main Android application aab and use the QT_ANDROID_MODERN_BUNDLE as the required pre-requisite. Limitations: - Dynamic features only implemented for the single ABI builds. - Dynamic features are not tested and proved in multi-config builds. - Qt disallowed to provide the store API to load dynamic features. Users need to follow Qt guidelines and documentation to implement own feature delivery. Task-number: QTBUG-116683 Task-number: QTBUG-124600 Change-Id: Idf10d481cedfe1cb5bd08c86e57a844e502bd6ff Reviewed-by: Assam Boudjelthia <[email protected]>
* Rework android permission handlingAlexey Edelev11 days4-4/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current QT_ANDROID_PERMISSIONS property format is inconvenient for use in the CMake generator expressions and mixes attribute syntax with CMake list syntax. This suggests the new format for the QT_ANDROID_PERMISSIONS property. Each element is encoded the following way: <android:name>\;<permission>\\\;<extra1>\;<value>\\\;<extra2>\;<value> Elements are separated using standard CMake semicolons. QT_ANDROID_PERMISSIONS is now transitive LINK property. This feature deprecates the '<permission' records in the Qt6<Module>-android-dependencies.xml files. If application links Qt Module that requires specific permissions, these permissions will be written to the application deployment-settings.json file. The 'permissions' record in the application deployment-settings.json file is changed too, the new format is following: "permissions": [{ "name": "permission", "extra1": "value", "extra2": "value" }] Comparing to the previous format each extra attribute is stored under a separate key in permission object. IMPORTANT: androiddeployqt has no backward compatibility with the old format. With QT_USE_ANDROID_MODERN_BUNDLE enabled permissions are written directly to the AndroidManifest.xml without androiddeployqt involved. Supply tests for the Android permissions, that reads the manifest-declared permissions in test using the Android PackageManager API. Change-Id: I691df33c70acc6c7139302b119edc791fef8d5ef Reviewed-by: Assam Boudjelthia <[email protected]>
* Add support for QT_ANDROID_PACKAGE_SOURCE_DIR to modern bundlesAlexey Edelev11 days7-0/+312
| | | | | | | | | | | | | | Copy contents of QT_ANDROID_PACKAGE_SOURCE_DIR to the target android build directory. Comparing to the non-modern bundle deployment, this also support the partial template deployment. This means that known template files in QT_ANDROID_PACKAGE_SOURCE_DIR are evaluated first and only then copied. Cover QT_ANDROID_PACKAGE_SOURCE_DIR with tests. Change-Id: Iae1517f0b5bb359a815c7bec576a12f6232649f2 Reviewed-by: Alexandru Croitor <[email protected]> Reviewed-by: Assam Boudjelthia <[email protected]>
* QLineEdit a11y: Report displayText on a11y layerMichael Weghorn2025-06-161-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of reporting no/empty text on the a11y layer when using a QLineEdit::EchoMode that doesn't display the actual text as is (e.g. in case of a password field), use QLineEdit::displayText, which already prevents exposing the actual text unless it's also displayed on screen. Previously, the character count and caret/cursor position was still reported for the actual text, but an empty string was reported for the text itself, which was inconsistent. (A cursor position of 3 within an allegedly empty text doesn't make sense, and empty text cannot have a character count of 5.) With this commit in place, entering "hello" in the QLineEdit from the sample app from QTBUG-109599 now results in replacement/mask characters as shown on screen being reported for the text on the a11y layer as well as long as QLineEdit::Password is used. Demo using Accerciser's IPython console on Linux, with the QLineEdit's accessible object selected in Accerciser's treeview of the sample app's a11y hierarchy. Without this commit in place: In [11]: text = acc.queryText() In [12]: text.characterCount Out[12]: 5 In [13]: text.getText(0, -1) Out[13]: '' With this commit in place: In [16]: text = acc.queryText() In [17]: text.characterCount Out[17]: 5 In [18]: text.getText(0, -1) Out[18]: '●●●●●' The Orca screen reader now announces "circle" as expected when moving the cursor between the individual characters. This also fixes the assert/crash seen with Narrator as mentioned in QTBUG-109599, due to the above-mentioned mismatch between reported character count and actual text length. (QWindowsUiaTextRangeProvider::ExpandToEnclosingUnit relies on the reported character count, then accesses the character by index, but the actual string was empty.) The QAccessibleLineEdit::text(QAccessible::Value) case previously had manual handling to report mask characters. Use the displayText there, too. Adjust tst_QAccessibility::lineEditTest accordingly and extend it to test the QAccessibleTextInterface in addition. Since mask characters for passwords in QLineEdit::displayText are platform-dependent, don't compare the text reported via a11y interfaces to a hard-coded string, but instead check it matches the displayText, but differs from the (plain) text. Fixes: QTBUG-109599 Pick-to: 6.10 6.9 Change-Id: Ifebb4502b71e11d431b708eea613cb2a10e3f237 Reviewed-by: Volker Hilsheimer <[email protected]>
* a11y on macOS: return a valid window elementVolker Hilsheimer2025-06-131-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | Our accessibilityWindow implementation asks the parent for it's window, expecting that it will always be the same. This is conceptually correct. However, as we don't represent windows through QAccessibilityInterface and instead rely on the natively provided element, the filtering out of ignored elements result in accessibilityParent return a null object once the parent is the window. Instead, check if we get an interface that represents a Window, and if so fall through to the code returning the NSView (after going through QAcessibilityInterface::window call, which was so far missing). And if we then get a Window element as the parent, then we don't have to call accessibilityWindow on that parent again. Instead, return the result directly and only keep going if we got some other element. Add a test case that confirms that we now get a valid result for the window attribute. Pick-to: 6.10 6.9 6.8 6.5 Fixes: QTBUG-137157 Change-Id: Ifa485734b290284bd5a1286e3b3c18454442fa10 Reviewed-by: Morten Johan Sørvig <[email protected]>
* Fix flaky tst_QFocusEvent::checkReason_ActiveWindow on openSUSEFrédéric Lefebvre2025-06-011-2/+0
| | | | | | | | | | | | | | | | tst_QFocusEvent::CheckReason_ActiveWindow is flaky on openSUSE where the childFocusWidgetOne is unable to receive focus after d has been hidden. This is due to some asynchronicity when setActive is being called while d is already active. Remove the call to activateWindow on d as it is already active by calling show. Pick-to: 6.9 6.8 6.5 Change-Id: Id01c6704122df42982d65d28ddb94d184d00d9aa Reviewed-by: Axel Spoerl <[email protected]>
* a11y: Report QWidget localeMichael Weghorn2025-05-292-9/+54
| | | | | | | | | | | | | | | | | | | Implement support for QAccessible::Attribute::Locale (newly introduced in a previous commit) for QWidget by introducing QAccessibleWidgetV2 which subclasses QAccessibleWidget and implements the QAccessibleAttributesInterface to report the QWidget::locale property for QAccessible::Attribute::Locale. (Leave QAccessibleWidget unchanged for ABI compatibility.) Switch QAccessibleWidget subclasses to subclass the newly introduced QAccessibleWidgetV2. Add a corresponding unit test. Task-number: QTBUG-137144 Change-Id: I61385b17ee1272801ad769da5a807ca4e068cfb2 Reviewed-by: Volker Hilsheimer <[email protected]>
* Restructure android testsAlexey Edelev2025-05-245-1/+5
| | | | | Change-Id: I14bc0db28dcc928771b14a6854ba1c53d76461a7 Reviewed-by: Alexandru Croitor <[email protected]>
* For qdebug operator<< of pointer types, always check for nullptrDaniel Trevitz2025-05-171-3/+3
| | | | | | | | Also, use a consistent syntax for when the pointer is null. Fixes: QTBUG-135856 Change-Id: I2f5c80a5650b1be6cc0d70cde7cd1e1c1990df9a Reviewed-by: Christian Ehrlicher <[email protected]>
* QGestureManager::deliverEvents() - improve debug outputAxel Spoerl2025-04-101-4/+4
| | | | | | | | | | | | qDebug() why no target has been found for a gesture. Correct wrong function names in debug output. Use __FUNCTION__ macro instead of spelling function name out. Adapt QTest::ignoreMessage() calls in tst_gestures.cpp to also use the correct function name. Task-number: QTBUG-129754 Change-Id: Ifabf512215934ee984bcb8c9d0c2463342d77c07 Reviewed-by: David Faure <[email protected]>
* Improve macos tabs accessbility supportAlbert Astals Cid2025-04-011-0/+70
| | | | | | | | | | | | | | Map PageTabList controls (i.e. QTabBar) to the TabGroup role, and report the list of PageTabs as the tabs. Add a predicate-argument to the unignoredChildren() function so that we can re-use that logic to return the list of tabs, while also ignoring otherwise accessible children, such as the scroll buttons. Change-Id: I57472e9213dd178e018449e542de276051097073 Fixes: QTBUG-134807 Pick-to: 6.9 6.8 Reviewed-by: Michael Weghorn <[email protected]> Reviewed-by: Volker Hilsheimer <[email protected]>
* macOS a11y: maintain reference count for cached elementsVolker Hilsheimer2025-03-281-7/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Retain elements when storing them in the cache, so that they only get destroyed when they are neither stored as rows/columns, and removed from the cache. If storing an element in the cache replaces a different element with the same ID, release that before retaining the new one. Give the insertElement() function a bool return value so that callers know whether the element has been retained, so that they can correctly release their own reference. Release elements when they are removed from the cache so that it's easier to see that the calls are balanced. For that to work, forward declare QMacAccessibilityElement as an NSObject type. A special case are place-holder cell elements. Those are not inserted into the cache until the interface is requested, so when those get inserted into the cache, we don't have a local reference to release - it's the reference held by the rows/columns array. However, we don't want stale elements in the cache, so when we release the rows and columns arrays, also remove all cell entries from the cache. Otherwise we end up with stale elements reporting outdated values. As this might invalidate references that our test object holds, refresh the test object when triggering a model update. Amends 1f7e926411d1e0d958c37dc597f24101d410c46b. Pick-to: 6.9 6.8 Fixes: QTBUG-134784 Change-Id: Ib3cce35058e4c80e3edc97ae578584610ee93487 Reviewed-by: Tor Arne Vestbø <[email protected]>
* Tests: include what you use (QElapsedTimer)Giuseppe D'Angelo2025-03-241-0/+1
| | | | | | Pick-to: 6.9 6.8 Change-Id: Ia0809dcba4477da97b506b4a9651b00e4ed5ab2c Reviewed-by: Edward Welbourne <[email protected]>
* mac a11y: ignore expected debug output from testVolker Hilsheimer2025-03-211-0/+2
| | | | | | | | Don't confuse the next person working on this code. Pick-to: 6.9 6.8 Change-Id: I3f9ff59299a4150a96cc11d851d06539a5701a70 Reviewed-by: Tor Arne Vestbø <[email protected]>
* Revert "Blacklist IMAP tests"Jukka Jokiniva2025-02-091-5/+0
| | | | | | | | | This reverts commit 69c992b02c544f7091113111a6fa0ad5c9c80d2c. Reason for revert: DNS fix was applied to the CI network Change-Id: Ib6ae4d6e56c35408f64eec33357347e606ba2495 Reviewed-by: Mårten Nordheim <[email protected]>
* Blacklist IMAP testsMårten Nordheim2025-02-071-0/+5
| | | | | | | | | | | For some reason the IMAP server is responding very slowly to the tests, causing the default 5s timeout to fail. For now let's blacklist them while the issue is investigated. Task-number: QTBUG-133548 Pick-to: 6.9 Change-Id: I133a48b14f76566712af72012677bf048740b235 Reviewed-by: Marc Mutz <[email protected]>
* tst_QAccessibility: Use QKeySequence::toString() properlyVlad Zahorodnii2025-01-141-4/+4
| | | | | | | | | | | | The test gets a string representation of a key sequence by stitching the individual parts manually. It is not a portable approach and the test relies on undocumented behavior of QKeySequence::toString(). A more reliable and portable approach is to pass the Qt::Key value to QKeySequence and let it do its magic. Change-Id: I2a0e8734c93fa4f86f11324f26d8967d22e14247 Reviewed-by: Volker Hilsheimer <[email protected]>
* a11y: Port qt_accHotKey() to QKeySequence::mnemonic()Vlad Zahorodnii2025-01-101-1/+14
| | | | | | | | | | | | QKeySequence::mnemonic() contains additional input sanitization logic and in combination with the toString() function, it provides a platform agnostic way to get the shortcut text for the mnemonic. tst_QAccessibility was adjusted because mnemonics don't work by default on macOS. See qt_set_sequence_auto_mnemonic(). Change-Id: I96842a6c18140a559aeaeb8f687e32011e5e2e77 Reviewed-by: Volker Hilsheimer <[email protected]>
* Fix tst_gestures flakiness on XCBAxel Spoerl2024-11-141-33/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | X11 spawns painting threads and sends an expose event at the same time. While the worker is still paining, QXcbScreen::topLevelAt() may not find the window, even if it reports being exposed. Wait until windows are exposed and painted. Remove workaround to intercept warnings about undeliverable gestures. Remove qWait() antipattern. Fixes: QTBUG-130811 Fixes: QTBUG-84258 Fixes: QTBUG-69648 Fixes: QTBUG-67393 Fixes: QTBUG-67392 Fixes: QTBUG-67389 Fixes: QTBUG-68861 Fixes: QTBUG-70224 Fixes: QTBUG-70223 Fixes: QTBUG-67395 Fixes: QTBUG-70227 Fixes: QTBUG-70226 Fixes: QTBUG-70209 Fixes: QTBUG-70153 Pick-to: 6.8 6.5 Change-Id: Id126fe884ba360551425f3e2b29674f5b9419fff Reviewed-by: Volker Hilsheimer <[email protected]>
* tst_Gestures::conflictingGesturesInGraphicsView(): use dynamic sizeAxel Spoerl2024-11-111-6/+7
| | | | | | | | | | | | | | | The test function assigns a hard coded rectangle to gestures and uses the default size of a graphics view at the same time. The leads to flakiness, where the gestures can't be delivered when their size is out of bounds of the view's geometry. Assign size size dynamically, according to the view's geometry. Task-number: QTBUG-130811 Pick-to: 6.8 6.5 Change-Id: If75f59d15f84e610b4ec987daa2a06ce62539228 Reviewed-by: Frederic Lefebvre <[email protected]> Reviewed-by: Volker Hilsheimer <[email protected]>
* Add REUSE.toml filesLucie Gérard2024-11-051-0/+7
| | | | | | | | | | | | | | | | | | | | | Those files are read by reuse to complement or override the copyright and licensing information found in file. The use of REUSE.toml files was introduced in REUSE version 3.1.0a1. This reuse version is compatible with reuse specification version 3.2 [1]. With this commit's files, * The SPDX document generated by reuse spdx conforms to SPDX 2.3, * The reuse lint command reports that the Qt project is reuse compliant. [1]: https://reuse.software/spec-3.2/ Task-number: QTBUG-124453 Task-number: QTBUG-125211 Pick-to: 6.8 Change-Id: I01023e862607777a5e710669ccd28bbf56091097 Reviewed-by: Edward Welbourne <[email protected]> Reviewed-by: Joerg Bornemann <[email protected]>
* Tests: Reduce the number of module includesFriedemann Kleint2024-11-043-15/+20
| | | | | | | | | They are an unnecessary hit on build time. Rewrite the tests using the standard Qt conventions. Pick-to: 6.8 Change-Id: Iac47e62c58b1805c3b4a0ac4f4b3db206c66cc65 Reviewed-by: Axel Spoerl <[email protected]>
* Introduce qt_add_android_permission CMake functionJuha Vuolle2024-09-162-1/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qt_add_android_permission function can be used to set Android permissions on target executable. This allows setting new permissions, or overriding permissions set by Qt modules, without needing to supply a manual application AndroidManifest.xml. The change consists of: - New public CMake function for setting the permissions on the target + documentation - Writing these application permissions into the deployment settings json file - Reading and handling these permissions at androiddeployqt side - Moving some pre-existing permission functionality from QtAndroidHelpers.cmake to Qt6AndroidMacros.cmake so that they can be reused also in the context of application CMakeLists.txt processing - Documentation update for Android permission handling In future this same mechanism can be extended for Android features. [ChangeLog][CMake] Added qt_add_android_permission function for setting Android permissions from application CMake Fixes: QTBUG-128280 Change-Id: Ia22951fb435598be00b5da5eae11b9f35f704795 Reviewed-by: Assam Boudjelthia <[email protected]> Reviewed-by: Alexey Edelev <[email protected]>
* CMake:Android: add property QT_ANDROID_COMPILE_SDK_VERSIONAssam Boudjelthia2024-09-092-0/+4
| | | | | | | | | This allows to set the compile SDK version from CMakeLists.txt instead of a parameter to androiddeployqt to give more flexibility. Fixes: QTBUG-128364 Change-Id: I797e8f9b3c35dcb822c1b7e2b67e6b76387775ca Reviewed-by: Alexey Edelev <[email protected]>
* CMake:Android: add property QT_ANDROID_APP_NAME to set app nameAssam Boudjelthia2024-09-092-0/+4
| | | | | | | | | | | With this property, a user can set the app's name directly from CMake without having to manaully manage a custom AndroidManifest.xml file. Fixes: QTBUG-87982 Fixes: QTBUG-121825 Fixes: QTCREATORBUG-17863 Change-Id: Ic12e13b58efbc4fb2f18be6fc854b585988485bf Reviewed-by: Alexey Edelev <[email protected]>
* a11y tests: Make combobox focus tests more reliableMichael Weghorn2024-08-281-0/+2
| | | | | | | | | | | | | | The combobox focus test was occasionally (in 2 out of 20 runs) failing in my setup with with QT_QPA_PLATFORM=xcb as follows: 1: FAIL! : tst_QAccessibility::focusChild() 'QTestAccessibility::containsEvent(&focusEvent)' returned FALSE. () 1: Loc: [.../qt5/qtbase/tests/auto/other/qaccessibility/tst_qaccessibility.cpp(4606)] Wait for the combobox to actually have focus before checking for the a11y event. Change-Id: I913173bb504d2fdd6ac1dab6f70c49c849550eff Reviewed-by: Volker Hilsheimer <[email protected]>
* a11y tests: Make key event tests more reliableMichael Weghorn2024-08-281-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While tst_QAccessibility usually passes on both, xcb and wayland when no assistive technology is running, it failed consistently in a KDE Plasma Dev Wayland session when either Accerciser or the Orca screen reader are running when the test is started, with failures like this one: 1: FAIL! : tst_QAccessibility::lineEditTest() 'QTestAccessibility::containsEvent(&insertE)' returned FALSE. () 1: Loc: [.../qt5/qtbase/tests/auto/other/qaccessibility/tst_qaccessibility.cpp(2357)] 1: QWARN : tst_QAccessibility::lineEditTest() 4 accessibility event(s) were not handled in testfunction 'lineEditTest': 1: QWARN : tst_QAccessibility::lineEditTest() 1: Object: 0x0 Event: 'TextCaretMoved' Child: -1 1: QWARN : tst_QAccessibility::lineEditTest() 2: Object: 0x0 Event: 'ObjectHide' Child: -1 1: QWARN : tst_QAccessibility::lineEditTest() 3: Object: 0x0 Event: 'ObjectHide' Child: -1 1: QWARN : tst_QAccessibility::lineEditTest() 4: Object: 0x0 Event: 'ObjectHide' Child: -1 Fix that by ensuring that the key events have been processed in the widget (by waiting for the current text or caret/cursor position to match the expected outcome) before checking that a corresponding accessibility event has been sent. (It's not 100% clear to me whether the previous failure is related to the way that assistive technology/libatspi intercepts keyboard events or whether it is just some timing issue.) This makes tst_QAccessibility pass at least with QT_QPA_PLATFORM=xcb when either Orca or Accerciser are running. (With QT_QPA_PLATFORM=wayland, other test failures are still seen when AT is active while running the test.) Change-Id: Ib8fa036dc78082ddf1a0197189b0d13ef0bce9db Reviewed-by: Volker Hilsheimer <[email protected]>
* a11y tests: Wait until window is exposed, skip focus test on WaylandMichael Weghorn2024-08-281-9/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | While it passes for QT_QPA_PLATFORM=xcb in a KDE Plasma Dev Wayland session on Debian testing, tst_QAccessibility::listTest failed consistently like this for me when run with QT_QPA_PLATFORM=wayland: 1: FAIL! : tst_QAccessibility::listTest() 'QTestAccessibility::containsEvent(&focusEvent)' returned FALSE. () 1: Loc: [.../qt5/qtbase/tests/auto/other/qaccessibility/tst_qaccessibility.cpp(2945)] The same failure can be observed with QT_QPA_PLATFORM=xcb when removing the calls to QTest::qWait and QCoreApplication::processEvents after the call to QListView::show. A QAccessible::Focus event is only sent for a newly selected item when the list view has focus (see QListView::currentChanged), which was not the case on Wayland. After the call to QListView::show, wait for the window to be exposed instead of calling QCoreApplication::processEvents and waiting for a hard-coded amount of time. Skip the focus event tests on platforms where focus cannot be ensured (including Wayland). Change-Id: I4515a194885b8bac75c6b58a8857ff2152640dd6 Reviewed-by: Volker Hilsheimer <[email protected]>
* a11y: Report the actual (platform) window name as a11y name (xcb)Michael Weghorn2024-08-221-13/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At least on Linux and Windows, Qt does not just set the window name explicitly set using e.g. QWidget::setWindowName for the actual platform window shown on screen, but appends the application name (see QPlatformWindow::setWindowTitle). So far, that logic was not applied on the a11y layer when determining an accessible name for a window, meaning that the information presented on screen and on the accessibility layer was not consistent. Align the accessible name with the actually displayed window title by adding a QPlatformWindow::windowTitle method to retrieve the window title that is actually used for the platform window and use that one when asked for the accessible name of the window and none has explicitly been set. Besides the default implementation, that simply returns the window title set for the platform window's associated QWindow, this commit implements the new method for QXcbWindow. Implementations for further platforms will be done in separate commits. (For qtwayland, QWaylandWindow already has a suitable QWaylandWindow::windowTitle method that only needs to be marked to override the base class implementation.) Adjust tst_QAccessibility::messageBoxTest to show the message box before checking the window title (and other accessible attributes), as the associated QWindow and QPlatformWindow only get created when a QWidget gets first shown (see QWidget::create/QWidgetPrivate::create). It seems appropriate to only assume that the accessible name matches the window title once a window actually exists. (Before the message box gets shown, box->windowHandle() would still return nullptr.) As long as the asociated QWindow hasn't been created yet, the message box isn't yet considered a part of the application's accessibility tree anyway (see QAccessibleApplication::child which only considers top level windows), meaning that in practice, assistive technology won't become aware of the message box until the QWindow gets created. Also set the QMessageBox::Option::DontUseNativeDialog option introduced in commit 29b2506e8cf0c792821a3ddb28e62080cd66ae28 in tst_QAccessibility::messageBoxTest instead of skipping event tests on platforms that would otherwise use native dialogs that don't emit the corresponding events. Task-number: QTBUG-127563 Change-Id: I1dfba82a044dda7cf99510c059fe7392237f4c61 Reviewed-by: Axel Spoerl <[email protected]> Reviewed-by: Volker Hilsheimer <[email protected]>
* Accessibility on macOS: make treeview test more reliableVolker Hilsheimer2024-08-221-24/+59
| | | | | | | | | | | | | | | Add a check that the reference we create the TestAXObject object from is valid, and assert that it is before calling properties. Verify that the rows we get all have the correct number of children (the columns) before trying to read the cell values. As a drive-by, change the relevant code to use property syntax, and release objects consistently. Task-number: QTBUG-122751 Pick-to: 6.8 Change-Id: I1db3e4446c569235cfc0f3092adc7369ad826368 Reviewed-by: Tor Arne Vestbø <[email protected]>
* Accessibility on macOS: add more diagnostic output to testVolker Hilsheimer2024-08-221-19/+31
| | | | | | | | | | Emit debug output if we fail to get child, row, or column lists from a table or row element. Task-number: QTBUG-122751 Pick-to: 6.8 Change-Id: Id8e4d2e46db089fab8295b314f66163e8c9a893c Reviewed-by: Tor Arne Vestbø <[email protected]>
* Remove second parameter being passed to QSKIP()Edward Welbourne2024-08-131-2/+2
| | | | | | | | | | Prior to Qt 5, QSKIP() accepted a scope parameter, either SkipAll or SkipSingle. This has been ignored since 5.0.0, so remove all surviving uses of it (including the QTest::QSkipAll and QTest::SkipAll, which were surely bogus even before). Change-Id: I4fc671534c88c2c52535d4cc9f1ab0bd8ea719d0 Reviewed-by: Tor Arne Vestbø <[email protected]>
* a11y: Don't notify about name/desc/id change if there was noneMichael Weghorn2024-07-191-0/+7
| | | | | | | | | | | | | | | | | | | | Return early if the setters are called with the same string as is already set for the accessible name, description or identifier. This avoids sending an event wrongly notifying about a change when there was actually none. Extend the `tst_QAccessibility::accessibleIdentifier` autotest accordingly to test that no event is triggered when setting the same ID again. Thanks to Jan Arve Sæther for suggesting that in the previous change introducing the accessibleIdentifier property. (Implemented in a separate commit as it is a preexisting issue for accessible name and description.) Change-Id: Id3af3f0c4769e93e4970be9db87734df9ef84212 Reviewed-by: Jan Arve Sæther <[email protected]>
* a11y: Add property for QWidget's accessible IDMichael Weghorn2024-07-191-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 9ec1de2528b871099d416d15592fcc5ef9242a64 added an Identifier role to QAccessible that can be used to provide an identfier for reliable identification by assistive technologies, e.g. in automated tests. As discussed in that commit's Gerrit change, add a corresponding accessibleIdentifier property to QWidget to allow easily setting a specific identifier for widgets, in the same way that an accessible name or description can be set. This provides more flexibility than the default logic that generates an identifier to be used in platform bridges that is based on the object or class names of the objects in the widget's subtree. (The only alternative so far to set a particular ID not including the "object path" would have been to provide a custom QAccessibleInterface implementation with a corresponding QAccessibleInterface::text implementation.) Add an autotest testing both, the default platform bridge logic and that the the newly added property overrides that. [ChangeLog][QtWidgets][QWidget] Add an accessibleId property that allows to easily set a particular accessible identifier for QWidgets that can be used by assistive technologies to identify the widget. Change-Id: If24e138c7d8fe4c78f25d3f0629a9520c352bacc Reviewed-by: Volker Hilsheimer <[email protected]>
* Add a few more tests for accessible selection of list viewsIngo Klöcker2024-06-281-0/+21
| | | | | | | | In particular, verify that selectedCellCount() now reports the correct number for list views with underlying multi-column model. Change-Id: Ic33baed17e2bdb857cc2f31b49f380b70369a24a Reviewed-by: Jan Arve Sæther <[email protected]>
* Fix accessibility of list views with underlying multi-column modelIngo Klöcker2024-06-261-14/+21
| | | | | | | | | | | | | | | | | | | | | | | A list view should always expose a table with a single column to accessibility tools even if the underlying model has multiple columns. Several functions need to be changed so that they only consider the model column that was set on the list view. For a list view logicalIndex() must only consider indexes for the model column. For valid indexes the logical index is simply the row because list views have neither row headers nor column headers. The column count for list views is always 1 (unless the model has no columns). The child count needs to use the column count of the accessible table instead of the column count of the underlying model. child(), cellAt(), selectedCellCount(), and selectedCells() get separate implementation for list views. Fixes: QTBUG-33786 Pick-to: 6.8 6.7 6.6 Change-Id: I18c604efa2014267bb6e3b68e403e436bdcbc4ce Reviewed-by: Jan Arve Sæther <[email protected]>
* a11y: Notify of name change when setting window title used as a11y nameMichael Weghorn2024-05-221-0/+7
| | | | | | | | | | | | | | | | | | | When no explicit accessible name is set for a window, QAccessibleWidget::text uses the window title instead for a non-minimized window. Send a QAccessible::NameChanged event when changing the window title results in a change of the accessible name, to ensure that the AT-SPI cache on Linux gets updated. Extend tst_QAccessibility::mainWindowTest() to cover the scenario as well. Note: The entire test function is skipped on platforms not supporting window activation, e.g. Wayland. Fixes: QTBUG-124192 Change-Id: I0fa7f683fb5969d6ba9878f6a506c4f192069799 Reviewed-by: Jan Arve Sæther <[email protected]>
* Android:CMake: Add QT_ANDROID_PACKAGE_NAME propertyAssam Boudjelthia2024-05-162-0/+4
| | | | | | | | | | | | | Allow setting the package name directly from CMake properties. If the package name is not set manually under AndroidManifest.xml nor build.gradle, then the value set by this property is used. The value is passed to build.gradle as "namespace" which is the way to set the package name after AGP 7.4 instead of AndroidManifest.xml "package" attribute. Task-number: QTBUG-106907 Change-Id: I94bd73c294d751eabfd96c0a10a6b3ff270d8137 Reviewed-by: Tinja Paavoseppä <[email protected]>
* CMake: Remove mention of tests/auto/other/atwrapperJoerg Bornemann2024-05-111-3/+0
| | | | | | | | This test was removed in commit eee4167a90c54fa48fb12252741720d9c56f5ec5. Change-Id: Id42634450242a0658bac603d7973b8f1e0e5b6c0 Reviewed-by: Alexandru Croitor <[email protected]>
* Fix test compilation issues with QtLite configurationJari Helaakoski2024-05-061-1/+8
| | | | | | | | | | Now developer build tests compile, but some are not working. Functional fix will come later via separate tasks. Task-number: QTBUG-122999 Change-Id: I70487b46c1b32ba4279cb02a4978e4f55ac0d310 Reviewed-by: Alexey Edelev <[email protected]> Reviewed-by: Thiago Macieira <[email protected]>
* Select a list item instead of a row for the list testIngo Klöcker2024-04-261-1/+2
| | | | | | | | | In a list view each row contains exactly one element. Using selectRow feels like wrong API for a list view. Use the select function of the selection interface instead. Change-Id: Id53091c797b89f0919b5d6441c98349e4989a495 Reviewed-by: Volker Hilsheimer <[email protected]>
* tst_QFocusEvent::checkReason_ActiveWindow() remove setActiveWindow()Frédéric Lefebvre2024-04-231-1/+0
| | | | | | | | | | | 2f6fe3a26843ff68c5d3f9af0a2fc3cce6caac22 has made calls to QApplicationPrivate::setActiveWindow() redundant. Remove redundant calls. Task-number: QTBUG-121488 Change-Id: I4a2180c9e13140bf669753318189a58b7959b725 Reviewed-by: Axel Spoerl <[email protected]>
* Clean up windows accessibility backendMiguel Costa2024-03-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | What was done: * Removed headers in src/gui/accessible/windows/apisupport: as of v13.1.0, MinGW supports most of the definitions in these headers. Including uiautomation.h should be enough. * Removed the QWindowsUiaWrapper class: it's not meant to be extended or itself instantiated, is an "ultra-thin" layer (it even preserves the "all-caps" Win types of function args), and is in effect only a MinGW-bound "kludge". Instead of this class, use the UI Automation API directly, with the assumption that it's available and fully functional, as specified in the MS docs. Any gaps between this assumption and what is delivered by MinGW are bridged with specific (and explicit) temporary "kludges". * Implemented said specific "kludges" in qwindowsuiautomation. For Windows builds, the header just includes uiautomation.h, and the .cpp is empty. For MinGW, the header contains definitions still missing from uiautomation.h, and the .cpp implements functions of the UI Automation core library through imports from the uiautomationcore DLL. * Windows plugins (and tst_qaccessibility): use the UI Automation API definitions directly, instead of the "ultra-thin" wrapper. * Windows plugin builds: use uiautomationcore library, if found. What's intended: * Unburden Gui of the Windows UI Automation COM interfaces and other definitions that are copied in the uia*.h headers. * Make the Windows plugins independent of MinGW shortcomings. * Remove the QWindowsUiaWrapper class that essentially only hides these shortcomings and the "kludge" code needed to overcome them. * As MinGW adds further support to the UI Automation API over time, make it noticeable which workarounds are no longer needed. The current approach of hiding "kludges" in a wrapper class will also hide the fact that they're no longer needed, if/when that time comes. Change-Id: I0070636817d5de81d0b106e9179e2d0442362e2a Reviewed-by: Wladimir Leuschner <[email protected]> Reviewed-by: Oliver Wolff <[email protected]>
* Tests: check the output of QFile::openGiuseppe D'Angelo2024-03-271-6/+2
| | | | | | | | | | Wrap the call in QVERIFY. tst_QTextStream::read0d0d0a was also faulty as it *never* opened the file because of a broken path. Fix it with QFINDTESTDATA. Change-Id: I61a8f83beddf098d37fda13cb3bfb4aaa4913fc5 Reviewed-by: Thiago Macieira <[email protected]>
* tst_toolsupport: make the i386 case really about i386Thiago Macieira2024-03-061-2/+3
| | | | | | | | | | | Specifically, don't use it for either of the x86-64 ABIs (LP64 and ILP32). The generic case below should work for everyone. Fixes: QTBUG-122720 Pick-to: 6.7 Change-Id: I01ec3c774d9943adb903fffd17b75fc79095e089 Reviewed-by: hjk <[email protected]> Reviewed-by: Fabian Kosmale <[email protected]>