In the code you posted, I don't see any references to Qt at all, other than that this method is in a MainWindow class. Where is the Qt connection?
In the code you posted, I don't see any references to Qt at all, other than that this method is in a MainWindow class. Where is the Qt connection?
<=== The Great Pumpkin says ===>
Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.
There are two things:
1. I'm doing it from Qt application, but it has smaller meaning.
2. It cannot insert character to any Qt5 application - even to itself. That's why I'm thinking about Qt misconfiguration.
The last character I can pass, if U+FFFD, all bigger code points fail (I think the last is U+FFFF, but it's not character by standard).
Last edited by PCXT; 28th October 2020 at 16:49.
Have your read the Qt documentation concerning Unicode? Your problem may be in how you are handling the characters either as input to QString or as output to a Qt-based widget for display.
There are references to "16-bit Unicode", which could be the problem.
<=== The Great Pumpkin says ===>
Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.
PCXT (28th October 2020)
Thanks for the information about Unicode in Qt! I found that another, not related problem I had was caused by casting the characters wrong and now I can process these characters well inside my application (as QStrings), so I worked it around using X selection buffer (lower characters are typed as above, higher - copied through the buffer, good that I can stuff ctrl-ins there).
The problem seems to be not especially in my application's code (which currently is a single form and a button calling the routine), but it may be in Qt configuration in my system, as any X11 "keyboard-simulating" program doing it the similar way as shown in my first post cannot send higher Unicode characters specifically to Qt5-based applications (?or sends and Qt applications can't process them?), even to programs which are from repository, not compiled by me. That's why I suspect some define has been switched wrong during Qt build (I have Qt from Debian repository, so that's why I'm a bit dubious about its build configuration, I had a similar problem before with Qt4's QSerialPort).
So my short reproduction using Linux, xdotool and two applications: In the terminal:
sleep 1; xdotool type "?"
During one second of delay, I switch to another application.
So, it types the smiley into Wx or GTK applications, but not into Qt5 applications, like Qt Creator.
But when I put a lower UTF character, let's try with the last one (replacement sign, U+FFFD):
sleep 1; xdotool type "?"
It is typed into application in both cases.
EDIT:
P.S.
OK, for some reason the emoji I pasted here got replaced with ?, so it may be here or in the forum. The first ? I put in xdotool was U+1F60A character, the second ? was U+FFFD character.
Last edited by PCXT; 28th October 2020 at 21:01.
Bookmarks