NVDA with Qt results in wrong interface request

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

NVDA with Qt results in wrong interface request

Nikos Chantziaras
I'm trying to make my Qt application accessible to screen readers. I
managed to make it work with the Orca screen reader under Linux, but
with NVDA under Windows 7, it doesn't work correctly.

It's a text-heavy application, so IAccessibleText and
IAccessibleEditableText are the interfaces I've implemented for the text
output of the application (QAccessibleTextInterface and
QAccessibleEditableTextInterface in Qt), with a role of
QAccessible::EditableText.

With Orca in Linux, I correctly get requests for a
QAccessibleTextInterface instance. Thus, all my implemented interface
functions, like selection(), textBeforeOffset (), etc, get called, and
Orca can see my text.

With NVDA in Windows however, this doesn't happen. Instead, I just get
requests for an IAccessibleValue interface
(QAccessible::ValueInterface). As a result, NVDA never calls
IAccessibleText functions and thus it can't see my text, unless I just
return the whole text as a value in one huge string. NVDA sees the text
in that case. But that means there's no selection support, no text
insertion signal support, no mouse support, etc.

As far as I can tell, standard Qt widgets behave the same way with NVDA
(and only with NVDA; Orca works fine.) If I create a QTextEdit widget
for example, when I select text in it, NVDA does not read it, nor does
it read the text under the mouse cursor as I move it. It does speak out
the word "edit", which means it recognized the role of the object, but
then it tries to get an IAccessibleValue instead of an IAccessibleText
interface.

Has anyone else encountered this issue? Am I doing something wrong here?

I'm using Qt 5.9.1, but I also tried older versions with the same result.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Nvda-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nvda-devel
Reply | Threaded
Open this post in threaded view
|

Re: NVDA with Qt results in wrong interface request

James Teh
This is certainly odd. NVDA never queries for IAccessibleValue. We do call IAccessible::accValue, so I guess it's possible Qt internally queries for QAccessibleValue to answer that request. However, we only call that if the role isn't editable text or we couldn't get the IAccessibleText interface. Certainly, I can use Qt editable text fields on my system with NVDA quite well.

  1. Are you running another assistive technology simultaneously? That might interfere with NVDA's ability to register necessary components. Note that having another AT product installed is fine, but running two screen readers at the same time, for example, is likely to cause problems.
  2. Have you tested this with a Qt5 application built by someone else? I wonder if something could be weird in the build environment. This seems unlikely, but worth checking.
  3. Try cleanly downloading NVDA, running a temporary copy and seeing if the problem persists. If you have a virus scanner or other security software, disable it temporarily to be sure it isn't interfering.
Failing all of that, please try the following:
  1. Focus one of the problematic editable text controls.
  2. Open the NVDA Python Console by pressing NVDA+control+z.
  3. Enter the following (all on one line):
    import IAccessibleHandler as iah; nav.IAccessibleObject; nav.IAccessibleObject.QueryInterface(IAccessibleText)
  4. Provide the resulting output in your reply.
Thanks.

Jamie

On Thu, Jul 6, 2017 at 5:35 PM, Nikos Chantziaras <[hidden email]> wrote:
I'm trying to make my Qt application accessible to screen readers. I managed to make it work with the Orca screen reader under Linux, but with NVDA under Windows 7, it doesn't work correctly.

It's a text-heavy application, so IAccessibleText and IAccessibleEditableText are the interfaces I've implemented for the text output of the application (QAccessibleTextInterface and QAccessibleEditableTextInterface in Qt), with a role of QAccessible::EditableText.

With Orca in Linux, I correctly get requests for a QAccessibleTextInterface instance. Thus, all my implemented interface functions, like selection(), textBeforeOffset (), etc, get called, and Orca can see my text.

With NVDA in Windows however, this doesn't happen. Instead, I just get requests for an IAccessibleValue interface (QAccessible::ValueInterface). As a result, NVDA never calls IAccessibleText functions and thus it can't see my text, unless I just return the whole text as a value in one huge string. NVDA sees the text in that case. But that means there's no selection support, no text insertion signal support, no mouse support, etc.

