Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-95029

QPushButton "enabled" accessibility property not reported on macOS

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.15.5
    • None
    • macOS 10.14.6, macOS 10.15.7, macOS 11.4
    • macOS

    Description

      We are looking to move from our current Qt version (5.12.11) to the latest Qt5 LTS of 5.15.5

      The problem we have is that we have an extensive system integration test suite for our product on macOS, and the majority of our tests interacting with dialogs are currently failing because we cannot determine whether QPushButtons (mostly buttons residing inside a QDialogButtonBox) are enabled/disabled appropriately.

      Our implementation to test this is using the standard accessibility APIs provided by the Application Services framework on macOS.

      We can find and interact with the button, but a query for the property kAXEnabledAttribute fails.

      I put together a basic standalone Qt app to show a basic window with a QPushButton on it, the label for the button is "Start Watching". I then modified our automation tool to find the button and print all of the available attributes and their values.

      When I compile my sample app with Qt 5.12.11 I get the following output, note the presence of AXEnabled

       

      {
          AXChildren = "(\n)";
          AXDescription = "Start Watching";
          AXEnabled = 1;
          AXFocused = 0;
          AXFrame = "<AXValue 0x7f8462f04960> {value = x:1050.000000 y:566.000000 w:113.000000 h:32.000000 type = kAXValueCGRectType}";
          AXParent = "<AXUIElement 0x7f8462d078f0> {pid=44727}";
          AXPosition = "<AXValue 0x7f8462f04ec0> {value = x:1050.000000 y:566.000000 type = kAXValueCGPointType}";
          AXRole = AXButton;
          AXRoleDescription = button;
          AXSize = "<AXValue 0x7f8462c108d0> {value = w:113.000000 h:32.000000 type = kAXValueCGSizeType}";
          AXTitle = "Start Watching";
          AXTopLevelUIElement = "<AXUIElement 0x7f8462c108d0> {pid=44727}";
          AXWindow = "<AXUIElement 0x7f8462d08430> {pid=44727}";
      }
      

      When compiling against Qt 5.15.5, I get the following, note that AXEnabled is not present

      {
          AXChildren = "(\n)";
          AXDescription = "Start Watching";
          AXFocused = 0;
          AXFrame = "<AXValue 0x7f96d6c10cd0> {value = x:1050.000000 y:566.000000 w:113.000000 h:32.000000 type = kAXValueCGRectType}";
          AXInsertionPointLineNumber = 0;
          AXNumberOfCharacters = 0;
          AXParent = "<AXUIElement 0x7f96d6d08aa0> {pid=43528}";
          AXPosition = "<AXValue 0x7f96d6d08aa0> {value = x:1050.000000 y:566.000000 type = kAXValueCGPointType}";
          AXRole = AXButton;
          AXRoleDescription = button;
          AXSelectedTextRange = "<AXValue 0x7f96d6c10250> {value = location:0 length:0 type = kAXValueCFRangeType}";
          AXSize = "<AXValue 0x7f96d6d08aa0> {value = w:113.000000 h:32.000000 type = kAXValueCGSizeType}";
          AXTitle = "Start Watching";
          AXVisibleCharacterRange = "<AXValue 0x7f96d6c10f10> {value = location:0 length:14 type = kAXValueCFRangeType}";
      }
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            smd Jan Arve
            paulthexton Paul Thexton
            Votes:
            3 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes