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. Setting accessibility label relation for widget
Forum Updated to NodeBB v4.3 + New Features

Setting accessibility label relation for widget

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 1 Posters 201 Views
  • 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.
  • M Offline
    M Offline
    M.Whapples
    wrote on last edited by
    #1

    I am creating an app using PySide6 and I need to set the accessible label for a QComboBox, where the labelling text is on another QLabel in the UI. Reading the docs I find QAccessibleInterface has a relations method which can return any label or labelled relations for the widget, but I do not see how it should be set. A lot of the QT accessibility documentation seems to be discussing how to implement accessibility for custom widgets rather than just using standard QT widgets and setting a single relation and leaving the rest as implemented as standard. Please could someone explain how I can set the label relation between a QLabel and QComboBox? Thanks in advance for any help on this.

    M 1 Reply Last reply
    0
    • M M.Whapples

      I am creating an app using PySide6 and I need to set the accessible label for a QComboBox, where the labelling text is on another QLabel in the UI. Reading the docs I find QAccessibleInterface has a relations method which can return any label or labelled relations for the widget, but I do not see how it should be set. A lot of the QT accessibility documentation seems to be discussing how to implement accessibility for custom widgets rather than just using standard QT widgets and setting a single relation and leaving the rest as implemented as standard. Please could someone explain how I can set the label relation between a QLabel and QComboBox? Thanks in advance for any help on this.

      M Offline
      M Offline
      M.Whapples
      wrote on last edited by
      #2

      I have found the answer, or at least what I think is the answer. Providing it here in case anyone else ever has this problem, I don't think it was very obviousm It seems to be to use QLabel.setBuddy(arg) on the label object passing it the widget to be labelled. Making this call gets NVDA to correctly identify the label for the widget.

      1 Reply Last reply
      0
      • M M.Whapples has marked this topic as solved on

      • Login

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