From c3a873b90689ea82c380d8b2712497ffa98e62b7 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Thu, 2 Jun 2016 14:56:32 +0200 Subject: [PATCH] QmlProfiler: Add some consistency to input events model Methods that are public in the base class should also be public in the derived class. Also, the accepted() method takes a type, not an event. Change-Id: I086d382ffc2e71c7efda56b0dbf341942986582c Reviewed-by: Joerg Bornemann --- src/plugins/qmlprofiler/inputeventsmodel.cpp | 6 +++--- src/plugins/qmlprofiler/inputeventsmodel.h | 11 +++++------ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/plugins/qmlprofiler/inputeventsmodel.cpp b/src/plugins/qmlprofiler/inputeventsmodel.cpp index 35a6790950f..17114a1a967 100644 --- a/src/plugins/qmlprofiler/inputeventsmodel.cpp +++ b/src/plugins/qmlprofiler/inputeventsmodel.cpp @@ -167,10 +167,10 @@ void InputEventsModel::clear() QmlProfilerTimelineModel::clear(); } -bool InputEventsModel::accepted(const QmlEventType &event) const +bool InputEventsModel::accepted(const QmlEventType &type) const { - return QmlProfilerTimelineModel::accepted(event) && - (event.detailType == Mouse || event.detailType == Key); + return QmlProfilerTimelineModel::accepted(type) && + (type.detailType == Mouse || type.detailType == Key); } InputEventsModel::InputEvent::InputEvent(InputEventType type, int a, int b) : diff --git a/src/plugins/qmlprofiler/inputeventsmodel.h b/src/plugins/qmlprofiler/inputeventsmodel.h index 424bad88511..23509c19e03 100644 --- a/src/plugins/qmlprofiler/inputeventsmodel.h +++ b/src/plugins/qmlprofiler/inputeventsmodel.h @@ -34,12 +34,6 @@ class InputEventsModel : public QmlProfilerTimelineModel { Q_OBJECT -protected: - bool accepted(const QmlEventType &event) const override; - void loadEvent(const QmlEvent &event, const QmlEventType &type) override; - void finalize() override; - void clear() override; - public: struct InputEvent { InputEvent(InputEventType type = MaximumInputEventType, int a = 0, int b = 0); @@ -50,6 +44,11 @@ public: InputEventsModel(QmlProfilerModelManager *manager, QObject *parent = 0); + bool accepted(const QmlEventType &type) const override; + void loadEvent(const QmlEvent &event, const QmlEventType &type) override; + void finalize() override; + void clear() override; + int typeId(int index) const override; QColor color(int index) const override; QVariantList labels() const override;