NVDA doesn't read QT tree views when you tab to them
Steps to reproduce:
Download the TeamTalk 5 standard (QT) client. Launch it, and tab around the interface. You'll notice that everything reads, minus the tree view. It will read once you're focused on it and press an arrow (assuming there's something to focus), but it still doesn't read when you tab to it.
Actual behavior:
NVDA doesn't read anything when tabbing to a QT tree view.
Expected behavior:
It should handle QT tree views like standard WIN32 tree views.
System configuration
NVDA installed/portable/running from source:
Installed.
NVDA version:
alpha-22944,31ef7c54
Windows version:
Windows 10 2004 (64-bit)
Name and version of other software in use when reproducing the issue:
Any QT application with a tree view, but in my case, I use TeamTalk 5 Standard.
Other information about your system:
N/A
Other questions
Does the issue still occur after restarting your computer?
Yes
Have you tried any other versions of NVDA? If so, please report their behaviors.
No
If add-ons are disabled, is your problem still occurring?
Yes
Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?
Yes
Do you know what version of QT is used in TeamTalk?
We build TeamTalk with QT5.15
OK, after a bit of testing, this seems to be because QT doesn't send a gainFocus event when you tab to the QT tree views. The tree view items do, but not the actual tree view. I'm trying to write an add-on to fix this, but with minimal luck. Do we maybe need to implement a custom NVDA Object?
I also opened an issue on QT bug tracker to report this.
[QTBUG-92964] Tree with only one item not spoken - Qt Bug Tracker https://bugreports.qt.io/browse/QTBUG-92964
So, to clarify, if you focus the tree view, nothing sends a gain focus event, neither the tree view nor the tree view item, until you select a new treeview item? I think this should be fixed in Qt itself. @anrocqt Is there anything you could say about this? @shoogle does Musescore also suffer from this?
Hi, @Oreonan, thanks for reporting this, although I think you reported it slightly incorrectly. This always occurs. Except, for some reason, in the QT TeamTalk TTS settings, the first time you tab to it. Very broken. But it doesn't matter the number of items. @leonardder, you are correct.
It's not present in TTS settings because we don't use the same way to create this tree. TTS settings tree is based on a QModel instead of a standard QTreeWidget.
Yes you are right my issue isn't really correct, I'll edit this.
I have received an answer by a QT member today and this will be probably fix as soon directly by QT.
Awesomeness! :)
In that case, closing this issue because it's external to NVDA and a fix on way. I don't think there's a real benefit in leaving this open until the fix is there.
Hi, here is the answer of a Qt team member regarding this issue with empty tries:
Hi. I investigated this on Windows 10 with NVDA. When you tab into a tree widget with items, Qt is sending a UI Automation focus change notification associated with the focused item inside the tree. When the tree has no items, it will send a focus change notification associated with the tree itself. However, NVDA seems to be ignoring that focus notification. It seems NVDA queries UIA_HasKeyboardFocusPropertyId and it is returned as false, as the GUI-level accessibility classes return false for focusable/focused states for trees. Not sure if/when they should be true, for instance, when the tree has items. I tried to force the focus property to return true for a tree, for testing, but it has caused issues, with NVDA repeating the tree name. Perhaps there is some issue on the NVDA side as well.
So, NVDA have the way to retrieve event focus change, in this case it's maybe an issue on the NVDA side. @leonardder any point of view?
This has finally been fixed by Qt on 6.4 RC. But, as expected by Qt members, now NVDA is read multiple times trees name when you tabing to them.
When I tab to a treeview, E.g. the Server list treeview in the Connect dialog in Teamtalk, and no item is selected, I here: Server list treeview server list server list. When an item is selected, I here: server list treeview public server...
The reason for the duplicated speaking in the first case, is that these treeviews are exposing the treeview label (in this case Server list) via the following UIA properties:
- name
- value pattern's value
- helpText.
The label of the treeview should only be exposed by the UIA name property, and nowhere else.
The reason that this duplication does not occur when an item is selected is because NVDA does not speak as much information for a control when it is a focus ancestor, compared to when it is the focus. this is purely for verbosity reasons.
But the core issue here is that QT is duplicating the label 3 times. It should only expose it via the name property.