X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Ftoolbars%2Fsamplingbar.cpp;h=085e0430582e08b5ff488b7b1d2a708ef35bca35;hp=05c730bf528fe35efdab94acea14be9183838fd6;hb=62974f456595f3f6b9804a8f0fb993b4766d61e7;hpb=f0c9f81c03d2c1d1fa59c357a88d25f6a3128651 diff --git a/pv/toolbars/samplingbar.cpp b/pv/toolbars/samplingbar.cpp index 05c730bf..085e0430 100644 --- a/pv/toolbars/samplingbar.cpp +++ b/pv/toolbars/samplingbar.cpp @@ -35,6 +35,7 @@ #include #include #include +#include using boost::shared_ptr; using std::map; @@ -456,16 +457,9 @@ bool SamplingBar::eventFilter(QObject *watched, QEvent *event) if ((watched == &_sample_count || watched == &_sample_rate) && (event->type() == QEvent::ToolTip)) { double sec = (double)_sample_count.value() / _sample_rate.value(); - - QString str; - QTextStream(&str) - << tr("Total sampling time: ") - << fixed - << qSetRealNumberPrecision(1) - << sec - << "s"; - QHelpEvent *help_event = static_cast(event); + + QString str = tr("Total sampling time: %1").arg(pv::util::format_second(sec)); QToolTip::showText(help_event->globalPos(), str); return true;