Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.5.8, 6.8.3, 6.9.0
-
macOS 14.7.2
Description
TEST 1
Code
Qt Widgets version:
#include <QtWidgets> int main(int argc, char *argv[]) { QApplication a(argc, argv); QTextEdit te; te.setWindowTitle("Qt Widgets Window"); te.show(); return a.exec(); }
Qt Quick version:
import QtQuick.Controls.Basic ApplicationWindow { width: 400 height: 300 visible: true title: "Qt Quick Window" TextArea { anchors.fill: parent } }
Steps to reproduce
Use Xcode's Accessibility Inspector to examine...
- ...the text input area of one of the Qt applications above
- ...the text input area of one of the native macOS TextEdit app
Outcomes
- (Step #1) Qt's "Text View" automation type has "None" as the value for its "Window" property (Not expected)
- (Step #2) The macOS TextEdit's "Text View" automation type has a valid value for its "Window" property (Expected)
TEST 2
Code
#include <QApplication> #include <QMainWindow> #include <QTextEdit> #include <QAccessibleWidget> class MyAccessibleWidget : public QAccessibleWidget { public: explicit MyAccessibleWidget(QWidget *w, const QString &name = "MyWidget") : QAccessibleWidget(w, QAccessible::EditableText, name) {} QString text(QAccessible::Text) const override { qDebug("MyAccessibleWidget::text() called"); return QStringLiteral("Am I accessible?"); } QWindow *window() const override { qDebug("MyAccessibleWidget::window() called"); return QAccessibleWidget::window(); } }; static QAccessibleInterface *myFactoryFunction(const QString &, QObject *object) { auto te = qobject_cast<QTextEdit*>(object); return te ? new MyAccessibleWidget(te) : nullptr; } int main(int argc, char *argv[]) { QApplication app(argc, argv); QAccessible::installFactory(&myFactoryFunction); QMainWindow mw; mw.setCentralWidget(new QTextEdit(&mw)); mw.show(); return app.exec(); }
Steps to reproduce
- Build and run the code above for both Windows and macOS
- Use the platform's accessibility checker to examine the QTextEdit of the example, while monitoring the qDebug output
- Windows: Accessibility Insights for Windows
- macOS: Accessibility Inspector
Outcomes
- (Windows) The console output shows that both MyAccessibleWidget::text() and MyAccessibleWidget::window() are called many times (Expected)
- (macOS) The console output shows that only MyAccessibleWidget::text() is called; MyAccessibleWidget::window() is never called (Not expected)