Tracing: Add space between duration and time unit

According to the SI convention, there is always a space between the
number and the unit.
I think we can leave it as is for the combination of multiple units for
the sake of compactness.

Change-Id: I11efc7ec4fc54a8adbf64e51817f2f8ad567bcea
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
Tim Henning
2019-07-16 15:34:02 +02:00
parent 0221b59169
commit 78aee4e594

View File

@@ -30,7 +30,7 @@ namespace Timeline {
QString formatTime(qint64 timestamp, qint64 reference)
{
static const char *decimalUnits[] = {"ns", "\xb5s", "ms", "s"};
static const char *decimalUnits[] = {" ns", " \xb5s", " ms", " s"};
static const double second = 1e9;
static const double minute = 60;
static const double hour = 60;
@@ -63,7 +63,7 @@ QString formatTime(qint64 timestamp, qint64 reference)
double seconds = timestamp / second;
if (seconds < minute) {
return QString::number(seconds, 'g', qMax(round, 3)) + "s";
return QString::number(seconds, 'g', qMax(round, 3)) + " s";
} else {
int minutes = seconds / minute;
seconds -= minutes * minute;