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 (void) |
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 (void) |
Gets called if this schema gets activated. More... | |
QString | toLocale (const Base::Quantity &quant, double factor, const QString &unitString) const |
virtual | ~UnitsSchema () |
Detailed Description
The UnitSchema class The subclasses of this class define the stuff for a certain units schema.
Constructor & Destructor Documentation
◆ ~UnitsSchema()
|
virtual |
Member Function Documentation
◆ resetSchemaUnits()
|
virtual |
If you use setSchemaUnits() you also have to impment this method to undo your changes!
◆ schemaTranslate()
|
pure virtual |
This method translates the quantity in a string as the user may expect it.
Implemented in Base::UnitsSchemaImperialCivil, Base::UnitsSchemaImperialBuilding, Base::UnitsSchemaImperial1, Base::UnitsSchemaInternal, Base::UnitsSchemaMmMin, Base::UnitsSchemaMKS, Base::UnitsSchemaCentimeters, and Base::UnitsSchemaImperialDecimal.
Referenced by Base::Quantity::getUserString(), and Base::UnitsApi::sSchemaTranslate().
◆ setSchemaUnits()
|
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).
◆ toLocale()
QString UnitsSchema::toLocale | ( | const Base::Quantity & | quant, |
double | factor, | ||
const QString & | unitString | ||
) | const |
References Base::Quantity::getFormat(), and Base::Quantity::getValue().
Referenced by Base::UnitsSchemaImperialDecimal::schemaTranslate(), Base::UnitsSchemaCentimeters::schemaTranslate(), Base::UnitsSchemaMKS::schemaTranslate(), Base::UnitsSchemaMmMin::schemaTranslate(), Base::UnitsSchemaInternal::schemaTranslate(), Base::UnitsSchemaImperial1::schemaTranslate(), Base::UnitsSchemaImperialBuilding::schemaTranslate(), and Base::UnitsSchemaImperialCivil::schemaTranslate().
The documentation for this class was generated from the following files:
- src/Base/UnitsSchema.h
- src/Base/UnitsSchema.cpp