Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Accessibility problems

    General and Desktop
    3
    6
    1288
    Loading More Posts
    • 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.
    • A
      AndreiTuicu last edited by

      Hello everyone!

      I have some problems with the Qt Accessibility API, maybe some of you can help me with them.

      So first of all, my main problem is that I can't seem to be able to get any new feedback from the screen reader when calling the QAccessbile::updateAccessbility static method.

      For example, I have a Custom class that inherits QSlider and I'm updating the value of the slider. Shouldn't this code make the screen-reader tell the new value of the slider?
      @
      this->setValue(value()+10);
      QAccessibleValueChangeEvent event(this, value());
      QAccessible::updateAccessibility(&event);
      @
      Am I doing something wrong here?

      Other questions:

      1. Must a widget have focus when QAccessible::updateAccessibility method is called?
      2. If the answer to the previous question is yes, how can I make the screen-reader see the informations for QObjets since they can't get focus?
      3. Is there a way to send a string to the screen-reader and say something like "read this"?

      Thank you!
      Andrei

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi,

        Disclaimer: I'm no specialist in this field. There's currently work done to improve accessibility support, have a look at Qt's mailing list on the subject.

        AFAIK, QSlider should already be accessible aware, so I wonder if you really need to add that code. Anyway, something looks wrong here:

        @QAccessibleValueChangeEvent event(this, value());@

        None of the constructors take a value as a parameter.

        By the way, which version of Qt and on which OS are you working ?

        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 Reply Quote 0
        • A
          AndreiTuicu last edited by

          Hello, SGaist! Thanks for your reply!

          I'm running Qt 5.3 on Windows 7.

          I know that there is still work being done, but I don't know what is finished and what isn't. I already tried the Accessibility mailing list, but nobody answered... After creating this post I also sent a bug report, because I've tried this for over a week now. I've uploaded the whole testing project there.
          https://bugreports.qt-project.org/browse/QTBUG-40313

          Yes, the QSlider already has accessibility implemented already, but this is just a project for testing. In the project that I'm supposed to add support for accessibility there are a lot of custom classes, that should have custom behavior, that's why I'm trying to implement this myself.

          The QAccessibleChangeEvent, has a QVariant as a second parameter. Isn't that the way to create it? I have to say that I don't understand completly how QVariant works, but I also tried instantiating other kinds of events that don't have it and don't work either.

          What I'm really interesed in telling the screen-reader that the accessibility informations have changed and I want it to read them. For example if I put a message in the status bar, I want it to read that message.

          Andrei

          1 Reply Last reply Reply Quote 0
          • SGaist
            SGaist Lifetime Qt Champion last edited by

            QAccessibleChangeEvent ?

            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 Reply Quote 0
            • A
              AndreiTuicu last edited by

              No such event...

              There is however the QAccessibleEvent(QObject o, QAccessible::Event)
              where I can set the Event type to anything I want. The code that I gave is just an example. I don't receive any update, no matter what type of event I'm using.

              But does the QAccessibleValueChangeEvent do anything for you? Or for that matter calling the QAccessible::updateAccessibility method? Does the screen-reader tell you anything new?

              Thank you!
              Andrei

              1 Reply Last reply Reply Quote 0
              • V
                Vadi2 last edited by

                Coming back to this topic in 2022 with Qt 5.15 for windows/linux/macos, and I have exactly the first same 3 questions as OP posted:

                1. Must a widget have focus when QAccessible::updateAccessibility method is called?
                2. If the answer to the previous question is yes, how can I make the screen-reader see the informations for QObjets since they can't get focus?
                3. Is there a way to send a string to the screen-reader and say something like "read this"?

                Anyone have the answers to this?

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post