From cdb0ddeffd1bab0afd4c763e44431b11c8e8e0b0 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Thu, 17 Sep 2015 13:34:38 +0200 Subject: QmlProfiler: Collect useful input events Just "Key" or "Mouse" as only attributes of input events are not very useful. This change adds some additional information and also collects input events from QQuickWindow. Change-Id: I062bbffeef3fa87776bc8be33f2321edf793faa2 Reviewed-by: Simon Hausmann --- tools/qmlprofiler/qmlprofilerclient.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'tools/qmlprofiler/qmlprofilerclient.cpp') diff --git a/tools/qmlprofiler/qmlprofilerclient.cpp b/tools/qmlprofiler/qmlprofilerclient.cpp index 28cb64066d..5e63529d35 100644 --- a/tools/qmlprofiler/qmlprofilerclient.cpp +++ b/tools/qmlprofiler/qmlprofilerclient.cpp @@ -157,7 +157,25 @@ void QmlProfilerClient::messageReceived(const QByteArray &data) event == QQmlProfilerDefinitions::Mouse) { if (!(d->features & one << QQmlProfilerDefinitions::ProfileInputEvents)) return; - emit this->inputEvent((QQmlProfilerDefinitions::EventType)event, time); + + int type; + if (!stream.atEnd()) { + stream >> type; + } else { + type = (event == QQmlProfilerDefinitions::Key) ? + QQmlProfilerDefinitions::InputKeyUnknown : + QQmlProfilerDefinitions::InputMouseUnknown; + } + + int a = 0; + if (!stream.atEnd()) + stream >> a; + + int b = 0; + if (!stream.atEnd()) + stream >> b; + + emit inputEvent(static_cast(type), time, a, b); } } else if (messageType == QQmlProfilerDefinitions::Complete) { emit complete(); -- cgit v1.2.3