feat(at-spi): 补全 setObjectName() 作为 AT-SPI 测试定位锚点 (DDE-166) - #208
feat(at-spi): 补全 setObjectName() 作为 AT-SPI 测试定位锚点 (DDE-166)#208MyLeeJiEun wants to merge 1 commit into
Conversation
…ontrols Per DDE-198 rule change, the AT-SPI test locator anchor switches from setAccessibleName() to setObjectName() (C++/DTK). Qt's AT-SPI bridge auto-generates AccessibleId from the objectName ancestor chain; setAccessibleName() is retained only for screen-reader semantics. Previously all 9 interactive controls lacked setObjectName(): 4 had only setAccessibleName() (Cancel/Confirm buttons, PasswordInput, AdminUsers combo) and 5 relied on accessibleFactory fallback. Add setObjectName() to the 5 controls created in this repo: - AuthDialog -> AuthDialog - Cancel button -> CancelButton - Confirm button -> ConfirmButton - m_passwordInput -> PasswordInput - m_adminsCombo -> AdminUsers setAccessibleName() calls are kept (not removed). The remaining 4 controls are DDialog/DPasswordEdit internal sub-controls created by DTK; their objectName/AccessibleId is DTK's responsibility, while accessibleFactory still covers the Name channel. accessibleFactory (accessibledefine.h) needs no adjustment: its getAccessibleName() only produces the screen-reader Name (separate from the AccessibleId locator channel), and the existing three-level priority (accessibleName -> objectName -> fallback) remains valid for Name. Closes DDE-166
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: MyLeeJiEun The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @MyLeeJiEun. Thanks for your PR. 😃 |
Reviewer's guide (collapsed on small PRs)Reviewer's Guide在 AuthDialog 初始化阶段为窗口及四个应用侧交互控件补全 setObjectName(),使 Qt AT-SPI bridge 能从 objectName 祖先链生成 AccessibleId;同时保留 setAccessibleName() 作为屏幕阅读器 Name,并明确 DTK 内部子控件和 accessibleFactory 不在本次改动范围内。 Sequence diagram for AT-SPI anchor initializationsequenceDiagram
participant AuthDialog
participant CancelButton
participant ConfirmButton
participant PasswordInput
participant AdminUsers
participant QtATSPI as QtATSPI_Bridge
AuthDialog->>AuthDialog: initUI()
AuthDialog->>AuthDialog: setObjectName(AuthDialog)
AuthDialog->>CancelButton: setAccessibleName(Cancel)
AuthDialog->>CancelButton: setObjectName(CancelButton)
AuthDialog->>ConfirmButton: setAccessibleName(Confirm)
AuthDialog->>ConfirmButton: setObjectName(ConfirmButton)
AuthDialog->>PasswordInput: setAccessibleName(PasswordInput)
AuthDialog->>PasswordInput: setObjectName(PasswordInput)
AuthDialog->>AdminUsers: setAccessibleName(AdminUsers)
AuthDialog->>AdminUsers: setObjectName(AdminUsers)
QtATSPI->>AuthDialog: derive AccessibleId from objectName ancestor chain
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Hi @MyLeeJiEun. Thanks for your PR. I'm waiting for a linuxdeepin member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
背景
参考 DDE-198:AT-SPI 测试定位锚点规则变更,从
setAccessibleName()改为setObjectName()(C++/DTK)。Qt 的 AT-SPI bridge 在未显式设置
QAccessible::Identifier时,会自动沿objectName祖先链拼接生成AccessibleId(定位锚点);setAccessibleName()仅保留屏幕阅读器语义,不再作为定位锚点。扫描结论
对仓库全量 C++ 源码扫描
setObjectName:此前调用数为 0,9 个交互控件均未设置objectName:改动
对前 5 个本仓库可改控件补全
setObjectName()(PascalCase、项目级去重),setAccessibleName()保留不删除:后 4 个(#6–#9)为 DDialog/DPasswordEdit 内部子控件,由 DTK 创建,其
objectName/AccessibleId属 DTK 职责,本仓库 PR 不涉及;accessibleFactory仍为其提供 Name 兜底。accessibleFactory 兼容性
accessibledefine.h中的getAccessibleName()无需调整:Name(QAccessible::Name),与定位锚点AccessibleId是独立通道——AccessibleId由 Qt bridge 从objectName链生成,工厂不参与。QAccessibleWidget且未覆写text(QAccessible::Identifier),故 Identifier 走 Qt 默认(空 → 回退 objectName 链),新增setObjectName()即可生效。setAccessibleName优先用于读屏,符合新规则「Name 仅供读屏语义」。许可协议
仅修改
AuthDialog.cpp,其文件头为SPDX-FileCopyrightText: 2017 - 2026,年份已含 2026,无需更新。Closes DDE-166
Summary by Sourcery
为认证对话框控件补全 objectName,以支持基于 AT-SPI 的稳定测试定位。
New Features:
Enhancements: