Hello,

I have some QGraphicsItems onto which text is drawn from a QString, as well as some buttons whose title again is set from a QString. I 'd like that to include superscripts. Hard-coding it like this

Qt Code:
  1. QString text("σ²");
To copy to clipboard, switch view to plain text mode 

works, but I 'd like to superscript an arbitrary number. Ie say there was such a function Qsup then ideally I 'd do something like this:

Qt Code:
  1. QString text("σ" + Qsup(x));
To copy to clipboard, switch view to plain text mode 

What would be the best approach? Is it possible to use one of qt formats that employ html tags and convert that to a QString? If so a short example would be appreciated.

As an aside, it 'd be ideal to load the text data from a file. But I have trouble loading superscript characters from a plain *.txt file (which is what I 'm using now), no matter what encoding I choose. Any hints about that would also be great.

Thanks.