I'm having a problem. I can't seem to make the screen reader tell the shorcut keys along with the option's name for a QAction contained in a QMenu. For example instead of "Open...", I would like the screen reader to tell me "Open... Ctrl+O".

As I see it, the problem is that the screen reader only sees the QAction::text() property. So if I do something like this:
Qt Code:
  1. QMenuBar* menus = this->menuBar();
  2. QMenu* fileMenu = new QMenu("&File", menus);
  3. //I want to do something that is the equivalent of this two lines,
  4. //but for QAction
  5. fileMenu->setAccessibleName("File");
  6. fileMenu->setAccessibleDescription("Alt+F");
  7. QAction* openAction = new QAction("Open", fileMenu);
  8. openAction->setShortcut(QKeySequence::fromString("Ctrl+O"));
  9. fileMenu->addAction(openAction);
  10. menus->addMenu(fileMenu);
To copy to clipboard, switch view to plain text mode 
I get something like this:
example1.jpg
|File|

|Open Ctrl+O|

And the screen reader tells me for File "File Menu Alt+F", but for Open option just "Open".

If I try and do something like:

Qt Code:
  1. openAction->setText(openAction->text() + " " + openAction->shortcut().toString());
To copy to clipboard, switch view to plain text mode 

I get something like this:
ex1.jpg

The screen-reader tells me now "Open Ctrl+O", but as you can see it duplicates the string for shortcut.

What I've tried so far: setting all the properties that I could see (for example QAction::setWhatsThis, QAction::setIconText, etc.)

I've found a small hack that I could use; I could do something like:

Qt Code:
  1. openAction->setText(openAction->text() + "\n\n\n"+ openAction->shortcut().toString());
To copy to clipboard, switch view to plain text mode 
But this cuts a bit from the top of the text ("Open"). So a way to allign the text in order for it not be cut when I use this hack would do for now.
ex2.png

I'm open to any suggestions. I think that there are ways to do this using the statusBar, but I don't know how. I hope I made myself clear... Thank you for your help!