Base: UnitsSchema: return std::string
This commit is contained in:
committed by
Yorik van Havre
parent
2ea8a633ac
commit
4d6ed9d531
@@ -20,7 +20,6 @@
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
#include "PreCompiled.h"
|
||||
#ifdef __GNUC__
|
||||
#include <unistd.h>
|
||||
@@ -31,11 +30,11 @@
|
||||
|
||||
#include "UnitsSchema.h"
|
||||
|
||||
|
||||
using namespace Base;
|
||||
|
||||
QString
|
||||
UnitsSchema::toLocale(const Base::Quantity& quant, double factor, const QString& unitString) const
|
||||
std::string UnitsSchema::toLocale(const Base::Quantity& quant,
|
||||
double factor,
|
||||
const std::string& unitString) const
|
||||
{
|
||||
QLocale Lc;
|
||||
const QuantityFormat& format = quant.getFormat();
|
||||
@@ -45,5 +44,7 @@ UnitsSchema::toLocale(const Base::Quantity& quant, double factor, const QString&
|
||||
}
|
||||
|
||||
QString Ln = Lc.toString((quant.getValue() / factor), format.toFormat(), format.precision);
|
||||
return QString::fromUtf8("%1 %2").arg(Ln, unitString);
|
||||
return QString::fromStdString("%1 %2")
|
||||
.arg(Ln, QString::fromStdString(unitString))
|
||||
.toStdString();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user