Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. Python / Qt: Misbehaviour of screen reader compatibility in Ubuntu 22.04
Forum Updated to NodeBB v4.3 + New Features

Python / Qt: Misbehaviour of screen reader compatibility in Ubuntu 22.04

Scheduled Pinned Locked Moved Unsolved Qt for Python
12 Posts 2 Posters 946 Views 1 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
    PythonQTMarlem
    wrote on last edited by
    #3

    I have never programmed graphical user interfaces with PySide2. That's why I can't answer your question.

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

      What are you using for your current application ?

      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
        PythonQTMarlem
        wrote on last edited by
        #5
        from PyQt6 import QtGui, QtWidgets
        from PyQt6.QtGui import QGuiApplication, QIcon
        from PyQt6.QtWidgets import QWidget, QApplication, QLabel, QComboBox, QLineEdit, QPushButton, QFormLayout
        from PyQt6.QtCore import *
        
        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #6

          Then, can you try with PyQt5 ?

          From the looks of your imports, you can simply replace the 6 by 5 once PyQt5 installed.

          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
            PythonQTMarlem
            wrote on last edited by
            #7

            @SGaist said in Python / Qt: Misbehaviour of screen reader compatibility in Ubuntu 22.04:

            PyQt5
            Thank you for your idea! Unfortunately, the same misbehavior is with PyQt5.

            here some code in Ubuntu:

            self.edt_nachname = QLineEdit(self)
            self.edt_nachname.setStyleSheet('font-size: 20px')
            self.edt_nachname.setAccessibleName('Bitte Nachname eingeben')
            self.edt_nachname.setAccessibleDescription('Eingabefeld für Nachname')
            self.edt_nachname.setToolTip('Bitte Nachname eingeben')      
            

            I've been trying to see if using setToolTip helps.

            1 Reply Last reply
            0
            • P Offline
              P Offline
              PythonQTMarlem
              wrote on last edited by
              #8

              I tried to freshly install the screen reader Orca: https://forum.qt.io/topic/138941/python-qt-misbehaviour-of-screen-reader-compatibility-in-ubuntu-22-04/7 . Unfortunately it didn't solve my problem either.

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

                How did you install orca ?

                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
                  PythonQTMarlem
                  wrote on last edited by
                  #10

                  Orca is preinstalled. Sometimes you have to install it in the terminal. I do it like this: sudo apt install orca

                  1 Reply Last reply
                  0
                  • P Offline
                    P Offline
                    PythonQTMarlem
                    wrote on last edited by
                    #11

                    I tried it with PySide6:

                    import sys
                    from PySide6 import QtGui, QtWidgets
                    from PySide6.QtGui import QGuiApplication
                    from PySide6.QtWidgets import QWidget, QApplication, QLabel, QComboBox, QLineEdit, QPushButton, QFormLayout
                    from PySide6.QtCore import *
                    import csv
                    

                    The same wrongdoing!

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

                      Sorry for the very late reply, I tested PySide6 version 6..4.3 (installed using pip in a dedicated environment) on KDE Neon (which is based on Ubuntu 22.04 at this time) and orca 42.0-1ubuntu2 and it worked with the following test script:

                      import sys
                      
                      from PySide6.QtCore import Qt
                      
                      from PySide6.QtWidgets import QApplication
                      from PySide6.QtWidgets import QHBoxLayout
                      from PySide6.QtWidgets import QLabel
                      from PySide6.QtWidgets import QPushButton
                      from PySide6.QtWidgets import QWidget
                      
                      if __name__ == "__main__":
                          app = QApplication(sys.argv)
                      
                          widget = QWidget()
                          widget.setAccessibleDescription("This is a test")
                      
                          label = QLabel("Test")
                          label.setTextInteractionFlags(Qt.TextSelectableByMouse|Qt.TextSelectableByKeyboard)
                      
                          button = QPushButton("Test button")
                          button.setAccessibleDescription("This is a button")
                          button2 = QPushButton("Test button 2")
                          button2.setAccessibleDescription("This is a second button")
                          button2.clicked.connect(lambda: label.setText("New text"))
                      
                          layout = QHBoxLayout(widget)
                          layout.addWidget(label)
                          layout.addWidget(button)
                          layout.addWidget(button2)
                      
                          widget.show()
                      
                          sys.exit(app.exec())
                      

                      Note that I started orca on the command line and the script from another one.
                      Note that something seems of with the QLabel. It seems not listed along the buttons however if you click on it then orca will say its content.

                      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