Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QPushButton does not export enabled accessbility property on macOS (5.15.5 LTS)

QPushButton does not export enabled accessbility property on macOS (5.15.5 LTS)

Scheduled Pinned Locked Moved Unsolved General and Desktop
9 Posts 2 Posters 1.0k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Paul M. Thexton
    wrote on last edited by Paul M. Thexton
    #1

    Hi,

    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}";
    }
    

    Does anybody know if there has been a breaking change for QPushButton accessibility between 5.12 and 5.15 which I need to make code changes to maintain behaviour, or should I raise this as a bug?

    Thanks in advance for any advise/assistance anyone can provide :)

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Intriguing situation ! Since you are using Qt 5.15.5, this means that you have a commercial licence. You should contact the Qt Company directly.

      One thing you can check is the bug report system to see if has already been reported.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • P Offline
        P Offline
        Paul M. Thexton
        wrote on last edited by
        #3

        Thanks @SGaist , I did spend a while scouring the bug report system and didn't find anything... I was hoping that it was simply something changed in Qt that I need to accommodate with code changes, rather than it being a bug :(

        1 Reply Last reply
        0
        • P Offline
          P Offline
          Paul M. Thexton
          wrote on last edited by
          #4

          Just in case anybody else finds this post while looking for the same/similar issue, I've opened a bug here https://bugreports.qt.io/browse/QTBUG-95029

          1 Reply Last reply
          2
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Thanks for the report !

            Can you upload there the minimal application you use to show the difference ?

            That will help pinpoint the problem.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            P 1 Reply Last reply
            0
            • SGaistS SGaist

              Thanks for the report !

              Can you upload there the minimal application you use to show the difference ?

              That will help pinpoint the problem.

              P Offline
              P Offline
              Paul M. Thexton
              wrote on last edited by
              #6

              @SGaist Do you mean the sample Qt app, or my swift app I use to inspect the accessibility elements?

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                I think both could be helpful.

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • P Offline
                  P Offline
                  Paul M. Thexton
                  wrote on last edited by
                  #8

                  @SGaist ok, I've added those to the bug

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    Thanks !

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0

                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved