#include <unit.h>
Class to define a unit of measurement.
This is a class to define a unit of measurement.
- See also
- Converter, UnitCategory, Value
- Author
- Petri Damstén damu@.nosp@m.iki..nosp@m.fi
-
John Layt jlayt.nosp@m.@kde.nosp@m..org
Definition at line 763 of file unit.h.
◆ Unit() [1/2]
KUnitConversion::Unit::Unit |
( |
| ) |
|
Null constructor.
Definition at line 83 of file unit.cpp.
◆ Unit() [2/2]
KUnitConversion::Unit::Unit |
( |
const Unit & | other | ) |
|
Copy constructor, copy other
to this.
Definition at line 93 of file unit.cpp.
◆ ~Unit()
KUnitConversion::Unit::~Unit |
( |
| ) |
|
◆ category()
- Returns
- unit category.
Definition at line 158 of file unit.cpp.
◆ categoryId()
CategoryId KUnitConversion::Unit::categoryId |
( |
| ) |
const |
- Returns
- category id.
Definition at line 150 of file unit.cpp.
◆ description()
QString KUnitConversion::Unit::description |
( |
| ) |
const |
- Returns
- translated name for unit.
Definition at line 166 of file unit.cpp.
◆ fromDefault()
qreal KUnitConversion::Unit::fromDefault |
( |
qreal | value | ) |
const |
|
protected |
◆ id()
UnitId KUnitConversion::Unit::id |
( |
| ) |
const |
- Returns
- unit id.
Definition at line 142 of file unit.cpp.
◆ isNull()
bool KUnitConversion::Unit::isNull |
( |
| ) |
const |
- Returns
- returns true if this Unit is null
Definition at line 132 of file unit.cpp.
◆ isValid()
bool KUnitConversion::Unit::isValid |
( |
| ) |
const |
- Returns
- if unit is valid.
Definition at line 137 of file unit.cpp.
◆ operator!=()
bool KUnitConversion::Unit::operator!= |
( |
const Unit & | other | ) |
const |
- Returns
true
if this Unit is not equal to the other
Unit.
Definition at line 123 of file unit.cpp.
◆ operator=() [1/2]
Unit & KUnitConversion::Unit::operator= |
( |
const Unit & | other | ) |
|
Assignment operator, assign other
to this.
Definition at line 102 of file unit.cpp.
◆ operator=() [2/2]
Unit & KUnitConversion::Unit::operator= |
( |
Unit && | other | ) |
|
Move-assigns other
to this Unit instance, transferring the ownership of the managed pointer to this instance.
Definition at line 108 of file unit.cpp.
◆ operator==()
bool KUnitConversion::Unit::operator== |
( |
const Unit & | other | ) |
const |
◆ symbol()
QString KUnitConversion::Unit::symbol |
( |
| ) |
const |
- Returns
- symbol for the unit.
Definition at line 174 of file unit.cpp.
◆ toDefault()
qreal KUnitConversion::Unit::toDefault |
( |
qreal | value | ) |
const |
|
protected |
◆ toString()
QString KUnitConversion::Unit::toString |
( |
qreal | value, |
|
|
int | fieldWidth = 0, |
|
|
char | format = 'g', |
|
|
int | precision = -1, |
|
|
const QChar & | fillChar = QLatin1Char(' ') ) const |
- Parameters
-
value | number value |
fieldWidth | width of the formatted field, padded by spaces. Positive value aligns right, negative aligns left |
format | type of floating point formatting, like in QString::arg |
precision | number of digits after the decimal separator |
fillChar | the character used to fill up the empty places when field width is greater than argument width |
- Returns
- value + unit string
Definition at line 205 of file unit.cpp.
◆ toSymbolString()
QString KUnitConversion::Unit::toSymbolString |
( |
qreal | value, |
|
|
int | fieldWidth = 0, |
|
|
char | format = 'g', |
|
|
int | precision = -1, |
|
|
const QChar & | fillChar = QLatin1Char(' ') ) const |
- Parameters
-
value | number value |
fieldWidth | width of the formatted field, padded by spaces. Positive value aligns right, negative aligns left |
format | type of floating point formatting, like in QString::arg |
precision | number of digits after the decimal separator |
fillChar | the character used to fill up the empty places when field width is greater than argument width |
- Returns
- value + unit string
Definition at line 216 of file unit.cpp.
The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:06:12 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.