[Qt-interest] Display Euro Symbol in QTableWidget header.
Wm. G. Urquhart
wgu at wurquhart.co.uk
Wed Nov 18 16:26:39 CET 2009
Colin S. Miller wrote:
> Wm. G. Urquhart wrote:
>> Hi List,
>>
>> I need to create a two line column header that reads "Carbon\n€/tonne"
>> however, I can't get the Euro symbol to appear correctly, can anyone
>> help me please.
>>
> Hi William,
> Are you using a literal € in the string?
>
> As a guess, I'd say that the file is saved in a different locale
> than the QTableWidget is expecting. Probably one is in UTF-8 and
> the other is in ISO-Latin-1. If you can, could you indicate
> what character(s) the QTableWidget is displaying instead of €?
>
> As an experiment, does £ work?
Hi Colin,
Your assumptions are correct and thanks to the previous respondents this
now works as expected.
In fact for the lazy amongst us this works as well.
QString::fromUtf8("Carbon\n\u20AC/tonne")
Thanks all.
--
William
More information about the Qt-interest-old
mailing list