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

a11y: Strikethrough not reported as AT-SPI text attribute

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.7.0 FF
    • dev
    • None
    • Debian testing, self-compiled qtbase git dev as of commit 9a0ae6c13bb8ad6c883285fea6fe494b532fc5e5
    • Linux/X11
    • 56476947c (dev), d2bf45c6e (dev), f67499baa (dev)

    Description

      When strikethrough is applied to a text, that fact is not reported to the accessibility layer and therefore e.g. not announced by screen readers.

      Steps to reproduce using the "notepad" example from qtbase:

      1) slightly modify the example to apply strikethrough when the button to switch to bold is used by adding a few lines to the end of `Notepad::setFontBold` in examples/widgets/tutorials/notepad/notepad.cpp, so that it looks like this (s.a. attached patch that can be applied on top of qtbase dev as of 9a0ae6c13bb8ad6c883285fea6fe494b532fc5e5):

      void Notepad::setFontBold(bool bold)
      {
          bold ? ui->textEdit->setFontWeight(QFont::Bold) :
                 ui->textEdit->setFontWeight(QFont::Normal);
      
          // demo: strikethrough
          QFont font = ui->textEdit->currentFont();
          font.setStrikeOut(true);
          ui->textEdit->setCurrentFont(font);
      }

      2) compile and run the example

      3) press the "Bold" button (to switch to bold and enable strikethrough) and type some text

      4) start Accerciser

      5) in Accerciser's tree of the accessibility hierarchy, navigate to the object representing the text field

      6) in Accerciser, switch to the "Interface Viewer" tab and inspect the reported text attributes

      Actual behavior:

      No attribute is present indicating that the text is crossed out.

      *Expected behavior:
      *

      A "strikethrough:true" attribute should be reported, as is the case when running e.g. the gtk4-demo "Markup" example using Gtk instead.

      Additional notes:

      • Instead of using Accerciser, the Orca screen reader can also be used: start Orca, put the cursor on the bold and crossed-out text and press Orca_Key+F to announce the formatting (with Orca_Key usually being Numpad_Insert).
      • Besides affecting Qt's own widgets, this currently makes it impossible for the qt6 variant of LibreOffice to expose that text is crossed out. (This is the original use case where I ran into this.)

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            michaelweghorn Michael Weghorn
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes