refs #799, own component for view update times

* utility function in CTime
* settings class for update times
This commit is contained in:
Klaus Basan
2016-11-09 20:16:21 +01:00
parent 9386741144
commit 438e72555a
9 changed files with 530 additions and 5 deletions

View File

@@ -131,6 +131,12 @@ namespace BlackMisc
return static_cast<int>(ms);
}
int CTime::toSeconds() const
{
double ms = this->valueRounded(CTimeUnit::s(), 0);
return static_cast<int>(ms);
}
QString CTime::formattedHrsMin() const
{
QList<int> parts = getHrsMinSecParts();
@@ -146,5 +152,5 @@ namespace BlackMisc
return fs;
}
}
}
}
} // ns
} // ns

View File

@@ -73,12 +73,14 @@ namespace BlackMisc
//! Convenience functions when used with timers etc.
int toMs() const;
//! Convenience functions when used with timers etc.
int toSeconds() const;
//! Formatted as hh:mm
QString formattedHrsMin() const;
};
}
}
} // ns
} // ns
Q_DECLARE_METATYPE(BlackMisc::PhysicalQuantities::CTime)

View File

@@ -139,6 +139,7 @@ namespace BlackMisc
GlobalIndexCDockWidgetSettings = 14200,
GlobalIndexCNavigatorSettings = 14300,
GlobalIndexCSettingsReaders = 14400,
GlobalIndexCViewUpdateSettings = 14500,
GloablIndexInterpolatorSetup = 15000,
GlobalIndexLineNumber = 20000, //!< pseudo index for line numbers
};