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

KUnitConversion

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

#include <value.h>

Public Member Functions

 Value ()
 
 Value (double n, UnitPtr u)
 
 Value (double n, const QString &u)
 
 Value (double n, int u)
 
 Value (const QVariant &n, const QString &u)
 
 ~Value ()
 
Value convertTo (UnitPtr unit) const
 
Value convertTo (int unit) const
 
Value convertTo (const QString &unit) const
 
bool isValid () const
 
double number () const
 
Value & operator= (const Value &)
 
Value & round (uint decimals)
 
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
 
UnitPtr unit () const
 

Detailed Description

Definition at line 32 of file value.h.

Constructor & Destructor Documentation

KUnitConversion::Value::Value ( )

Definition at line 57 of file value.cpp.

KUnitConversion::Value::Value ( double  n,
UnitPtr  u 
)

Definition at line 62 of file value.cpp.

KUnitConversion::Value::Value ( double  n,
const QString &  u 
)

Definition at line 67 of file value.cpp.

KUnitConversion::Value::Value ( double  n,
int  u 
)

Definition at line 72 of file value.cpp.

KUnitConversion::Value::Value ( const QVariant &  n,
const QString &  u 
)

Definition at line 77 of file value.cpp.

KUnitConversion::Value::~Value ( )

Definition at line 82 of file value.cpp.

Member Function Documentation

Value KUnitConversion::Value::convertTo ( UnitPtr  unit) const

convert to another unit

Definition at line 138 of file value.cpp.

Value KUnitConversion::Value::convertTo ( int  unit) const

convert to another unit

Definition at line 143 of file value.cpp.

Value KUnitConversion::Value::convertTo ( const QString &  unit) const

convert to another unit

Definition at line 148 of file value.cpp.

bool KUnitConversion::Value::isValid ( ) const

Check if value is valid.

Returns
True if value is valid

Definition at line 87 of file value.cpp.

double KUnitConversion::Value::number ( ) const

Number part of the value.

Definition at line 118 of file value.cpp.

Value & KUnitConversion::Value::operator= ( const Value &  value)

Definition at line 131 of file value.cpp.

Value & KUnitConversion::Value::round ( uint  decimals)

rounds value to decimal count

Parameters
decimalsdecimal count.

Definition at line 109 of file value.cpp.

QString KUnitConversion::Value::toString ( int  fieldWidth = 0,
char  format = 'g',
int  precision = -1,
const QChar &  fillChar = QLatin1Char(' ') 
) const

Convert value to a string.

Parameters
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 as a string

Definition at line 92 of file value.cpp.

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
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 as a string

Definition at line 100 of file value.cpp.

UnitPtr KUnitConversion::Value::unit ( ) const

Unit part of the value.

Definition at line 123 of file value.cpp.


The documentation for this class was generated from the following files:
  • value.h
  • value.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48: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
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • 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