diff options
author | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-10-23 17:46:59 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-11-05 08:42:16 +0000 |
commit | 834883b0fb379bfd17fbbbebb371b0d72560c1b3 (patch) | |
tree | bf90707b0e71433264cfe34903b4ec01a2a6d62c /src/plugins/qmlprofiler/qmlprofilertracefile.cpp | |
parent | db64434b400d94a04309ba970e15434a6bc232c5 (diff) |
QmlProfiler: Support additional attributes of input events
Change-Id: I92a28d0476ad814601f33b76e508bdbea02eefff
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'src/plugins/qmlprofiler/qmlprofilertracefile.cpp')
-rw-r--r-- | src/plugins/qmlprofiler/qmlprofilertracefile.cpp | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/src/plugins/qmlprofiler/qmlprofilertracefile.cpp b/src/plugins/qmlprofiler/qmlprofilertracefile.cpp index fc6888532b..2143f40d5d 100644 --- a/src/plugins/qmlprofiler/qmlprofilertracefile.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertracefile.cpp @@ -411,6 +411,12 @@ void QmlProfilerFileReader::loadProfilerDataModel(QXmlStreamReader &stream) range.numericData4 = attributes.value(_("timing4")).toString().toLongLong(); if (attributes.hasAttribute(_("timing5"))) range.numericData5 = attributes.value(_("timing5")).toString().toLongLong(); + if (attributes.hasAttribute(_("type"))) + range.numericData1 = attributes.value(_("type")).toString().toLongLong(); + if (attributes.hasAttribute(_("data1"))) + range.numericData2 = attributes.value(_("data1")).toString().toLongLong(); + if (attributes.hasAttribute(_("data2"))) + range.numericData3 = attributes.value(_("data2")).toString().toLongLong(); range.typeIndex = attributes.value(_("eventIndex")).toString().toInt(); @@ -601,11 +607,19 @@ void QmlProfilerFileWriter::save(QIODevice *device) const QmlProfilerDataModel::QmlEventTypeData &event = m_qmlEvents[range.typeIndex]; - // special: animation event - if (event.message == Event && event.detailType == AnimationFrame) { - stream.writeAttribute(_("framerate"), QString::number(range.numericData1)); - stream.writeAttribute(_("animationcount"), QString::number(range.numericData2)); - stream.writeAttribute(_("thread"), QString::number(range.numericData3)); + + if (event.message == Event) { + if (event.detailType == AnimationFrame) { + // special: animation event + stream.writeAttribute(_("framerate"), QString::number(range.numericData1)); + stream.writeAttribute(_("animationcount"), QString::number(range.numericData2)); + stream.writeAttribute(_("thread"), QString::number(range.numericData3)); + } else if (event.detailType == Key || event.detailType == Mouse) { + // special: input event + stream.writeAttribute(_("type"), QString::number(range.numericData1)); + stream.writeAttribute(_("data1"), QString::number(range.numericData2)); + stream.writeAttribute(_("data2"), QString::number(range.numericData3)); + } } // special: pixmap cache event |