• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KUnitConversion

  • KUnitConversion
  • Unit
Public Member Functions | Protected Member Functions | List of all members
KUnitConversion::Unit Class Reference

#include <unit.h>

Inheritance diagram for KUnitConversion::Unit:
Inheritance graph
[legend]

Public Member Functions

 Unit (UnitCategory *category, int id, double multiplier, const QString &symbol, const QString &description, const QString &match, const KLocalizedString &real, const KLocalizedString &integer)
 
 Unit (UnitCategory *category, int id, const Complex *complex, const QString &symbol, const QString &description, const QString &match, const KLocalizedString &real, const KLocalizedString &integer)
 
virtual ~Unit ()
 
UnitCategory * category () const
 
QString description () const
 
int id () const
 
bool isValid () const
 
double multiplier () const
 
void setMultiplier (double multiplier)
 
QString symbol () const
 
QString toString (double value, int fieldWidth=0, char format= 'g', int precision=-1, const QChar &fillChar=QLatin1Char(' ')) const
 
QString toSymbolString (double value, int fieldWidth=0, char format= 'g', int precision=-1, const QChar &fillChar=QLatin1Char(' ')) const
 
- Public Member Functions inherited from QSharedData
 QSharedData ()
 
 QSharedData (const QSharedData &other)
 

Protected Member Functions

double fromDefault (double value) const
 
double toDefault (double value) const
 

Detailed Description

Definition at line 43 of file unit.h.

Constructor & Destructor Documentation

KUnitConversion::Unit::Unit ( UnitCategory *  category,
int  id,
double  multiplier,
const QString &  symbol,
const QString &  description,
const QString &  match,
const KLocalizedString &  real,
const KLocalizedString &  integer 
)

Definition at line 61 of file unit.cpp.

KUnitConversion::Unit::Unit ( UnitCategory *  category,
int  id,
const Complex *  complex,
const QString &  symbol,
const QString &  description,
const QString &  match,
const KLocalizedString &  real,
const KLocalizedString &  integer 
)

Definition at line 78 of file unit.cpp.

KUnitConversion::Unit::~Unit ( )
virtual

Definition at line 94 of file unit.cpp.

Member Function Documentation

UnitCategory * KUnitConversion::Unit::category ( ) const
Returns
unit category.

Definition at line 99 of file unit.cpp.

QString KUnitConversion::Unit::description ( ) const
Returns
translated name for unit.

Definition at line 104 of file unit.cpp.

double KUnitConversion::Unit::fromDefault ( double  value) const
protected

Definition at line 133 of file unit.cpp.

int KUnitConversion::Unit::id ( ) const
Returns
unit id.

Definition at line 163 of file unit.cpp.

bool KUnitConversion::Unit::isValid ( ) const
Returns
if unit is valid.

Definition at line 158 of file unit.cpp.

double KUnitConversion::Unit::multiplier ( ) const
Returns
unit multiplier.

Definition at line 114 of file unit.cpp.

void KUnitConversion::Unit::setMultiplier ( double  multiplier)

Set unit multiplier.

Definition at line 119 of file unit.cpp.

QString KUnitConversion::Unit::symbol ( ) const
Returns
symbol for the unit.

Definition at line 109 of file unit.cpp.

double KUnitConversion::Unit::toDefault ( double  value) const
protected

Definition at line 124 of file unit.cpp.

QString KUnitConversion::Unit::toString ( double  value,
int  fieldWidth = 0,
char  format = 'g',
int  precision = -1,
const QChar &  fillChar = QLatin1Char(' ') 
) const
Parameters
valuenumber value
fieldWidthwidth of the formatted field, padded by spaces. Positive value aligns right, negative aligns left
formattype of floating point formating, like in QString::arg
precisionnumber of digits after the decimal separator
fillCharthe character used to fill up the empty places when field width is greater than argument width
Returns
value + unit string

Definition at line 142 of file unit.cpp.

QString KUnitConversion::Unit::toSymbolString ( double  value,
int  fieldWidth = 0,
char  format = 'g',
int  precision = -1,
const QChar &  fillChar = QLatin1Char(' ') 
) const
Parameters
valuenumber value
fieldWidthwidth of the formatted field, padded by spaces. Positive value aligns right, negative aligns left
formattype of floating point formating, like in QString::arg
precisionnumber of digits after the decimal separator
fillCharthe character used to fill up the empty places when field width is greater than argument width
Returns
value + unit string

Definition at line 151 of file unit.cpp.


The documentation for this class was generated from the following files:
  • unit.h
  • unit.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:23:00 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KUnitConversion

Skip menu "KUnitConversion"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal