Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QT5 accessibility #4258

Closed
nvaccessAuto opened this issue Jul 7, 2014 · 11 comments
Closed

QT5 accessibility #4258

nvaccessAuto opened this issue Jul 7, 2014 · 11 comments

Comments

@nvaccessAuto
Copy link

Reported by tspivey on 2014-07-07 11:21
I wrote a QT app with Python 3.4 and PyQt 5.3. Upon running it, with NVDA,
it doesn't say the button is ocused. Pressing the button with space brings up a message box, but it doesn't read.

Doing the same with narrator on windows 8.1 correctly reads the button, and lets me read the dialog with caps left/right arrow.

This is my first QT anything, so I might have coded it wrong.

Source and binaries: https://dl.dropboxusercontent.com/u/1060978/test_qt.7z

@nvaccessAuto
Copy link
Author

Comment 1 by beqa on 2014-07-07 18:46
hi.

when gaining focus to the window with dialog created with qt, nvda gives this error.

ERROR - eventHandler.executeEvent (22:43:38):
error executing event: gainFocus on <NVDAObjects.Dynamic_FocusableUnfocusableContainerDialogIAccessible object at 0x05829AF0> with extra args of {}
Traceback (most recent call last):
File "eventHandler.pyc", line 143, in executeEvent
File "eventHandler.pyc", line 91, in init
File "eventHandler.pyc", line 98, in next
File "NVDAObjects__init__.pyc", line 862, in event_gainFocus
File "NVDAObjects__init__.pyc", line 806, in reportFocus
File "speech.pyc", line 320, in speakObject
File "speech.pyc", line 238, in speakObjectProperties
File "baseObject.pyc", line 34, in get
File "baseObject.pyc", line 110, in _getPropertyViaCache
File "NVDAObjects\behaviors.pyc", line 133, in get_description
File "NVDAObjects\behaviors.pyc", line 74, in getDialogText
File "baseObject.pyc", line 34, in get
File "baseObject.pyc", line 110, in getPropertyViaCache
File "NVDAObjects\IAccessible__init
.pyc", line 988, in get_children
File "IAccessibleHandler.pyc", line 361, in accessibleChildren
File "oleacc.pyc", line 286, in AccessibleChildren
File "comtypesMonkeyPatches.pyc", line 61, in newVARIANT_value_fget
File "comtypes\automation.pyc", line 367, in get_value
File "comtypes\client\dynamic.pyc", line 28, in Dispatch
File "comtypes\automation.pyc", line 635, in GetTypeInfo
File "comtypes__init
.pyc", line 1078, in QueryInterface
ValueError: NULL COM pointer access

@nvaccessAuto
Copy link
Author

Comment 2 by jteh on 2014-07-11 02:51
That error indicates a definite bug in QT. IUnknown::QueryInterface should never return NULL without also returning E_NOINTERFACE.

@nvaccessAuto
Copy link
Author

Comment 4 by mdcurran on 2014-08-02 02:38
I'm pretty sure that the problem is in qtbase at

src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp:
HRESULT ST
DMETHODCALLTYPE QWindowsMsaaAccessible::GetTypeInfo(unsigned int, unsigned long,
 ITypeInfo **pptinfo)

This, and also GetTypeInfoCount, both simply place 0 in pctinfo and return S_OK. The comment in both of these methods suggests that these methods are not needed as qt does not have a type library.
These are badly implemented as they should return E_NOTIMPL or at least something other than S_OK.
I'll investigate how to get this reported to QT.

@nvaccessAuto
Copy link
Author