As far as I can tell, standard Qt widgets behave the same way with NVDA (and only with NVDA; Orca works fine.) If I create a QTextEdit widget for example, when I select text in it, NVDA does not read it, nor does it read the text under the mouse cursor as I move it. It does speak out the word "edit", which means it recognized the role of the object, but then it tries to get an IAccessibleValue instead of an IAccessibleText interface.

Has anyone else encountered this issue? Am I doing something wrong here?

I'm using Qt 5.9.1, but I also tried older versions with the same result.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Nvda-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nvda-devel


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Nvda-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nvda-devel
Reply | Threaded
Open this post in threaded view
|

Re: NVDA with Qt results in wrong interface request

Nikos Chantziaras
I don't run any other AT software. It's a vanilla Windows 7 install
(Windows 7 Ultimate x64) inside a VM (VMware, Linux host) that I keep
clean by avoiding as much third-party software as possible. It's fully
updated through Windows Update.

I disabled Windows Defender (not just the real-time protection, but the
service too; the process it not loaded at all.)

I created a build on another VM to test (Windows 10), but the result is
the same. The build environments are all MinGW 5.3.0 32-bit for Qt
5.9.1, and MinGW 4.9.2 32-bit for Qt 5.6.2. I don't know if a MSVC
environment and MSVC builds of Qt would change anything?

I get the same behavior in "temporary" mode without installing, in
"portable copy" mode and in fully installed mode. I downloaded a fresh
copy to verify.

For the Python Console, I did:

   1. Start NVDA.
   2. Start the application.
   3. Click inside the text area of the application.
   4. NVDA starts reading the text.
   5. I press NVDA+Ctrl+Z
   6. A maximized window pops up, where I entered the provided Python code.

The output I get is:

 >>> import IAccessibleHandler as iah; nav.IAccessibleObject;
nav.IAccessibleObject.QueryInterface(IAccessibleText)
<POINTER(IAccessible) ptr=0x7f3ea10 at 54faa80>
Traceback (most recent call last):
   File "<console>", line 1, in <module>
NameError: name 'IAccessibleText' is not defined

Which seems to be a failure of some sort. In case it helps, NVDA+F1
gives this in the log:

https://pastebin.com/raw/ri2SqMc0

I noticed that at the start of the log, role is ROLE_EDITABLETEXT but
later on it says ROLE_SYSTEM_TEXT. Not sure if this is significant.


On 07/07/2017 02:27 πμ, James Teh wrote:

> This is certainly odd. NVDA never queries for IAccessibleValue. We do
> call IAccessible::accValue, so I guess it's possible Qt internally
> queries for QAccessibleValue to answer that request. However, we only
> call that if the role isn't editable text or we couldn't get the
> IAccessibleText interface. Certainly, I can use Qt editable text fields
> on my system with NVDA quite well.
>
>  1. Are you running another assistive technology simultaneously? That
>     might interfere with NVDA's ability to register necessary
>     components. Note that having another AT product installed is fine,
>     but running two screen readers at the same time, for example, is
>     likely to cause problems.
>  2. Have you tested this with a Qt5 application built by someone else? I
>     wonder if something could be weird in the build environment. This
>     seems unlikely, but worth checking.
>  3. Try cleanly downloading NVDA, running a temporary copy and seeing if
>     the problem persists. If you have a virus scanner or other security
>     software, disable it temporarily to be sure it isn't interfering.
>
> Failing all of that, please try the following:
>
>  1. Focus one of the problematic editable text controls.
>  2. Open the NVDA Python Console by pressing NVDA+control+z.
>  3. Enter the following (all on one line):
>     import IAccessibleHandler as iah; nav.IAccessibleObject;
>     nav.IAccessibleObject.QueryInterface(IAccessibleText)
>  4. Provide the resulting output in your reply.
>
> Thanks.
>
> Jamie
>
> On Thu, Jul 6, 2017 at 5:35 PM, Nikos Chantziaras <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     I'm trying to make my Qt application accessible to screen readers. I
>     managed to make it work with the Orca screen reader under Linux, but
>     with NVDA under Windows 7, it doesn't work correctly.
>
>     It's a text-heavy application, so IAccessibleText and
>     IAccessibleEditableText are the interfaces I've implemented for the
>     text output of the application (QAccessibleTextInterface and
>     QAccessibleEditableTextInterface in Qt), with a role of
>     QAccessible::EditableText.
>
>     With Orca in Linux, I correctly get requests for a
>     QAccessibleTextInterface instance. Thus, all my implemented
>     interface functions, like selection(), textBeforeOffset (), etc, get
>     called, and Orca can see my text.
>
>     With NVDA in Windows however, this doesn't happen. Instead, I just
>     get requests for an IAccessibleValue interface
>     (QAccessible::ValueInterface). As a result, NVDA never calls
>     IAccessibleText functions and thus it can't see my text, unless I
>     just return the whole text as a value in one huge string. NVDA sees
>     the text in that case. But that means there's no selection support,
>     no text insertion signal support, no mouse support, etc.
>
>     As far as I can tell, standard Qt widgets behave the same way with
>     NVDA (and only with NVDA; Orca works fine.) If I create a QTextEdit
>     widget for example, when I select text in it, NVDA does not read it,
>     nor does it read the text under the mouse cursor as I move it. It
>     does speak out the word "edit", which means it recognized the role
>     of the object, but then it tries to get an IAccessibleValue instead
>     of an IAccessibleText interface.
>
>     Has anyone else encountered this issue? Am I doing something wrong here?
>
>     I'm using Qt 5.9.1, but I also tried older versions with the same
>     result.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Nvda-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nvda-devel
Reply | Threaded
Open this post in threaded view
|

