Background


Using Ubuntu Studio 13.10
Built QT 5.2.0 Beta 1 for both Linux and Windows (static linking)
Built QT Creator 3.0 for Linux
Created a New Application

Drew a UI, didn't write any code, Ensured that the Accessible Names were correctly assigned.  The UI contains:
  • Menu
  • QTextEdit
  • QLineEdit
  • QPlainTextEdit
  • QTextBrowser

Modified the project file:
 
QT       += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

QTPLUGIN += qtaccessiblewidgets
QMAKE_LFLAGS += -static-libgcc -static-libstdc++

TARGET = SimpleBox
TEMPLATE = app
DEFINES += STATIC

SOURCES += main.cpp\
        mainwindow.cpp

HEADERS  += mainwindow.h

FORMS    += mainwindow.ui


Compiled for Windows, and used with Jaws 14.
  • Noted that the libgcc and libstdc++ dll files still appear to be required
  • The menu speaks, but the braille display does not show anything
  • The  QTextEdit does not speak contents, or show anything on the braille display
  • The  QLineEdit does not speak contents, or show anything on the braille display
  • The  QPlainTextEdit does not speak contents, or show anything on the braille display
  • The QTextBrowser does not show anything on the braille display, but Jaws 14 does read out the contents.
Tried running with NVDA, with exactly the same results.

Preliminary Research

Q_IMPORT_PLUGIN

Done some background reading into the way you should configure your code, and found references to:

QTPLUGIN += qtaccessiblewidgets
Q_IMPORT_PLUGIN(qtaccessiblewidgets)

Well, the first (QTPLUGIN) appears to be necessary, and when included, the Makefile generated by qmake already includes the -lqtaccessiblewidgets library:

Extract from Makefile

LIBS = -lmingw32 -lqtmain -L/opt/i686-w64-mingw32/lib -L/opt/i686-w64-mingw32/plugins/accessible -lqtaccessiblewidgets -lQt5Widgets -L/opt/i686-w64-mingw32/plugins/platforms -lqwindows -lwinspool -lshlwapi  -lQt5PlatformSupport -lQt5Gui -lcomdlg32 -loleaut32 -limm32 -l winmm -lglu32 -lopengl32 -lgdi32 -lQt5Core -lole32 -luuid -lws2_32 -ladvapi32 -lshell32 -luser32 -lkernel32

The second line (Q_IMPORT_PLUGIN), which is supposed to be added into the main.cpp file gives the following error:

Undefined reference to qt_static_plugin_qtaccessiblewidgets

This is understandable, as there is no such function in the qtaccessible library.  The actual function name is qt_static_plugin_AccessibleFactory, and this Q_IMPORT_PLUGIN statement is automatically generated by qmake, and put in the file xxxxx_plugin_import.cpp in the build area.

Current Understanding: QTPLUGIN is required in the .pro file, but the Q_IMPORT_PLUGIN line is now automatically generated by qmake, and the line is not required.

Tried With Dynamic Linking

As there were problems with the 5.2.0 Beta 1 version of QT (unable to compile due to incorrect source code requiring code to be patched), I downloaded the 5.2.1 release (Feb 5th 2014).  This version claims to be executable compatible with 5.2.0 - we will see.

Re-built QT5 (in the source directory), with the following configuration:

./configure -shared -release -opensource -confirm-license \
      -make libs -nomake tests -nomake examples \
      -no-compile-examples \
      -accessibility \
      -no-sse2 -no-sse3 -no-ssse3 -no-sse4.1 -no-sse4.2 \
      -no-avx -no-avx2 -no-neon -no-mips_dsp -no-mips_dspr2 \
      -no-gif \
      -optimized-qmake -reduce-relocations -no-pch \
      --xplatform=win32-g++ \
      -device-option CROSS_COMPILE=/usr/bin/i686-w64-mingw32- \
      --prefix=/opt/i686-w64-mingw32-shared | tee config.log 2>&1