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. QAccessible and QPushButton
Qt 6.11 is out! See what's new in the release blog

QAccessible and QPushButton

Scheduled Pinned Locked Moved General and Desktop
13 Posts 2 Posters 7.4k 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.
  • raven-worxR Offline
    raven-worxR Offline
    raven-worx
    Moderators
    wrote on last edited by
    #4

    Maybe they will already be set implicitly also by Qt at appropriate places, but make sure and set them manually.

    [quote author="Kudaiv" date="1390217637"]
    I guess i need to set Accessiblename and AccessibleDescription - that's right? And VoiceOver will read accessibleName when focus on my widget?
    [/quote]
    Can't answer that, sry. Never used accessibility on a Mac.

    --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
    If you have a question please use the forum so others can benefit from the solution in the future

    1 Reply Last reply
    0
    • K Offline
      K Offline
      Kudaiv
      wrote on last edited by
      #5

      Ok, i found this post http://stackoverflow.com/questions/3893560/qt-accessible-widgets and it seems easy, so tried like this
      @
      #include <QLabel>
      #include <QtPlugin>

      Q_IMPORT_PLUGIN(qtaccessiblewidgets)

      int main(int argc, char *argv[])
      {
      QApplication a(argc, argv);
      QLabel pb("Hello");
      pb.setAccessibleName("Helloo");
      pb.setAccessibleDescription("Button");
      pb.show();
      return a.exec();
      }
      @

      @QT += core gui

      TARGET = test_voice_over
      TEMPLATE = app

      SOURCES += main.cpp

      HEADERS += WidgetInterface.h

      QTPLUGIN += qtaccessiblewidgets

      @

      every time i've got this error
      "qt_plugin_instance_qtaccessiblewidgets()", referenced from:
      global constructors keyed to mainin main.o
      ld: symbol(s) not found for architecture x86_64

      what's wrong?

      1 Reply Last reply
      0
      • raven-worxR Offline
        raven-worxR Offline
        raven-worx
        Moderators
        wrote on last edited by
        #6

        you do not need this line in your pro-File:
        QTPLUGIN += qtaccessiblewidgets

        the qtaccessiblewidgets plugin is loaded automatically at runtime ifQt is able to find it.

        You only need this line when you build your app statically. Which doesn't look so seeing the rest of the pro-File.

        --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
        If you have a question please use the forum so others can benefit from the solution in the future

        1 Reply Last reply
        0
        • K Offline
          K Offline
          Kudaiv
          wrote on last edited by
          #7

          Thank you! And now i think that my Qt were build with no-accessibility...
          and

          @qt_plugin_instance_qtaccessiblewidgets()”, referenced from: global constructors keyed to mainin main.o
          ld: symbol(s) not found for architecture x86_64
          @
          testifies about it. But i can find qtaccessiblewidgets plugin in standart plugin path...

          1 Reply Last reply
          0
          • K Offline
            K Offline
            Kudaiv
            wrote on last edited by
            #8

            [quote author="raven-worx" date="1390375476"]you do not need this line in your pro-File:
            QTPLUGIN += qtaccessiblewidgets

            the qtaccessiblewidgets plugin is loaded automatically at runtime ifQt is able to find it.

            You only need this line when you build your app statically. Which doesn't look so seeing the rest of the pro-File.
            [/quote]

            Q_IMPORT_PLUGIN(qtaccessiblewidgets)
            this need for static plugins too?

            1 Reply Last reply
            0
            • raven-worxR Offline
              raven-worxR Offline
              raven-worx
              Moderators
              wrote on last edited by
              #9

              yes, see "this":http://qt-project.org/doc/qt-4.8/plugins-howto.html#static-plugins.
              If you link your application dynamically to Qt you don't have to worry about anything in your code. Just that the plugins are located in the correct path.

              --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
              If you have a question please use the forum so others can benefit from the solution in the future

              1 Reply Last reply
              0
              • K Offline
                K Offline
                Kudaiv
                wrote on last edited by
                #10

                it's funny but qt can't load libqtaccessiblewidgets.dylib in runtime
                (i'm using DYLD_PRINT_LIBRARIES=1 QT_DEBUG_PLUGINS=1 myapp)
                so i'm doing something like this
                @ QPluginLoader loader(a.applicationDirPath() + "/../PlugIns/accessible/libqtaccessiblewidgets.dylib");
                qDebug() << a.applicationDirPath();
                bool isLoad = loader.load();
                qDebug() << isLoad << " " << loader.errorString() ; @
                and qt.conf on it's place! And nothing...
                but when i'm using DYLD_PRINT_LIBRARIES=1 QT_DEBUG_PLUGINS=1 myapp i see this
                QFactoryLoader::QFactoryLoader() looking at "/Users/sergey/test_voice_over/test_voice_over.app/Contents/PlugIns/accessible/libqtaccessiblewidgets.dylib"
                keys ("QLineEdit", "QComboBox", "QAbstractSpinBox", "QSpinBox", "QDoubleSpinBox", "QScrollBar", "QSlider", "QAbstractSlider", "QToolButton", "QCheckBox", "QRadioButton", "QPushButton", "QAbstractButton", "QDialog", "QMessageBox", "QMainWindow", "QLabel", "QLCDNumber", "QGroupBox", "QStatusBar", "QProgressBar", "QMenuBar", "Q3PopupMenu", "QMenu", "QHeaderView", "QTabBar", "QToolBar", "QWorkspaceChild", "QSizeGrip", "QAbstractItemView", "QWidget", "QSplitter", "QSplitterHandle", "QTextEdit", "QPlainTextEdit", "QTipLabel", "QFrame", "QStackedWidget", "QToolBox", "QMdiArea", "QMdiSubWindow", "QWorkspace", "QDialogButtonBox", "QDial", "QRubberBand", "QTextBrowser", "QAbstractScrollArea", "QScrollArea", "QCalendarWidget", "QDockWidget")

                and trying to create simpliest app with one button with VoiceOver support
                @int main(int argc, char *argv[])
                {
                QApplication a(argc, argv);

                QPluginLoader loader(a.applicationDirPath() + "/../PlugIns/accessible/libqtaccessiblewidgets.dylib");
                qDebug() << a.applicationDirPath();
                bool isLoad = loader.load();
                qDebug() << isLoad << " " << loader.errorString() ;
                
                QPushButton pb("Hello button");
                pb.show();
                
                return a.exec&#40;&#41;;
                

                }
                @
                WSAA works fine with this code... what's wrong with voice over?

                1 Reply Last reply
                0
                • K Offline
                  K Offline
                  Kudaiv
                  wrote on last edited by
                  #11

                  maybe i should to install some factory of accessible interfaces from qtaccessibleplugin using QAccessible::installFactory ?

                  1 Reply Last reply
                  0
                  • K Offline
                    K Offline
                    Kudaiv
                    wrote on last edited by
                    #12

                    and QAccessibility::isActive everytime returns false ((

                    1 Reply Last reply
                    0
                    • raven-worxR Offline
                      raven-worxR Offline
                      raven-worx
                      Moderators
                      wrote on last edited by
                      #13

                      which version of Qt are you using? Qt 4 or Qt 5?
                      With Qt (5.1?) the accessible support has been "improved ":http://blog.qt.digia.com/blog/2012/06/18/qt-5-accessibility-apis/on Mac OS X.

                      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
                      If you have a question please use the forum so others can benefit from the solution in the future

                      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