aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qmlprofiler/qmlprofilerclient.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@theqtcompany.com>2015-09-17 13:34:38 +0200
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2015-10-30 20:07:45 +0000
commitcdb0ddeffd1bab0afd4c763e44431b11c8e8e0b0 (patch)
treea131686359acd1f9bdc378fa5523a8d726397e6d /tools/qmlprofiler/qmlprofilerclient.cpp
parentb5cd093559d71fb28c9c8e9cffc415e1aa1e7b11 (diff)
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 <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'tools/qmlprofiler/qmlprofilerclient.cpp')
-rw-r--r--tools/qmlprofiler/qmlprofilerclient.cpp20
1 files changed, 19 insertions, 1 deletions
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<QQmlProfilerDefinitions::InputEventType>(type), time, a, b);
}
} else if (messageType == QQmlProfilerDefinitions::Complete) {
emit complete();