QmlProfiler: Make time formatting available to all timeline models

... and remove some dead code.

Change-Id: Ifdec932b87e8d33420d9713bfde9c4002f34844b
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
Ulf Hermann
2014-02-14 17:01:24 +01:00
parent 2a00002e80
commit 8f5df0b7da
8 changed files with 25 additions and 71 deletions

View File

@@ -105,4 +105,14 @@ QString QmlProfilerSimpleModel::getHashString(const QmlProfilerSimpleModel::QmlE
QString::number(event.bindingType));
}
QString QmlProfilerSimpleModel::formatTime(qint64 timestamp)
{
if (timestamp < 1e6)
return QString::number(timestamp/1e3f,'f',3) + trUtf8(" \xc2\xb5s");
if (timestamp < 1e9)
return QString::number(timestamp/1e6f,'f',3) + tr(" ms");
return QString::number(timestamp/1e9f,'f',3) + tr(" s");
}
}