mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-27 11:05:44 +08:00
Formatter with improved NULL value handling
This commit is contained in:
@@ -352,7 +352,11 @@ namespace BlackGui
|
|||||||
//! Version if value is already available as PQ
|
//! Version if value is already available as PQ
|
||||||
BlackMisc::CVariant displayRole(const PQ &pq) const
|
BlackMisc::CVariant displayRole(const PQ &pq) const
|
||||||
{
|
{
|
||||||
if (m_unit.isNull()) { return pq.valueRoundedWithUnit(m_digits, m_useI18n); }
|
if (pq.isNull())
|
||||||
|
{
|
||||||
|
static const BlackMisc::CVariant null("null");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return pq.valueRoundedWithUnit(m_unit, m_digits, m_useI18n);
|
return pq.valueRoundedWithUnit(m_unit, m_digits, m_useI18n);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user