PDA

View Full Version : Displaying extended ASII characters



WinchellChung
18th July 2007, 17:14
Yes, yet another in a continuing series of newbie questions.

I've got a simple application that allows the user to input a key string and a source string. When they push the XOR button, the app does a simple XOR encryption and displays the result in an output QLineEdit.

Naturally the resulting string is full of characters in the range of 0-31 and 128-255.

Now, I notice that when I have such strings in, say, Microsoft Access, the non-printable characters will print. They appear to be in the Windows extended character set, with lots of angle-bars (e.g., U+2514), astronomical symbols (e.g.,U+263C), and whatnot from the Arial character set.

They do not print in my QLineEdit, though they can be copied and pasted.

I don't suppose there is any way to get those characters to print?

Michiel
19th July 2007, 00:39
QLineEdit should be able to display unicode. So I suppose you could substitute some unicode characters for those ascii characters that would otherwise be invisible. By code.

But if you still want to be able to copy/paste them properly, you might have to extend QLineEdit and reimplement the function that paints the widget. Make it paint other characters than it actually contains. I'm not sure at the moment which function that would be. Take a look in the docs. It will be a virtual one with protected visibility.

WinchellChung
19th July 2007, 14:57
Thanks Michiel!