projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Untangle the time formatting functions a bit
[pulseview.git]
/
pv
/
toolbars
/
mainbar.cpp
diff --git
a/pv/toolbars/mainbar.cpp
b/pv/toolbars/mainbar.cpp
index de476e04c94444eaf58c0d3317297efc7b3a5ea3..dcc35ecee8f4e42800354080e0b2b34d047ebbcb 100644
(file)
--- a/
pv/toolbars/mainbar.cpp
+++ b/
pv/toolbars/mainbar.cpp
@@
-584,10
+584,11
@@
bool MainBar::eventFilter(QObject *watched, QEvent *event)
{
if ((watched == &sample_count_ || watched == &sample_rate_) &&
(event->type() == QEvent::ToolTip)) {
{
if ((watched == &sample_count_ || watched == &sample_rate_) &&
(event->type() == QEvent::ToolTip)) {
-
double sec = (double)sample_count_.value(
) / sample_rate_.value();
+
auto sec = pv::util::Timestamp(sample_count_.value()
) / sample_rate_.value();
QHelpEvent *help_event = static_cast<QHelpEvent*>(event);
QHelpEvent *help_event = static_cast<QHelpEvent*>(event);
- QString str = tr("Total sampling time: %1").arg(pv::util::format_second(sec));
+ QString str = tr("Total sampling time: %1").arg(
+ pv::util::format_time_si(sec, pv::util::SIPrefix::unspecified, 0, "s", false));
QToolTip::showText(help_event->globalPos(), str);
return true;
QToolTip::showText(help_event->globalPos(), str);
return true;