A combo box to select a unit for measures.
More...
#include <klfunitinput.h>
A combo box to select a unit for measures.
Typical usage:
Definition at line 43 of file klfunitinput.h.
◆ KLFUnitChooser()
KLFUnitChooser::KLFUnitChooser |
( |
QWidget * |
parent = NULL | ) |
|
◆ ~KLFUnitChooser()
KLFUnitChooser::~KLFUnitChooser |
( |
| ) |
|
|
virtual |
◆ changeEvent()
void KLFUnitChooser::changeEvent |
( |
QEvent * |
event | ) |
|
|
protectedvirtual |
◆ currentUnit()
Unit KLFUnitChooser::currentUnit |
( |
| ) |
const |
|
inline |
◆ currentUnitAbbrev()
QString KLFUnitChooser::currentUnitAbbrev |
( |
| ) |
const |
|
inline |
◆ currentUnitFactor()
double KLFUnitChooser::currentUnitFactor |
( |
| ) |
const |
|
inline |
◆ currentUnitName()
QString KLFUnitChooser::currentUnitName |
( |
| ) |
const |
|
inline |
◆ setCurrentUnit
void KLFUnitChooser::setCurrentUnit |
( |
const QString & |
unitName | ) |
|
|
slot |
◆ setCurrentUnitAbbrev
void KLFUnitChooser::setCurrentUnitAbbrev |
( |
const QString & |
unitAbbrev | ) |
|
|
slot |
◆ setCurrentUnitIndex
void KLFUnitChooser::setCurrentUnitIndex |
( |
int |
k | ) |
|
|
slot |
◆ setUnits [1/2]
void KLFUnitChooser::setUnits |
( |
const QString & |
unitstrlist | ) |
|
|
slot |
Set the possible units user can choose from. Units are specified as a string of semicolon-separated items, each item in the list corresponding to one unit, specified as a string like "Inch=in=25.4"
or "Centimeter=cm=10"
or "Millimeter=mm=1"
, that is a string with three sections separated by an '='
sign giving unit name, unit abbreviation, and the factor of that unit to a reference unit. See KLFUnitSpinBox for discussion about units.
Example:
setUnits(
"Postscript Point=pt=1;Millimeter=mm=2.835;Centimeter=cm=28.35;1/8 th inch=1/8 in=9;Inch=in=72")
Definition at line 45 of file klfunitinput.cpp.
References KLFUnitChooser::Unit::abbrev, KLFUnitChooser::Unit::factor, KLF_FUNC_NAME, KLFUnitChooser::Unit::name, QList::size(), and QString::split().
◆ setUnits [2/2]
void KLFUnitChooser::setUnits |
( |
const QList< Unit > & |
unitlist | ) |
|
|
slot |
◆ unitChanged [1/3]
void KLFUnitChooser::unitChanged |
( |
const QString & |
unitName | ) |
|
|
signal |
◆ unitChanged [2/3]
void KLFUnitChooser::unitChanged |
( |
double |
unitFactor | ) |
|
|
signal |
◆ unitChanged [3/3]
void KLFUnitChooser::unitChanged |
( |
double |
unitFactor, |
|
|
const QString & |
suffix |
|
) |
| |
|
signal |
◆ unitList()
QList<Unit> KLFUnitChooser::unitList |
( |
| ) |
const |
|
inline |
◆ unitNames()
◆ unitStringDescription()
QString KLFUnitChooser::unitStringDescription |
( |
| ) |
const |
◆ currentUnit
QString KLFUnitChooser::currentUnit |
|
readwrite |
◆ currentUnitFactor
double KLFUnitChooser::currentUnitFactor |
|
read |
◆ klfUnits
The documentation for this class was generated from the following files: