Feature: Showing units along with labels

Thiago Macieira thiago at macieira.org
Mon Mar 10 08:16:25 PDT 2014


Em seg 10 mar 2014, às 10:13:45, Lakshman escreveu:
> On Mon, Mar 10, 2014 at 10:07 AM, Thiago Macieira 
<thiago at macieira.org>wrote:
> > [%1]").arg(get_temp_unit().at(1)));
> > 
> > Why do you have the at(1) there?
> 
> Hi Thiago, I used 'at' to access the unit of the variable by ignoring
> degree symbol, which you suggested it completely wrong. Since
> get_temp_unit() returns (^\{circ}C), I am grabbing the unit only from the
> string.

It was only wrong when you used std::string, due to encoding issues.

If you're using QString, then arg(get_temp_unit()) should work just fine.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358



More information about the subsurface mailing list