Reputation: 2795
I'm having a difficult time finding how to insert subscripts into a QString. I know it can be done with style sheets, but I can't really use a style sheet in places where I place a QString. I've tried HTML markup and UTF-8 and other unicode systems for substrings with no luck.
Hopefully someone has some more experience with this and can help out!
Upvotes: 1
Views: 2390
Reputation: 12832
Depending on what characters you want to subscript, you may be able to use Unicode subscript characters without formatting.
That of course requires font and text rendering engine that support it. Don't know if Qt on your platform does.
Upvotes: 1
Reputation: 5718
A QString is just a string. If you're dealing with particular Unicode characters which should be subscript then fine, but otherwise what you seem to be trying to do makes no sense.
If you want to display a string with subscript formatting then you can use QTextEdit or other classes which support rich text display. You could do this with HTML markup or programatically using the relevant Qt classes. Try http://qt-project.org/doc/qt-4.8/richtext.html for more information.
Upvotes: 0