From 1e8996b438e6ad28f07882f15967d46678f45335 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Thu, 28 Apr 2016 16:19:17 +0200 Subject: QmlProfiler: Methods for dispatching events by feature When announcing features models have to provide functions that handle events for those features now. The model manager gets a function to dispatch events to the models that subscribe to them. Change-Id: I3fd80443a68ba264a513d8d53ed473cf072f1dc7 Reviewed-by: Joerg Bornemann --- src/plugins/qmlprofiler/qmleventtype.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'src/plugins/qmlprofiler/qmleventtype.h') diff --git a/src/plugins/qmlprofiler/qmleventtype.h b/src/plugins/qmlprofiler/qmleventtype.h index 5221091ece..da22f83121 100644 --- a/src/plugins/qmlprofiler/qmleventtype.h +++ b/src/plugins/qmlprofiler/qmleventtype.h @@ -46,6 +46,33 @@ struct QmlEventType { Message message; RangeType rangeType; int detailType; // can be EventType, BindingType, PixmapEventType or SceneGraphFrameType + + ProfileFeature feature() const + { + switch (message) { + case Event: { + switch (detailType) { + case Mouse: + case Key: + return ProfileInputEvents; + case AnimationFrame: + return ProfileAnimations; + default: + return MaximumProfileFeature; + } + } + case PixmapCacheEvent: + return ProfilePixmapCache; + case SceneGraphFrame: + return ProfileSceneGraph; + case MemoryAllocation: + return ProfileMemory; + case DebugMessage: + return ProfileDebugMessages; + default: + return featureFromRangeType(rangeType); + } + } }; QDataStream &operator>>(QDataStream &stream, QmlEventType &type); -- cgit v1.2.3