kig
Unit Class Reference
#include <unit.h>
Public Types | |
enum | MetricalUnit { pixel = 0, cm, in } |
Public Member Functions | |
Unit (double value=0.0, Unit::MetricalUnit unit=cm, int dpi=1) | |
~Unit () | |
void | convertTo (Unit::MetricalUnit unit) |
int | dpi () const |
double | getValue (Unit::MetricalUnit unit) const |
Unit & | operator= (const Unit &u) |
void | setDpi (int dpi) |
void | setUnit (Unit::MetricalUnit unit) |
void | setValue (double value) |
Unit::MetricalUnit | unit () const |
double | value () const |
Static Public Member Functions | |
static double | convert (double value, Unit::MetricalUnit from, Unit::MetricalUnit to, int dpi=1) |
static Unit::MetricalUnit | intToUnit (int index) |
static int | precision (Unit::MetricalUnit unit) |
static QStringList | unitList () |
Detailed Description
This small class server as helper to perform conversions between metrical units.
Member Enumeration Documentation
enum Unit::MetricalUnit |
Constructor & Destructor Documentation
|
explicit |
Member Function Documentation
|
static |
void Unit::convertTo | ( | Unit::MetricalUnit | unit | ) |
double Unit::getValue | ( | Unit::MetricalUnit | unit | ) | const |
|
static |
|
static |
void Unit::setUnit | ( | Unit::MetricalUnit | unit | ) |
Set the unit of the current object to unit
, but it doesn't convert the value to the new unit.
- See also
- convertTo()
Unit::MetricalUnit Unit::unit | ( | ) | const |
|
static |
The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:12:06 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:12:06 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.