forked from qt-creator/qt-creator
Use time formatting method of base class instead of reimplementing it
Change-Id: I81da4ec2a7830f3a3ddfb85ceeffdaeca20c3c6d Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
@@ -46,7 +46,6 @@ public:
|
|||||||
bool isExpanded;
|
bool isExpanded;
|
||||||
int expandedRowCount;
|
int expandedRowCount;
|
||||||
int collapsedRowCount;
|
int collapsedRowCount;
|
||||||
QString displayTime(double time);
|
|
||||||
void addVP(QVariantList &l, QString label, qint64 time);
|
void addVP(QVariantList &l, QString label, qint64 time);
|
||||||
|
|
||||||
qint64 minCacheSize;
|
qint64 minCacheSize;
|
||||||
@@ -231,21 +230,11 @@ const QVariantList PixmapCacheModel::getLabelsForCategory(int category) const
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString PixmapCacheModel::PixmapCacheModelPrivate::displayTime(double time)
|
|
||||||
{
|
|
||||||
if (time < 1e6)
|
|
||||||
return QString::number(time/1e3,'f',3) + trUtf8(" \xc2\xb5s");
|
|
||||||
if (time < 1e9)
|
|
||||||
return QString::number(time/1e6,'f',3) + tr(" ms");
|
|
||||||
|
|
||||||
return QString::number(time/1e9,'f',3) + tr(" s");
|
|
||||||
}
|
|
||||||
|
|
||||||
void PixmapCacheModel::PixmapCacheModelPrivate::addVP(QVariantList &l, QString label, qint64 time)
|
void PixmapCacheModel::PixmapCacheModelPrivate::addVP(QVariantList &l, QString label, qint64 time)
|
||||||
{
|
{
|
||||||
if (time > 0) {
|
if (time > 0) {
|
||||||
QVariantMap res;
|
QVariantMap res;
|
||||||
res.insert(label, QVariant(displayTime(time)));
|
res.insert(label, QVariant(QmlProfilerSimpleModel::formatTime(time)));
|
||||||
l << res;
|
l << res;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -59,7 +59,6 @@ public:
|
|||||||
SceneGraphTimelineModel *q;
|
SceneGraphTimelineModel *q;
|
||||||
|
|
||||||
bool isExpanded;
|
bool isExpanded;
|
||||||
QString displayTime(double time);
|
|
||||||
void addVP(QVariantList &l, QString label, qint64 time);
|
void addVP(QVariantList &l, QString label, qint64 time);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -223,23 +222,11 @@ const QVariantList SceneGraphTimelineModel::getLabelsForCategory(int category) c
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
QString SceneGraphTimelineModel::SceneGraphTimelineModelPrivate::displayTime(double time)
|
|
||||||
{
|
|
||||||
if (time < 1e6)
|
|
||||||
return QString::number(time/1e3,'f',3) + trUtf8(" \xc2\xb5s");
|
|
||||||
if (time < 1e9)
|
|
||||||
return QString::number(time/1e6,'f',3) + tr(" ms");
|
|
||||||
|
|
||||||
return QString::number(time/1e9,'f',3) + tr(" s");
|
|
||||||
}
|
|
||||||
|
|
||||||
void SceneGraphTimelineModel::SceneGraphTimelineModelPrivate::addVP(QVariantList &l, QString label, qint64 time)
|
void SceneGraphTimelineModel::SceneGraphTimelineModelPrivate::addVP(QVariantList &l, QString label, qint64 time)
|
||||||
{
|
{
|
||||||
if (time > 0) {
|
if (time > 0) {
|
||||||
QVariantMap res;
|
QVariantMap res;
|
||||||
res.insert(label, QVariant(displayTime(time)));
|
res.insert(label, QVariant(QmlProfilerSimpleModel::formatTime(time)));
|
||||||
l << res;
|
l << res;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user