Re: NVDA with Qt results in wrong interface request

James Teh
Your build does not support IAccessible2. I suspect this is because you're using mingw and not MSVC. IAccessible2 requires COM interfaces to be built and I don't think mingw supports this.

On Fri, Jul 7, 2017 at 3:33 PM, Nikos Chantziaras <[hidden email]> wrote:
I don't run any other AT software. It's a vanilla Windows 7 install (Windows 7 Ultimate x64) inside a VM (VMware, Linux host) that I keep clean by avoiding as much third-party software as possible. It's fully updated through Windows Update.

I disabled Windows Defender (not just the real-time protection, but the service too; the process it not loaded at all.)

I created a build on another VM to test (Windows 10), but the result is the same. The build environments are all MinGW 5.3.0 32-bit for Qt 5.9.1, and MinGW 4.9.2 32-bit for Qt 5.6.2. I don't know if a MSVC environment and MSVC builds of Qt would change anything?

I get the same behavior in "temporary" mode without installing, in "portable copy" mode and in fully installed mode. I downloaded a fresh copy to verify.

For the Python Console, I did:

  1. Start NVDA.
  2. Start the application.
  3. Click inside the text area of the application.
  4. NVDA starts reading the text.
  5. I press NVDA+Ctrl+Z
  6. A maximized window pops up, where I entered the provided Python code.

The output I get is:

>>> import IAccessibleHandler as iah; nav.IAccessibleObject; nav.IAccessibleObject.QueryInterface(IAccessibleText)
<POINTER(IAccessible) ptr=0x7f3ea10 at 54faa80>
Traceback (most recent call last):
  File "<console>", line 1, in <module>
NameError: name 'IAccessibleText' is not defined

Which seems to be a failure of some sort. In case it helps, NVDA+F1 gives this in the log:

https://pastebin.com/raw/ri2SqMc0

I noticed that at the start of the log, role is ROLE_EDITABLETEXT but later on it says ROLE_SYSTEM_TEXT. Not sure if this is significant.


On 07/07/2017 02:27 πμ, James Teh wrote:
This is certainly odd. NVDA never queries for IAccessibleValue. We do call IAccessible::accValue, so I guess it's possible Qt internally queries for QAccessibleValue to answer that request. However, we only call that if the role isn't editable text or we couldn't get the IAccessibleText interface. Certainly, I can use Qt editable text fields on my system with NVDA quite well.

 1. Are you running another assistive technology simultaneously? That
    might interfere with NVDA's ability to register necessary
    components. Note that having another AT product installed is fine,
    but running two screen readers at the same time, for example, is
    likely to cause problems.
 2. Have you tested this with a Qt5 application built by someone else? I
    wonder if something could be weird in the build environment. This
    seems unlikely, but worth checking.
 3. Try cleanly downloading NVDA, running a temporary copy and seeing if
    the problem persists. If you have a virus scanner or other security
    software, disable it temporarily to be sure it isn't interfering.

Failing all of that, please try the following:

 1. Focus one of the problematic editable text controls.
 2. Open the NVDA Python Console by pressing NVDA+control+z.
 3. Enter the following (all on one line):
    import IAccessibleHandler as iah; nav.IAccessibleObject;
    nav.IAccessibleObject.QueryInterface(IAccessibleText)
 4. Provide the resulting output in your reply.

Thanks.

Jamie

On Thu, Jul 6, 2017 at 5:35 PM, Nikos Chantziaras <[hidden email] <mailto:[hidden email]>> wrote:

    I'm trying to make my Qt application accessible to screen readers. I
    managed to make it work with the Orca screen reader under Linux, but
    with NVDA under Windows 7, it doesn't work correctly.

    It's a text-heavy application, so IAccessibleText and
    IAccessibleEditableText are the interfaces I've implemented for the
    text output of the application (QAccessibleTextInterface and
    QAccessibleEditableTextInterface in Qt), with a role of
    QAccessible::EditableText.

    With Orca in Linux, I correctly get requests for a
    QAccessibleTextInterface instance. Thus, all my implemented
    interface functions, like selection(), textBeforeOffset (), etc, get
    called, and Orca can see my text.

    With NVDA in Windows however, this doesn't happen. Instead, I just
    get requests for an IAccessibleValue interface
    (QAccessible::ValueInterface). As a result, NVDA never calls
    IAccessibleText functions and thus it can't see my text, unless I
    just return the whole text as a value in one huge string. NVDA sees
    the text in that case. But that means there's no selection support,
    no text insertion signal support, no mouse support, etc.

    As far as I can tell, standard Qt widgets behave the same way with
    NVDA (and only with NVDA; Orca works fine.) If I create a QTextEdit
    widget for example, when I select text in it, NVDA does not read it,
    nor does it read the text under the mouse cursor as I move it. It
    does speak out the word "edit", which means it recognized the role
    of the object, but then it tries to get an IAccessibleValue instead
    of an IAccessibleText interface.

    Has anyone else encountered this issue? Am I doing something wrong here?

    I'm using Qt 5.9.1, but I also tried older versions with the same
    result.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Nvda-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nvda-devel


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Nvda-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nvda-devel
Reply | Threaded
Open this post in threaded view
|

Re: NVDA with Qt results in wrong interface request

Nikos Chantziaras
You are right. I installed the Visual C++ 2015 Build Tools along with an
MSVC build of Qt, and that works. NVDA now requests IAccessibleText
interfaces.

In my defense, this was documented nowhere in Qt's accessibility
documentation :-/

In any event, thank you very much for your help!


On 07/07/2017 09:25 πμ, James Teh wrote:

> Your build does not support IAccessible2. I suspect this is because
> you're using mingw and not MSVC. IAccessible2 requires COM interfaces to
> be built and I don't think mingw supports this.
>
> On Fri, Jul 7, 2017 at 3:33 PM, Nikos Chantziaras <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     I don't run any other AT software. It's a vanilla Windows 7 install
>     (Windows 7 Ultimate x64) inside a VM (VMware, Linux host) that I
>     keep clean by avoiding as much third-party software as possible.
>     It's fully updated through Windows Update.
>
>     I disabled Windows Defender (not just the real-time protection, but
>     the service too; the process it not loaded at all.)
>
>     I created a build on another VM to test (Windows 10), but the result
>     is the same. The build environments are all MinGW 5.3.0 32-bit for
>     Qt 5.9.1, and MinGW 4.9.2 32-bit for Qt 5.6.2. I don't know if a
>     MSVC environment and MSVC builds of Qt would change anything?
>
>     I get the same behavior in "temporary" mode without installing, in
>     "portable copy" mode and in fully installed mode. I downloaded a
>     fresh copy to verify.
>
>     For the Python Console, I did:
>
>        1. Start NVDA.
>        2. Start the application.
>        3. Click inside the text area of the application.
>        4. NVDA starts reading the text.
>        5. I press NVDA+Ctrl+Z
>        6. A maximized window pops up, where I entered the provided
>     Python code.
>
>     The output I get is:
>
>      >>> import IAccessibleHandler as iah; nav.IAccessibleObject;
>     nav.IAccessibleObject.QueryInterface(IAccessibleText)
>     <POINTER(IAccessible) ptr=0x7f3ea10 at 54faa80>
>     Traceback (most recent call last):
>        File "<console>", line 1, in <module>
>     NameError: name 'IAccessibleText' is not defined
>
>     Which seems to be a failure of some sort. In case it helps, NVDA+F1
>     gives this in the log:
>
>     https://pastebin.com/raw/ri2SqMc0 <https://pastebin.com/raw/ri2SqMc0>
>
>     I noticed that at the start of the log, role is ROLE_EDITABLETEXT
>     but later on it says ROLE_SYSTEM_TEXT. Not sure if this is significant.
>
>
>     On 07/07/2017 02:27 πμ, James Teh wrote:
>
>         This is certainly odd. NVDA never queries for IAccessibleValue.
>         We do call IAccessible::accValue, so I guess it's possible Qt
>         internally queries for QAccessibleValue to answer that request.
>         However, we only call that if the role isn't editable text or we
>         couldn't get the IAccessibleText interface. Certainly, I can use
>         Qt editable text fields on my system with NVDA quite well.
>
>           1. Are you running another assistive technology
>         simultaneously? That
>              might interfere with NVDA's ability to register necessary
>              components. Note that having another AT product installed
>         is fine,
>              but running two screen readers at the same time, for
>         example, is
>              likely to cause problems.
>           2. Have you tested this with a Qt5 application built by
>         someone else? I
>              wonder if something could be weird in the build
>         environment. This
>              seems unlikely, but worth checking.
>           3. Try cleanly downloading NVDA, running a temporary copy and
>         seeing if
>              the problem persists. If you have a virus scanner or other
>         security
>              software, disable it temporarily to be sure it isn't
>         interfering.
>
>         Failing all of that, please try the following:
>
>           1. Focus one of the problematic editable text controls.
>           2. Open the NVDA Python Console by pressing NVDA+control+z.
>           3. Enter the following (all on one line):
>              import IAccessibleHandler as iah; nav.IAccessibleObject;
>              nav.IAccessibleObject.QueryInterface(IAccessibleText)
>           4. Provide the resulting output in your reply.
>
>         Thanks.
>
>         Jamie
>
>         On Thu, Jul 6, 2017 at 5:35 PM, Nikos Chantziaras
>         <[hidden email] <mailto:[hidden email]>
>         <mailto:[hidden email] <mailto:[hidden email]>>> wrote:
>
>              I'm trying to make my Qt application accessible to screen
>         readers. I
>              managed to make it work with the Orca screen reader under
>         Linux, but
>              with NVDA under Windows 7, it doesn't work correctly.
>
>              It's a text-heavy application, so IAccessibleText and
>              IAccessibleEditableText are the interfaces I've implemented
>         for the
>              text output of the application (QAccessibleTextInterface and
>              QAccessibleEditableTextInterface in Qt), with a role of
>              QAccessible::EditableText.
>
>              With Orca in Linux, I correctly get requests for a
>              QAccessibleTextInterface instance. Thus, all my implemented
>              interface functions, like selection(), textBeforeOffset (),
>         etc, get
>              called, and Orca can see my text.
>
>              With NVDA in Windows however, this doesn't happen. Instead,
>         I just
>              get requests for an IAccessibleValue interface
>              (QAccessible::ValueInterface). As a result, NVDA never calls
>              IAccessibleText functions and thus it can't see my text,
>         unless I
>              just return the whole text as a value in one huge string.
>         NVDA sees
>              the text in that case. But that means there's no selection
>         support,
>              no text insertion signal support, no mouse support, etc.
>
>              As far as I can tell, standard Qt widgets behave the same
>         way with
>              NVDA (and only with NVDA; Orca works fine.) If I create a
>         QTextEdit
>              widget for example, when I select text in it, NVDA does not
>         read it,
>              nor does it read the text under the mouse cursor as I move
>         it. It
>              does speak out the word "edit", which means it recognized
>         the role
>              of the object, but then it tries to get an IAccessibleValue
>         instead
>              of an IAccessibleText interface.
>
>              Has anyone else encountered this issue? Am I doing
>         something wrong here?
>
>              I'm using Qt 5.9.1, but I also tried older versions with
>         the same
>              result.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Nvda-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nvda-devel