aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmlprofiler/qmleventtype.h
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2016-04-28 16:19:17 +0200
committerUlf Hermann <ulf.hermann@qt.io>2016-05-23 12:30:09 +0000
commit1e8996b438e6ad28f07882f15967d46678f45335 (patch)
tree6bffcd22fc32a42129a1e4ac5a5a8e93c5353fdb /src/plugins/qmlprofiler/qmleventtype.h
parent911c8842b22324bb72a951265cff3ade24494112 (diff)
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 <joerg.bornemann@qt.io>
Diffstat (limited to 'src/plugins/qmlprofiler/qmleventtype.h')
-rw-r--r--src/plugins/qmlprofiler/qmleventtype.h27
1 files changed, 27 insertions, 0 deletions
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);