Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.15.1, 6.8.2
-
None
Description
Repro steps:
- Create a QPushButton and attach a QMenu as shown below.
- Open a screen reader such as NVDA.
- Use Tab key to focus the menu button.
- Observe.
Expected results:
- The screen reader describes the button as "collapsed" if it has a menu.
Actual results:
- The screen reader describes the button the same way it would describe a button without a menu.
Additional info:
- My application uses Qt 5.15.1 but I've found the same behavior in QtCreator 16.0 using Qt 6.8.2.
Code sample:
#include <QApplication> #include <QDialog> #include <QMenu> #include <QPushButton> #include <QVBoxLayout> int main(int argc, char *argv[]) { QApplication a(argc, argv); QCoreApplication::setApplicationName("Qt NVDA menu button bug"); QDialog dialog; dialog.setLayout(new QVBoxLayout()); auto menuButton = new QPushButton("With Menu"); menuButton->setMenu(new QMenu()); menuButton->menu()->setAccessibleName("Actions"); menuButton->menu()->addAction("Action 1"); menuButton->menu()->addAction("Action 2"); auto noMenuButton = new QPushButton("Without Menu"); dialog.layout()->addWidget(menuButton); dialog.layout()->addWidget(noMenuButton); return dialog.exec(); }