mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 16:56:53 +08:00
refs #212, methods for parsing values
* PQ, set by other PQ * PQ, set NULL * PQ, CPqTime, implemented parse to string * CPqTime to QTime
This commit is contained in:
@@ -151,8 +151,8 @@ namespace BlackMisc
|
||||
}
|
||||
|
||||
/*
|
||||
* Multiply operator
|
||||
*/
|
||||
* Multiply operator
|
||||
*/
|
||||
template <class MU, class PQ> PQ CPhysicalQuantity<MU, PQ>::operator *(double factor) const
|
||||
{
|
||||
PQ copy = *derived();
|
||||
@@ -306,6 +306,16 @@ namespace BlackMisc
|
||||
this->m_value = json.value("value").toDouble();
|
||||
}
|
||||
|
||||
/*
|
||||
* Parse from string
|
||||
*/
|
||||
template <class MU, class PQ> void CPhysicalQuantity<MU, PQ>::parseFromString(const QString &value)
|
||||
{
|
||||
PQ parsed = CPqString::parse<PQ>(value);
|
||||
this->m_value = parsed.m_value;
|
||||
this->m_unit = parsed.m_unit;
|
||||
}
|
||||
|
||||
/*
|
||||
* metaTypeId
|
||||
*/
|
||||
@@ -320,7 +330,6 @@ namespace BlackMisc
|
||||
template <class MU, class PQ> bool CPhysicalQuantity<MU, PQ>::isA(int metaTypeId) const
|
||||
{
|
||||
if (metaTypeId == qMetaTypeId<PQ>()) { return true; }
|
||||
|
||||
return this->CValueObject::isA(metaTypeId);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user