KUnitConversion
Go to the documentation of this file.
20#ifndef KUNITCONVERSION_UNIT_H
21#define KUNITCONVERSION_UNIT_H
23#include <QtCore/QString>
24#include <ksharedptr.h>
27class KLocalizedString;
46 Unit(
UnitCategory* category,
int id,
double multiplier,
const QString& symbol,
47 const QString& description,
const QString& match,
48 const KLocalizedString& real,
const KLocalizedString& integer);
50 const QString& description,
const QString& match,
51 const KLocalizedString& real,
const KLocalizedString& integer);
57 QString description()
const;
62 QString symbol()
const;
74 QString toString(
double value,
int fieldWidth = 0,
char format =
'g',
int precision = -1,
75 const QChar& fillChar = QLatin1Char(
' '))
const;
87 QString toSymbolString(
double value,
int fieldWidth = 0,
char format =
'g',
88 int precision = -1,
const QChar& fillChar = QLatin1Char(
' '))
const;
93 double multiplier()
const;
98 void setMultiplier(
double multiplier);
108 bool isValid()
const;
116 double toDefault(
double value)
const;
117 double fromDefault(
double value)
const;
127#define UP(id, m, s, d, sy, r, i) \
128 (KUnitConversion::UnitPtr(new KUnitConversion::Unit(this, id, m, s, d, sy, r, i)))
129#define U(id, m, s, d, sy, r, i) (new KUnitConversion::Unit(this, id, m, s, d, sy, r, i))
virtual double fromDefault(double) const =0
virtual double toDefault(double) const =0
KSharedPtr< Unit > UnitPtr
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by
doxygen 1.9.6 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.