aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmlprofiler
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2017-01-02 19:15:17 +0100
committerUlf Hermann <ulf.hermann@qt.io>2017-01-04 16:57:03 +0000
commit405c456d0d2785fcbf6f62415963c8a31de6cbc4 (patch)
tree3041e347a3e4eadb57f73c096c966de269a201c0 /src/plugins/qmlprofiler
parent144d817b76d04b45526eebfbd80ccad0e317d1bc (diff)
QmlProfiler: Print timestamps with context
For traces that start at a high timestamp, we want the timestamps to still have some meaning. Without context the formatter will only print something like "5h 25m" for all of them, which is not very useful. Change-Id: I7ec37659083f967c9ed03a843f6b7c9430214670 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/qmlprofiler')
-rw-r--r--src/plugins/qmlprofiler/debugmessagesmodel.cpp6
-rw-r--r--src/plugins/qmlprofiler/inputeventsmodel.cpp3
2 files changed, 6 insertions, 3 deletions
diff --git a/src/plugins/qmlprofiler/debugmessagesmodel.cpp b/src/plugins/qmlprofiler/debugmessagesmodel.cpp
index c9395d7377..2347a75441 100644
--- a/src/plugins/qmlprofiler/debugmessagesmodel.cpp
+++ b/src/plugins/qmlprofiler/debugmessagesmodel.cpp
@@ -75,11 +75,13 @@ QVariantList DebugMessagesModel::labels() const
QVariantMap DebugMessagesModel::details(int index) const
{
- const QmlEventType &type = modelManager()->qmlModel()->eventTypes()[m_data[index].typeId];
+ const QmlProfilerModelManager *manager = modelManager();
+ const QmlEventType &type = manager->qmlModel()->eventTypes()[m_data[index].typeId];
QVariantMap result;
result.insert(QLatin1String("displayName"), messageType(type.detailType()));
- result.insert(tr("Timestamp"), Timeline::formatTime(startTime(index)));
+ result.insert(tr("Timestamp"), Timeline::formatTime(startTime(index),
+ manager->traceTime()->duration()));
result.insert(tr("Message"), m_data[index].text);
result.insert(tr("Location"), type.displayName());
return result;
diff --git a/src/plugins/qmlprofiler/inputeventsmodel.cpp b/src/plugins/qmlprofiler/inputeventsmodel.cpp
index 9b50aa0cec..0d1f91d2b8 100644
--- a/src/plugins/qmlprofiler/inputeventsmodel.cpp
+++ b/src/plugins/qmlprofiler/inputeventsmodel.cpp
@@ -77,7 +77,8 @@ QMetaEnum InputEventsModel::metaEnum(const char *name)
QVariantMap InputEventsModel::details(int index) const
{
QVariantMap result;
- result.insert(tr("Timestamp"), Timeline::formatTime(startTime(index)));
+ result.insert(tr("Timestamp"), Timeline::formatTime(startTime(index),
+ modelManager()->traceTime()->duration()));
QString type;
const InputEvent &event = m_data[index];
switch (event.type) {