Comment 5 by vgjh2005 on 2014-11-13 12:47
Hi:
However, I find a qt control. I cannot read its tree item by pressing arror keys. The LOG is below:
Developer info for navigator object:
name: u'\u6211\u7684\u597d\u53cb\x00'
role: ROLE_TREEVIEW
states: STATE_FOCUSABLE, STATE_FOCUSED
isFocusable: True
hasFocus: True
Python object: <NVDAObjects.IAccessible.qt.Container object at 0x05B018F0>
Python class mro: (<class 'NVDAObjects.IAccessible.qt.Container'>, <class 'NVDAObjects.IAccessible.IAccessible'>, <class 'NVDAObjects.window.Window'>, <class 'NVDAObjects.NVDAObject'>, <class 'baseObject.ScriptableObject'>, <class 'baseObject.AutoPropertyObject'>, <type 'object'>)
description: None
location: (626, 151, 285, 365)
value: None
appModule: <'appModuleHandler' (appName u'yy', process ID 6108) at address 5b01f70>
appModule.productName: u'YY'
appModule.productVersion: u'7.0.0.2'
TextInfo: <class 'NVDAObjects.NVDAObjectTextInfo'>
windowHandle: 395064
windowClassName: u'QWidget'
windowControlID: 0
windowStyle: -1777991680
windowThreadID: 3372
windowText: u'YY7.0'
displayText: u''
IAccessibleObject: <POINTER(IAccessible) ptr=0x33aa18 at 56bcdf0>
IAccessibleChildID: 0
IAccessible event parameters: windowHandle=395064, objectID=-4, childID=930
IAccessible accName: u'\u6211\u7684\u597d\u53cb\x00'
IAccessible accRole: ROLE_SYSTEM_OUTLINE
IAccessible accState: STATE_SYSTEM_FOCUSED, STATE_SYSTEM_FOCUSABLE, STATE_SYSTEM_VALID (1048580)
IAccessible accDescription: None
IAccessible accValue: None

@nvaccessAuto
Copy link
Author

Comment 6 by Michael Curran <mick@... on 2015-01-30 01:50
In [68f6de7]:

Monkeypatch comtypes to get around a bug in comtypes where GetTypeInfo does not check if it gets a NULL pointer before calling QueryInterface. This is shown up due to a bug in QT5 that does not return an error when it hands back a NULL pointer. Re #4258

@nvaccessAuto
Copy link
Author

Comment 7 by Michael Curran <mick@... on 2015-01-30 01:51
In [46497b5]:

Merge branch 't4258' into next. Incubates #4258

Changes:
Added labels: incubating

@nvaccessAuto
Copy link
Author

Comment 8 by Michael Curran <mick@... on 2015-03-16 05:48
In [27c857f]:

Merge branch 't4258'. Fixes #4258

Changes:
Removed labels: incubating
State: closed

@nvaccessAuto
Copy link
Author

Comment 9 by mdcurran on 2015-03-16 22:44
Changes:
Milestone changed from None to 2015.2

@nvaccessAuto
Copy link
Author

Comment 10 by beqa on 2015-03-22 11:23
hi.

in every qt app when going to its window with alt+tab path to the executable is announced which is from my point of view extraneous information.

is it correctly implemented or that is also some sort of bug?

thank you.

@nvaccessAuto
Copy link
Author

Comment 11 by gregjozk_ on 2015-10-07 22:24
Found another QT application, where accessibility is broken. It is Calibre. Is there any problem on NVDA's side, or is there only bad coding? Problematic apps are also VLC, Qbit Torrent, Virtual Box and other QT apps. I opened accessibility related ticket on Calibre side too (see link below).

https://bugs.launchpad.net/calibre/+bug/1503896

@nvaccessAuto
Copy link
Author

Comment 12 by jteh on 2015-10-07 23:11
VirtualBox is definitely QT 4, not QT 5, and even then, it just doesn't enable accessibility at all for some parts. I suspect the same for at least some of the other apps. Most of these issues are almost certainly problems in the apps or perhaps bugs in QT itself, but I'd have to test each and every one to be sure and I don't have the time to do that.

@nvaccessAuto nvaccessAuto added this to the 2015.2 milestone Nov 10, 2015
michaelDCurran added a commit that referenced this issue Nov 23, 2015
…o does not check if it gets a NULL pointer before calling QueryInterface. This is shown up due to a bug in QT5 that does not return an error when it hands back a NULL pointer. Re #4258
michaelDCurran added a commit that referenced this issue Nov 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant