c++windowsqtaccessibility

QMdiArea containing QMdiSubWindows not visible to accessibility APIs


I am working with a Qt application and trying to implement UI automation through the accessibility interface. This all works well except for the fact that this application has a QMdiArea which contains QMdiSubWindows and anything contained within these sub windows is completely opaque to the automation interface. I tried to inspect the elements through UIAVerify from the Windows SDK which shows the following:

MDI area

These subwindows contain a standard grid layout which contains standard Qt widgets. Since the heirachy here entirely consists of standard Qt widgets and all standard Qt widgets implement the accesibility interface as defined by MSAA I don't understand why all elements in the MDI area are hidden when I can freely access elements in all other areas of the GUI.


Solution

  • Probably the reason is that Qt doesn't register its controls as valid windows. All controls in Qt are painted on one canvas. It is made for optimization reasons.

    Such Qt controls are called alien widgets.

    Good news is that you can make Qt register all controls in Windows. The documentation states some ways to do that:

    The first one is the easiest and doesn't require recompilation of a program.

    I tried it with UIAVerify and got a full tree of MDI controls.