QTextEdit and "extended ascii"
I've been trying to figure out how to write what I know as "extended ascii" inside a QTextEdit in such a way that I can write a few of those characters in one color, then change colors (both foreground and background colors) for the next few letters printed and so on.
extended ascii as pictured here:
http://www.asciitable.com/
All of the text that I'm inserting is using QTextEdit::insertHtml. Is there a way to insert these characters in the textEdit?
Right now I've been trying something like:
Create a HTML span tag with color attributes
insert the text I want to print, like QChar (191) for a "top-right corner". But the top right corner character doesn't show up. The characters that I'm getting match these:
http://www.idevelopment.info/data/Pr...ii_table.shtml
How do I get the first set of so called "extended ascii" chars?
Paul
Re: QTextEdit and "extended ascii"
The QTextEdit widget is based on Unicode and not ascii, so probably you won't succeed in achieving what you want through ascii. I suggest using css instead.
Re: QTextEdit and "extended ascii"
Actually, it turns out that it can be done. I just had to use the correct Unicode number when creating a QChar. I used the Windows Character Map to get the hex code and then converted that into decimal and created the QChar with that number. Seems to work fairly well!
Paul
Re: QTextEdit and "extended ascii"
As I said, you wouldn't achieve it through ascii. Using Unicode is a different story.