KUnitConversion::Value
KUnitConversion::Value Class Reference
#include <value.h>
Public Member Functions | |
Value () | |
Value (const QVariant &number, const QString &unitString) | |
Value (const Value &other) | |
Value (qreal number, const QString &unitString) | |
Value (qreal number, const Unit &unit) | |
Value (qreal number, UnitId unitId) | |
~Value () | |
Value | convertTo (const QString &unit) const |
Value | convertTo (const Unit &unit) const |
Value | convertTo (UnitId unit) const |
bool | isNull () const |
bool | isValid () const |
qreal | number () const |
bool | operator!= (const Value &other) const |
Value & | operator= (const Value &other) |
bool | operator== (const Value &other) const |
Value & | round (uint decimals) |
void | swap (Value &other) |
QString | toString (int fieldWidth=0, char format='g', int precision=-1, const QChar &fillChar=QLatin1Char(' ')) const |
QString | toSymbolString (int fieldWidth=0, char format='g', int precision=-1, const QChar &fillChar=QLatin1Char(' ')) const |
Unit | unit () const |
Detailed Description
Class to hold a value in a unit of measurement.
This is a class to hold a value in a unit of measurement.
- See also
- Converter, Unit, UnitCategory
Constructor & Destructor Documentation
◆ Value() [1/6]
◆ Value() [2/6]
◆ Value() [3/6]
◆ Value() [4/6]
KUnitConversion::Value::Value | ( | qreal | number, |
UnitId | unitId ) |
◆ Value() [5/6]
◆ Value() [6/6]
◆ ~Value()
KUnitConversion::Value::~Value | ( | ) |
Member Function Documentation
◆ convertTo() [1/3]
◆ convertTo() [2/3]
◆ convertTo() [3/3]
Value KUnitConversion::Value::convertTo | ( | UnitId | unit | ) | const |
◆ isNull()
bool KUnitConversion::Value::isNull | ( | ) | const |
◆ isValid()
bool KUnitConversion::Value::isValid | ( | ) | const |
◆ number()
qreal KUnitConversion::Value::number | ( | ) | const |
◆ operator!=()
◆ operator=()
◆ operator==()
◆ round()
Value & KUnitConversion::Value::round | ( | uint | decimals | ) |
◆ swap()
◆ toString()
QString KUnitConversion::Value::toString | ( | int | fieldWidth = 0, |
char | format = 'g', | ||
int | precision = -1, | ||
const QChar & | fillChar = QLatin1Char(' ') ) const |
Convert value to a string.
- Parameters
-
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 as a string
◆ toSymbolString()
QString KUnitConversion::Value::toSymbolString | ( | int | fieldWidth = 0, |
char | format = 'g', | ||
int | precision = -1, | ||
const QChar & | fillChar = QLatin1Char(' ') ) const |
Convert value to a string with symbol.
- Parameters
-
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 as a string
◆ unit()
Unit KUnitConversion::Value::unit | ( | ) | const |
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 Tue Mar 26 2024 11:17:59 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:17:59 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.