#include <UnitDatabase.h>
Collaboration diagram for UnitDatabase:

Definition at line 29 of file UnitDatabase.h.
Signals | |
| void | unitDatabaseChanged () |
Public Member Functions | |
| QStringList | getKnownUnits () const |
| void | registerUnit (QString unit) |
| int | getUnitId (QString unit, bool registerNew=true) |
| Return the reference id for a given unit name. | |
| QString | getUnitById (int id) |
Static Public Member Functions | |
| static UnitDatabase * | getInstance () |
Protected Types | |
| typedef std::map< QString, int > | UnitMap |
Protected Member Functions | |
| UnitDatabase () | |
Protected Attributes | |
| UnitMap | m_units |
| int | m_nextId |
Static Protected Attributes | |
| static UnitDatabase | m_instance |
typedef std::map<QString, int> UnitDatabase::UnitMap [protected] |
Definition at line 54 of file UnitDatabase.h.
| UnitDatabase::UnitDatabase | ( | ) | [protected] |
Definition at line 27 of file UnitDatabase.cpp.
| UnitDatabase * UnitDatabase::getInstance | ( | ) | [static] |
Definition at line 22 of file UnitDatabase.cpp.
References m_instance.
Referenced by PropertyContainer::convertPropertyStrings(), TimeValueLayer::getPropertyRangeAndValue(), NoteLayer::getPropertyRangeAndValue(), MainWindow::MainWindow(), PropertyBox::PropertyBox(), PropertyBox::propertyControllerChanged(), TimeValueLayer::setProperty(), NoteLayer::setProperty(), SparseValueModel< TimeValuePoint >::setScaleUnits(), and PropertyBox::updatePropertyEditor().
| QStringList UnitDatabase::getKnownUnits | ( | ) | const |
Definition at line 33 of file UnitDatabase.cpp.
References m_units.
Referenced by PropertyBox::updatePropertyEditor().
| void UnitDatabase::registerUnit | ( | QString | unit | ) |
Definition at line 43 of file UnitDatabase.cpp.
References m_nextId, m_units, and unitDatabaseChanged().
Referenced by getUnitId(), MainWindow::MainWindow(), and SparseValueModel< TimeValuePoint >::setScaleUnits().
| int UnitDatabase::getUnitId | ( | QString | unit, | |
| bool | registerNew = true | |||
| ) |
Return the reference id for a given unit name.
If registerNew is true and the unit is not known, register it and return its new id. If register is false and the unit is not known, return -1.
Definition at line 52 of file UnitDatabase.cpp.
References m_units, and registerUnit().
Referenced by PropertyContainer::convertPropertyStrings(), TimeValueLayer::getPropertyRangeAndValue(), and NoteLayer::getPropertyRangeAndValue().
| QString UnitDatabase::getUnitById | ( | int | id | ) |
Definition at line 62 of file UnitDatabase.cpp.
References m_units.
Referenced by PropertyBox::updatePropertyEditor().
| void UnitDatabase::unitDatabaseChanged | ( | ) | [signal] |
Referenced by registerUnit().
UnitMap UnitDatabase::m_units [protected] |
Definition at line 55 of file UnitDatabase.h.
Referenced by getKnownUnits(), getUnitById(), getUnitId(), and registerUnit().
int UnitDatabase::m_nextId [protected] |
UnitDatabase UnitDatabase::m_instance [static, protected] |
1.5.1