Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
QKeyEvent::text() doesn't return accent letter on Linux
Does anyone know why QKeyEvent::text() for typing ` + a returns one empty string and one letter a instead of one empty string and the letter à on Linux? Under Windows this seems to be working fine (same application running under Windows and Linux).
I'm handling the pressed keys via this class.
you might see the internals described here:
How did you check the contents of the string exactly? Did you inspect the actual bytecode?
@raven-worx I wrote it to console. The solution seems to be using inputMethod for those composed letters as suggested here on SO https://stackoverflow.com/questions/60020662/qkeyeventtext-doesnt-return-accent-letter-on-linux
Kent-Dorfman last edited by
Keep in mind that how multi-national characters are decoded in linux is dependent upon the settings of the terminal program you are viewing them in. Are the locale environment variables set correctly? Have you installed an appropriate font into linux?
As said, in my case I was missing the "inputMethod". I was not aware that is exists and that it returns composed characters, like accents or Chinese letters.