Unsolved Undesirable auto set hot keys on buttons
-
In this example output is: QKeySequence("Alt+H")
Opensuse 42.2, qt 5.6.1
Is it bug or i can disable this behavior ?int main(int argc, char *argv[]) { QApplication app(argc, argv); QPushButton *b = new QPushButton("Hello"); b->setShortcut(QKeySequence("Ctrl+Q")); QObject::connect(b, &QPushButton::clicked, [b]() { qDebug() << b->shortcut(); }); b->show(); return app.exec(); }
But If this example builded with manually builded qt 5.6.1 from source, then it works fine: hot key is "Ctrl+Q".
Is it some configuration in system qt to auto assign hot keys ? -
Hi,
Pretty surprising indeed... What is
Ctrl + H
Alt + H
used for in your system ? -
Hi
Hot key "Alt+H" is nothing in my system
"Alt+H" is set because for letter "H" in word "Hello", qt auto set this and understroke it with alt pressed.
And if i put many buttons on form - qt try to set for all of them hot keys with "Alt"
This is only for system qt, and i dont understand why. -
I didn't realise before but
Alt+H
looks like an accelerator. Might be a silly question but are you using"&Hello"
in your code ? -
No "&Hello" in code, no any "&" symbols in any buttons name.
But accelerator is set - that is strange.Same affect i see in any qt applications in suse linked with sustem qt: kcalc, system settings ...
I guess this some sort of configuration or settings for this behavior in system, but dont know where it and why it not affected on manually build qt and app. -
That's something to check with the SUSE folks.
-
@SGaist said in Undesirable auto set hot keys on buttons:
That's something to check with the SUSE folks.
maybe, but how suse can effect on qt libs and set some hot keys if they not in my code ?
upd: tested this app on xubuntu/kubuntu 16.04 (same machine, same qt 5.6.1, same binary)
login as xubuntu - hot key is my "Ctrl+Q" - ok
login as kubuntu - hot key is not my "Alt-H" - not ok
So KDE(plasma, some else) can force change my hotkeys for my buttons in my app ?
How qt allow this ?upd2: found solution http://stackoverflow.com/questions/32688153/how-to-disable-automatic-mnemonics-in-a-qt-application-on-kde
and bug is exists -
Thanks for sharing your findings !