The UnitSchema class The subclasses of this class define the stuff for a certain units schema. More...
#include <UnitsSchema.h>
Public Member Functions | |
| virtual void | resetSchemaUnits () |
| If you use setSchemaUnits() you also have to impment this method to undo your changes! More... | |
| virtual QString | schemaTranslate (const Base::Quantity &quant, double &factor, QString &unitString)=0 |
| This method translates the quantity in a string as the user may expect it. More... | |
| virtual void | setSchemaUnits () |
| Gets called if this schema gets activated. More... | |
| QString | toLocale (const Base::Quantity &quant, double factor, const QString &unitString) const |
| virtual | ~UnitsSchema () |
The UnitSchema class The subclasses of this class define the stuff for a certain units schema.
|
virtual |
|
virtual |
If you use setSchemaUnits() you also have to impment this method to undo your changes!
|
pure virtual |
This method translates the quantity in a string as the user may expect it.
Implemented in Base::UnitsSchemaCentimeters, Base::UnitsSchemaFemMilliMeterNewton, Base::UnitsSchemaImperial1, Base::UnitsSchemaImperialDecimal, Base::UnitsSchemaImperialBuilding, Base::UnitsSchemaImperialCivil, Base::UnitsSchemaInternal, Base::UnitsSchemaMKS, and Base::UnitsSchemaMmMin.
Referenced by Base::Quantity::getUserString().
|
virtual |
Gets called if this schema gets activated.
Here it's theoretically possible that you can change the static factors for certain units (e.g. mi = 1,8km instead of mi=1.6km).
| QString UnitsSchema::toLocale | ( | const Base::Quantity & | quant, |
| double | factor, | ||
| const QString & | unitString | ||
| ) | const |
References Base::Quantity::getFormat(), Base::Quantity::getValue(), and Base::QuantityFormat::option.
Referenced by Base::UnitsSchemaCentimeters::schemaTranslate(), Base::UnitsSchemaFemMilliMeterNewton::schemaTranslate(), Base::UnitsSchemaImperial1::schemaTranslate(), Base::UnitsSchemaImperialDecimal::schemaTranslate(), Base::UnitsSchemaImperialBuilding::schemaTranslate(), Base::UnitsSchemaImperialCivil::schemaTranslate(), Base::UnitsSchemaInternal::schemaTranslate(), Base::UnitsSchemaMKS::schemaTranslate(), and Base::UnitsSchemaMmMin::schemaTranslate().