From efa6928c2bb9785ebb13ac9bc61ad61807af2e06 Mon Sep 17 00:00:00 2001 From: Mark Liversedge Date: Sat, 10 Nov 2012 17:50:50 +0000 Subject: [PATCH] Use hh:mm:ss format in Allplot tooltip --- src/AllPlot.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/AllPlot.cpp b/src/AllPlot.cpp index e444926d5..da9ff08ad 100644 --- a/src/AllPlot.cpp +++ b/src/AllPlot.cpp @@ -1582,11 +1582,19 @@ AllPlot::pointHover(QwtPlotCurve *curve, int index) double yvalue = curve->sample(index).y(); double xvalue = curve->sample(index).x(); + QString xstring; + if (bydist) { + xstring = QString("%1").arg(xvalue); + } else { + QTime t = QTime().addSecs(xvalue*60.00); + xstring = t.toString("hh:mm:ss"); + } + // output the tooltip QString text = QString("%1 %2\n%3 %4") .arg(yvalue, 0, 'f', 0) .arg(this->axisTitle(curve->yAxis()).text()) - .arg(xvalue, 0, 'f', 2) + .arg(xstring) .arg(this->axisTitle(curve->xAxis()).text()); // set that text up