I am creating a QPushButton as follows, with no explicit shortcut (&):
testButton = new QPushButton(tr("Start"));
I can correctly read the button's text just after its construction:
testButton.text()
returns 'Start' (without single quotes)
Then I create a signal/slot connection:
QObject::connect(
testButton, &QPushButton::clicked,
this, &Dialog::actionRequest
);
In the Dialog::actionRequest
slot, testButton.text()
returns '&Start', as if a shortcut had been created "somewhere", under the hood.
If I name the button 'Foo', the same phenomenon occurs, but testButton.text()
would return 'F&oo'. That's because I already have a "File" menu, that has an explicit shortcut -- created as:
fileMenu = new QMenu(tr("&File"), this);
and, possibly, Alt+O would be the next "available" shortcut?
I do not want this implicit shortcut creation for my QPushButton. What's the solution to this problem? I'm running Fedora 22 ( with plasma 5), with stock qt 5.5 packages.