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

All QML Item properties named value inappropriately send QAccessibleValueChangeEvent

XMLWordPrintable

    • Linux/Wayland
    • 38f5768bc (dev)

      The property value has special semantics in at least some accessibility frameworks, and Qt implements this through QAccessibleValueInterface and QAccessibleValueChangeEvent. Even the QAccessible documentation points out that "the type ValueChange indicates that the position of a slider has been changed."

      QtQuick's Accessible attached property seems to send such a QAccessibleValueChangeEvent each time an Item's value property change event is sent. This is not appropriate, as QAccessibleValueChangeEvent should only be used with things implementing QAccessibleValueInterface, and value is an appealing property name that developers are likely to use for many things where this interface is not relevant.
       
      Small example that triggers the issue:

      import QtQuick
      import QtQuick.Controls
      
      Button {
          text: value
          property int value: 0
          onClicked: value++
      }
      

      Running this on Linux with qml while assistive technologies are enabled (e.g. orca running) causes an error of the following form to be printed each time the button is pressed:

      qt.accessibility.atspi: ValueChanged event and no ValueInterface or ComboBox: QAccessibleInterface(0x5ce4d8c9b6b0 name="4" role=Button obj=Button_QMLTYPE_1_QML_12(0x5ce4d8c42a00)"focusable|focused"rect=QRect(0,0 80x35))

      The incorrect assignment seems to happen at around line 350 in qquickaccessibleattached.cpp/ line 193 of qquickaccessibleattached_p.h, but I'm not 100% sure I followed this correctly so this may be wrong.

      Alternatively, atspiadaptor could be adjusted to not print a warning here, but sending a QAccessibleValueChangeEvent seems semantically wrong here.

      This is causing issues in KF6's kquickcharts, where the LegendDelegate's value property is used to display values in a Legend. This is used for e.g. system monitor widgets, which change very frequently, often multiple times per second, permanently. Displaying a few of these can cause a dozen warnings to be printed per second. See downstream issue.

        For Gerrit Dashboard: QTBUG-133564
        # Subject Branch Project Status CR V

            mhqanbari MohammadHossein Qanbari
            cwo Christoph Wolk
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes