KUnitConversion
Go to the documentation of this file.
45 namespace KUnitConversion
54 const KLocalizedString ls;
55 setName(i18n(
"Invalid"));
57 setSymbolStringFormat(ki18nc(
"%1 value, %2 unit symbol (default)",
"%1 %2"));
61 class ConverterPrivate
64 QMap<int, UnitCategory *> categories;
67 KGlobal::locale()->insertCatalog(
"libkunitconversion");
91 qDeleteAll(categories);
95 K_GLOBAL_STATIC(ConverterPrivate, static_d)
98 :
QObject(parent), d(static_cast<ConverterPrivate *>(static_d))
108 if (!value.
unit().isNull()) {
111 return category->
convert(value, toUnit);
119 if (!value.
unit().isNull()) {
122 return category->
convert(value, toUnit);
130 if (!toUnit.isNull() && !value.
unit().isNull() && value.
unit()->isValid()) {
133 return category->
convert(value, toUnit);
183 if (d->categories.contains(categoryId)) {
184 return d->categories[categoryId];
192 QList<UnitCategory*>
categories = d->categories.values();
193 categories.removeAt(0);
199 #include "converter.moc"
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Mon Jul 15 2013 13:03:06 by
doxygen 1.8.3.1 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.