aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmlprofiler
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2018-03-28 15:40:13 +0200
committerUlf Hermann <ulf.hermann@qt.io>2018-04-17 14:11:51 +0000
commit780d4c6a434c84c7bfdd6b2cf0020891481f7b76 (patch)
treec47dfeec4f334df2eae8f964de243c30f4f1be23 /src/plugins/qmlprofiler
parent181ad6671ce9e1de04f79eabb2d8af9cc2c36484 (diff)
Timeline: Move modelId generation into aggregator
The way the notes model works requires every timeline model to have a different ID. Conversely no other kind of model actually needs an ID. Therefore it makes sense to have the TimelineModelAggregator manage the IDs as every timeline model will sooner or later be associated with an aggregator. Change-Id: Ib8b2c88ed883351d4e3e156dd13e1dd113c21808 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Diffstat (limited to 'src/plugins/qmlprofiler')
-rw-r--r--src/plugins/qmlprofiler/debugmessagesmodel.cpp3
-rw-r--r--src/plugins/qmlprofiler/debugmessagesmodel.h2
-rw-r--r--src/plugins/qmlprofiler/flamegraphmodel.cpp1
-rw-r--r--src/plugins/qmlprofiler/inputeventsmodel.cpp3
-rw-r--r--src/plugins/qmlprofiler/inputeventsmodel.h2
-rw-r--r--src/plugins/qmlprofiler/memoryusagemodel.cpp3
-rw-r--r--src/plugins/qmlprofiler/memoryusagemodel.h2
-rw-r--r--src/plugins/qmlprofiler/pixmapcachemodel.cpp3
-rw-r--r--src/plugins/qmlprofiler/pixmapcachemodel.h2
-rw-r--r--src/plugins/qmlprofiler/qmlprofileranimationsmodel.cpp2
-rw-r--r--src/plugins/qmlprofiler/qmlprofileranimationsmodel.h3
-rw-r--r--src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp6
-rw-r--r--src/plugins/qmlprofiler/qmlprofilermodelmanager.h1
-rw-r--r--src/plugins/qmlprofiler/qmlprofilerrangemodel.cpp2
-rw-r--r--src/plugins/qmlprofiler/qmlprofilerrangemodel.h3
-rw-r--r--src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.cpp1
-rw-r--r--src/plugins/qmlprofiler/qmlprofilertimelinemodel.cpp6
-rw-r--r--src/plugins/qmlprofiler/qmlprofilertimelinemodel.h4
-rw-r--r--src/plugins/qmlprofiler/scenegraphtimelinemodel.cpp2
-rw-r--r--src/plugins/qmlprofiler/scenegraphtimelinemodel.h3
-rw-r--r--src/plugins/qmlprofiler/tests/debugmessagesmodel_test.cpp2
-rw-r--r--src/plugins/qmlprofiler/tests/debugmessagesmodel_test.h1
-rw-r--r--src/plugins/qmlprofiler/tests/flamegraphmodel_test.cpp7
-rw-r--r--src/plugins/qmlprofiler/tests/flamegraphmodel_test.h7
-rw-r--r--src/plugins/qmlprofiler/tests/flamegraphview_test.cpp5
-rw-r--r--src/plugins/qmlprofiler/tests/flamegraphview_test.h4
-rw-r--r--src/plugins/qmlprofiler/tests/inputeventsmodel_test.cpp2
-rw-r--r--src/plugins/qmlprofiler/tests/inputeventsmodel_test.h1
-rw-r--r--src/plugins/qmlprofiler/tests/memoryusagemodel_test.cpp2
-rw-r--r--src/plugins/qmlprofiler/tests/memoryusagemodel_test.h1
-rw-r--r--src/plugins/qmlprofiler/tests/pixmapcachemodel_test.cpp2
-rw-r--r--src/plugins/qmlprofiler/tests/pixmapcachemodel_test.h1
-rw-r--r--src/plugins/qmlprofiler/tests/qmlprofileranimationsmodel_test.cpp2
-rw-r--r--src/plugins/qmlprofiler/tests/qmlprofileranimationsmodel_test.h1
-rw-r--r--src/plugins/qmlprofiler/tests/qmlprofilerbindingloopsrenderpass_test.cpp12
35 files changed, 61 insertions, 43 deletions
diff --git a/src/plugins/qmlprofiler/debugmessagesmodel.cpp b/src/plugins/qmlprofiler/debugmessagesmodel.cpp
index b0217bf68d1..82578df8ec4 100644
--- a/src/plugins/qmlprofiler/debugmessagesmodel.cpp
+++ b/src/plugins/qmlprofiler/debugmessagesmodel.cpp
@@ -30,7 +30,8 @@
namespace QmlProfiler {
namespace Internal {
-DebugMessagesModel::DebugMessagesModel(QmlProfilerModelManager *manager, QObject *parent) :
+DebugMessagesModel::DebugMessagesModel(QmlProfilerModelManager *manager,
+ Timeline::TimelineModelAggregator *parent) :
QmlProfilerTimelineModel(manager, DebugMessage, MaximumRangeType, ProfileDebugMessages, parent),
m_maximumMsgType(-1)
{
diff --git a/src/plugins/qmlprofiler/debugmessagesmodel.h b/src/plugins/qmlprofiler/debugmessagesmodel.h
index 4cb49e4e276..6af88796fb2 100644
--- a/src/plugins/qmlprofiler/debugmessagesmodel.h
+++ b/src/plugins/qmlprofiler/debugmessagesmodel.h
@@ -35,7 +35,7 @@ class DebugMessagesModel : public QmlProfilerTimelineModel
Q_OBJECT
public:
- DebugMessagesModel(QmlProfilerModelManager *manager, QObject *parent = 0);
+ DebugMessagesModel(QmlProfilerModelManager *manager, Timeline::TimelineModelAggregator *parent);
int typeId(int index) const override;
QRgb color(int index) const override;
diff --git a/src/plugins/qmlprofiler/flamegraphmodel.cpp b/src/plugins/qmlprofiler/flamegraphmodel.cpp
index 7b2e26d2524..41e0b141558 100644
--- a/src/plugins/qmlprofiler/flamegraphmodel.cpp
+++ b/src/plugins/qmlprofiler/flamegraphmodel.cpp
@@ -57,7 +57,6 @@ FlameGraphModel::FlameGraphModel(QmlProfilerModelManager *modelManager,
this, &FlameGraphModel::onTypeDetailsFinished);
connect(modelManager->notesModel(), &Timeline::TimelineNotesModel::changed,
this, [this](int typeId, int, int){loadNotes(typeId, true);});
- m_modelId = modelManager->registerModelProxy();
m_acceptedFeatures = supportedFeatures();
modelManager->announceFeatures(m_acceptedFeatures,
diff --git a/src/plugins/qmlprofiler/inputeventsmodel.cpp b/src/plugins/qmlprofiler/inputeventsmodel.cpp
index e89d0ae5963..ae8e46f405d 100644
--- a/src/plugins/qmlprofiler/inputeventsmodel.cpp
+++ b/src/plugins/qmlprofiler/inputeventsmodel.cpp
@@ -36,7 +36,8 @@
namespace QmlProfiler {
namespace Internal {
-InputEventsModel::InputEventsModel(QmlProfilerModelManager *manager, QObject *parent) :
+InputEventsModel::InputEventsModel(QmlProfilerModelManager *manager,
+ Timeline::TimelineModelAggregator *parent) :
QmlProfilerTimelineModel(manager, Event, MaximumRangeType, ProfileInputEvents, parent),
m_keyTypeId(-1), m_mouseTypeId(-1)
{
diff --git a/src/plugins/qmlprofiler/inputeventsmodel.h b/src/plugins/qmlprofiler/inputeventsmodel.h
index 0e77893a17b..d38350777a1 100644
--- a/src/plugins/qmlprofiler/inputeventsmodel.h
+++ b/src/plugins/qmlprofiler/inputeventsmodel.h
@@ -42,7 +42,7 @@ public:
int b;
};
- InputEventsModel(QmlProfilerModelManager *manager, QObject *parent = 0);
+ InputEventsModel(QmlProfilerModelManager *manager, Timeline::TimelineModelAggregator *parent);
bool accepted(const QmlEventType &type) const override;
void loadEvent(const QmlEvent &event, const QmlEventType &type) override;
diff --git a/src/plugins/qmlprofiler/memoryusagemodel.cpp b/src/plugins/qmlprofiler/memoryusagemodel.cpp
index b379e7455bc..5c878a0410a 100644
--- a/src/plugins/qmlprofiler/memoryusagemodel.cpp
+++ b/src/plugins/qmlprofiler/memoryusagemodel.cpp
@@ -32,7 +32,8 @@
namespace QmlProfiler {
namespace Internal {
-MemoryUsageModel::MemoryUsageModel(QmlProfilerModelManager *manager, QObject *parent) :
+MemoryUsageModel::MemoryUsageModel(QmlProfilerModelManager *manager,
+ Timeline::TimelineModelAggregator *parent) :
QmlProfilerTimelineModel(manager, MemoryAllocation, MaximumRangeType, ProfileMemory, parent)
{
// Announce additional features. The base class already announces the main feature.
diff --git a/src/plugins/qmlprofiler/memoryusagemodel.h b/src/plugins/qmlprofiler/memoryusagemodel.h
index 98ec40f4d5e..65c0d7a528b 100644
--- a/src/plugins/qmlprofiler/memoryusagemodel.h
+++ b/src/plugins/qmlprofiler/memoryusagemodel.h
@@ -51,7 +51,7 @@ public:
void update(qint64 amount);
};
- MemoryUsageModel(QmlProfilerModelManager *manager, QObject *parent = 0);
+ MemoryUsageModel(QmlProfilerModelManager *manager, Timeline::TimelineModelAggregator *parent);
qint64 rowMaxValue(int rowNumber) const override;
diff --git a/src/plugins/qmlprofiler/pixmapcachemodel.cpp b/src/plugins/qmlprofiler/pixmapcachemodel.cpp
index 1e47dbe4207..b21e2f7cfff 100644
--- a/src/plugins/qmlprofiler/pixmapcachemodel.cpp
+++ b/src/plugins/qmlprofiler/pixmapcachemodel.cpp
@@ -32,7 +32,8 @@
namespace QmlProfiler {
namespace Internal {
-PixmapCacheModel::PixmapCacheModel(QmlProfilerModelManager *manager, QObject *parent) :
+PixmapCacheModel::PixmapCacheModel(QmlProfilerModelManager *manager,
+ Timeline::TimelineModelAggregator *parent) :
QmlProfilerTimelineModel(manager, PixmapCacheEvent, MaximumRangeType, ProfilePixmapCache,
parent)
{
diff --git a/src/plugins/qmlprofiler/pixmapcachemodel.h b/src/plugins/qmlprofiler/pixmapcachemodel.h
index c645c53deaa..ebd08e131f3 100644
--- a/src/plugins/qmlprofiler/pixmapcachemodel.h
+++ b/src/plugins/qmlprofiler/pixmapcachemodel.h
@@ -94,7 +94,7 @@ public:
qint64 cacheSize = 0;
};
- PixmapCacheModel(QmlProfilerModelManager *manager, QObject *parent = 0);
+ PixmapCacheModel(QmlProfilerModelManager *manager, Timeline::TimelineModelAggregator *parent);
qint64 rowMaxValue(int rowNumber) const override;
diff --git a/src/plugins/qmlprofiler/qmlprofileranimationsmodel.cpp b/src/plugins/qmlprofiler/qmlprofileranimationsmodel.cpp
index 337da28feda..f743d2a5100 100644
--- a/src/plugins/qmlprofiler/qmlprofileranimationsmodel.cpp
+++ b/src/plugins/qmlprofiler/qmlprofileranimationsmodel.cpp
@@ -41,7 +41,7 @@ namespace QmlProfiler {
namespace Internal {
QmlProfilerAnimationsModel::QmlProfilerAnimationsModel(QmlProfilerModelManager *manager,
- QObject *parent) :
+ Timeline::TimelineModelAggregator *parent) :
QmlProfilerTimelineModel(manager, Event, MaximumRangeType, ProfileAnimations, parent)
{
m_minNextStartTimes[0] = m_minNextStartTimes[1] = 0;
diff --git a/src/plugins/qmlprofiler/qmlprofileranimationsmodel.h b/src/plugins/qmlprofiler/qmlprofileranimationsmodel.h
index 8d109698338..7364db61e33 100644
--- a/src/plugins/qmlprofiler/qmlprofileranimationsmodel.h
+++ b/src/plugins/qmlprofiler/qmlprofileranimationsmodel.h
@@ -49,7 +49,8 @@ public:
int typeId;
};
- QmlProfilerAnimationsModel(QmlProfilerModelManager *manager, QObject *parent = 0);
+ QmlProfilerAnimationsModel(QmlProfilerModelManager *manager,
+ Timeline::TimelineModelAggregator *parent);
qint64 rowMaxValue(int rowNumber) const override;
diff --git a/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp b/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp
index 7dbb10ba4ad..2f5afbd8acd 100644
--- a/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilermodelmanager.cpp
@@ -76,7 +76,6 @@ public:
QmlProfilerModelManager::State state = Empty;
- int numRegisteredModels = 0;
int numFinishedFinalizers = 0;
int numLoadedEvents = 0;
@@ -193,11 +192,6 @@ int QmlProfilerModelManager::numEventTypes() const
return d->eventTypes.count();
}
-int QmlProfilerModelManager::registerModelProxy()
-{
- return d->numRegisteredModels++;
-}
-
int QmlProfilerModelManager::numFinishedFinalizers() const
{
return d->numFinishedFinalizers;
diff --git a/src/plugins/qmlprofiler/qmlprofilermodelmanager.h b/src/plugins/qmlprofiler/qmlprofilermodelmanager.h
index dd04e841a6a..00b525cbf30 100644
--- a/src/plugins/qmlprofiler/qmlprofilermodelmanager.h
+++ b/src/plugins/qmlprofiler/qmlprofilermodelmanager.h
@@ -76,7 +76,6 @@ public:
int numEvents() const;
int numEventTypes() const;
- int registerModelProxy();
void announceFeatures(quint64 features, EventLoader eventLoader, Finalizer finalizer);
int numFinishedFinalizers() const;
diff --git a/src/plugins/qmlprofiler/qmlprofilerrangemodel.cpp b/src/plugins/qmlprofiler/qmlprofilerrangemodel.cpp
index 243e07a0c02..07a5d20e0d9 100644
--- a/src/plugins/qmlprofiler/qmlprofilerrangemodel.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilerrangemodel.cpp
@@ -43,7 +43,7 @@ namespace QmlProfiler {
namespace Internal {
QmlProfilerRangeModel::QmlProfilerRangeModel(QmlProfilerModelManager *manager, RangeType range,
- QObject *parent) :
+ Timeline::TimelineModelAggregator *parent) :
QmlProfilerTimelineModel(manager, MaximumMessage, range, featureFromRangeType(range), parent)
{
m_expandedRowTypes << -1;
diff --git a/src/plugins/qmlprofiler/qmlprofilerrangemodel.h b/src/plugins/qmlprofiler/qmlprofilerrangemodel.h
index 7e93b67adfb..1ca4af7fcaa 100644
--- a/src/plugins/qmlprofiler/qmlprofilerrangemodel.h
+++ b/src/plugins/qmlprofiler/qmlprofilerrangemodel.h
@@ -56,7 +56,8 @@ public:
int bindingLoopHead;
};
- QmlProfilerRangeModel(QmlProfilerModelManager *manager, RangeType range, QObject *parent = 0);
+ QmlProfilerRangeModel(QmlProfilerModelManager *manager, RangeType range,
+ Timeline::TimelineModelAggregator *parent);
Q_INVOKABLE int expandedRow(int index) const override;
Q_INVOKABLE int collapsedRow(int index) const override;
diff --git a/src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.cpp b/src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.cpp
index 13b6064eb46..ef8a1ac882a 100644
--- a/src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilerstatisticsmodel.cpp
@@ -70,7 +70,6 @@ QmlProfilerStatisticsModel::QmlProfilerStatisticsModel(QmlProfilerModelManager *
this, &QmlProfilerStatisticsModel::modelManagerStateChanged);
connect(modelManager->notesModel(), &Timeline::TimelineNotesModel::changed,
this, &QmlProfilerStatisticsModel::notesChanged);
- modelManager->registerModelProxy();
m_acceptedTypes << Compiling << Creating << Binding << HandlingSignal << Javascript;
diff --git a/src/plugins/qmlprofiler/qmlprofilertimelinemodel.cpp b/src/plugins/qmlprofiler/qmlprofilertimelinemodel.cpp
index 2aeb0883ef2..8cc9ffc0707 100644
--- a/src/plugins/qmlprofiler/qmlprofilertimelinemodel.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilertimelinemodel.cpp
@@ -29,9 +29,9 @@ namespace QmlProfiler {
QmlProfilerTimelineModel::QmlProfilerTimelineModel(QmlProfilerModelManager *modelManager,
Message message, RangeType rangeType,
- ProfileFeature mainFeature, QObject *parent) :
- TimelineModel(modelManager->registerModelProxy(), parent),
- m_message(message), m_rangeType(rangeType), m_mainFeature(mainFeature),
+ ProfileFeature mainFeature,
+ Timeline::TimelineModelAggregator *parent) :
+ TimelineModel(parent), m_message(message), m_rangeType(rangeType), m_mainFeature(mainFeature),
m_modelManager(modelManager)
{
setDisplayName(tr(QmlProfilerModelManager::featureName(mainFeature)));
diff --git a/src/plugins/qmlprofiler/qmlprofilertimelinemodel.h b/src/plugins/qmlprofiler/qmlprofilertimelinemodel.h
index 742bec73b4b..12d2229586e 100644
--- a/src/plugins/qmlprofiler/qmlprofilertimelinemodel.h
+++ b/src/plugins/qmlprofiler/qmlprofilertimelinemodel.h
@@ -28,6 +28,7 @@
#include "qmlprofiler_global.h"
#include "qmlprofilermodelmanager.h"
#include "timeline/timelinemodel.h"
+#include "timeline/timelinemodelaggregator.h"
namespace QmlProfiler {
@@ -39,7 +40,8 @@ class QMLPROFILER_EXPORT QmlProfilerTimelineModel : public Timeline::TimelineMod
public:
QmlProfilerTimelineModel(QmlProfilerModelManager *modelManager, Message message,
- RangeType rangeType, ProfileFeature mainFeature, QObject *parent);
+ RangeType rangeType, ProfileFeature mainFeature,
+ Timeline::TimelineModelAggregator *parent);
QmlProfilerModelManager *modelManager() const;
diff --git a/src/plugins/qmlprofiler/scenegraphtimelinemodel.cpp b/src/plugins/qmlprofiler/scenegraphtimelinemodel.cpp
index 18342e7b6b2..ab14fbae118 100644
--- a/src/plugins/qmlprofiler/scenegraphtimelinemodel.cpp
+++ b/src/plugins/qmlprofiler/scenegraphtimelinemodel.cpp
@@ -76,7 +76,7 @@ Q_STATIC_ASSERT(sizeof(StageLabels) ==
SceneGraphTimelineModel::MaximumSceneGraphStage * sizeof(const char *));
SceneGraphTimelineModel::SceneGraphTimelineModel(QmlProfilerModelManager *manager,
- QObject *parent) :
+ Timeline::TimelineModelAggregator *parent) :
QmlProfilerTimelineModel(manager, SceneGraphFrame, MaximumRangeType, ProfileSceneGraph, parent)
{
}
diff --git a/src/plugins/qmlprofiler/scenegraphtimelinemodel.h b/src/plugins/qmlprofiler/scenegraphtimelinemodel.h
index 0dd0e6d5108..a4338738aa6 100644
--- a/src/plugins/qmlprofiler/scenegraphtimelinemodel.h
+++ b/src/plugins/qmlprofiler/scenegraphtimelinemodel.h
@@ -82,7 +82,8 @@ public:
int glyphCount; // only used for one event type
};
- SceneGraphTimelineModel(QmlProfilerModelManager *manager, QObject *parent = 0);
+ SceneGraphTimelineModel(QmlProfilerModelManager *manager,
+ Timeline::TimelineModelAggregator *parent);
int expandedRow(int index) const override;
int collapsedRow(int index) const override;
diff --git a/src/plugins/qmlprofiler/tests/debugmessagesmodel_test.cpp b/src/plugins/qmlprofiler/tests/debugmessagesmodel_test.cpp
index 85103758a66..71a68ded907 100644
--- a/src/plugins/qmlprofiler/tests/debugmessagesmodel_test.cpp
+++ b/src/plugins/qmlprofiler/tests/debugmessagesmodel_test.cpp
@@ -33,7 +33,7 @@ namespace QmlProfiler {
namespace Internal {
DebugMessagesModelTest::DebugMessagesModelTest(QObject *parent) :
- QObject(parent), manager(nullptr), model(&manager)
+ QObject(parent), model(&manager, &aggregator)
{
}
diff --git a/src/plugins/qmlprofiler/tests/debugmessagesmodel_test.h b/src/plugins/qmlprofiler/tests/debugmessagesmodel_test.h
index 581908e55bd..23dcf277d48 100644
--- a/src/plugins/qmlprofiler/tests/debugmessagesmodel_test.h
+++ b/src/plugins/qmlprofiler/tests/debugmessagesmodel_test.h
@@ -51,6 +51,7 @@ private slots:
private:
QmlProfilerModelManager manager;
+ Timeline::TimelineModelAggregator aggregator;
DebugMessagesModel model;
};
diff --git a/src/plugins/qmlprofiler/tests/flamegraphmodel_test.cpp b/src/plugins/qmlprofiler/tests/flamegraphmodel_test.cpp
index c2db0182451..c4abc490849 100644
--- a/src/plugins/qmlprofiler/tests/flamegraphmodel_test.cpp
+++ b/src/plugins/qmlprofiler/tests/flamegraphmodel_test.cpp
@@ -37,10 +37,11 @@ FlameGraphModelTest::FlameGraphModelTest(QObject *parent) :
{
}
-int FlameGraphModelTest::generateData(QmlProfilerModelManager *manager)
+int FlameGraphModelTest::generateData(QmlProfilerModelManager *manager,
+ Timeline::TimelineModelAggregator *aggregator)
{
// Notes only work with timeline models
- QmlProfilerRangeModel *rangeModel = new QmlProfilerRangeModel(manager, Javascript, manager);
+ QmlProfilerRangeModel *rangeModel = new QmlProfilerRangeModel(manager, Javascript, aggregator);
int rangeModelId = rangeModel->modelId();
manager->notesModel()->addTimelineModel(rangeModel);
@@ -95,7 +96,7 @@ int FlameGraphModelTest::generateData(QmlProfilerModelManager *manager)
void FlameGraphModelTest::initTestCase()
{
QCOMPARE(model.modelManager(), &manager);
- rangeModelId = generateData(&manager);
+ rangeModelId = generateData(&manager, &aggregator);
QCOMPARE(manager.state(), QmlProfilerModelManager::Done);
}
diff --git a/src/plugins/qmlprofiler/tests/flamegraphmodel_test.h b/src/plugins/qmlprofiler/tests/flamegraphmodel_test.h
index 1099ee62007..627a217d20c 100644
--- a/src/plugins/qmlprofiler/tests/flamegraphmodel_test.h
+++ b/src/plugins/qmlprofiler/tests/flamegraphmodel_test.h
@@ -27,6 +27,9 @@
#include <qmlprofiler/flamegraphmodel.h>
#include <qmlprofiler/qmlprofilermodelmanager.h>
+
+#include <timeline/timelinemodelaggregator.h>
+
#include <QObject>
namespace QmlProfiler {
@@ -37,7 +40,8 @@ class FlameGraphModelTest : public QObject
Q_OBJECT
public:
FlameGraphModelTest(QObject *parent = nullptr);
- static int generateData(QmlProfilerModelManager *manager);
+ static int generateData(QmlProfilerModelManager *manager,
+ Timeline::TimelineModelAggregator *aggregator);
private slots:
void initTestCase();
@@ -50,6 +54,7 @@ private slots:
private:
QmlProfilerModelManager manager;
+ Timeline::TimelineModelAggregator aggregator;
FlameGraphModel model;
int rangeModelId = -1;
};
diff --git a/src/plugins/qmlprofiler/tests/flamegraphview_test.cpp b/src/plugins/qmlprofiler/tests/flamegraphview_test.cpp
index e371bf584d1..732128ab5a5 100644
--- a/src/plugins/qmlprofiler/tests/flamegraphview_test.cpp
+++ b/src/plugins/qmlprofiler/tests/flamegraphview_test.cpp
@@ -34,7 +34,8 @@
namespace QmlProfiler {
namespace Internal {
-FlameGraphViewTest::FlameGraphViewTest(QObject *parent) : QObject(parent), view(&manager)
+FlameGraphViewTest::FlameGraphViewTest(QObject *parent)
+ : QObject(parent), view(&manager)
{
}
@@ -42,7 +43,7 @@ void FlameGraphViewTest::initTestCase()
{
connect(&view, &QmlProfilerEventsView::showFullRange,
this, [this](){ manager.restrictToRange(-1, -1); });
- FlameGraphModelTest::generateData(&manager);
+ FlameGraphModelTest::generateData(&manager, &aggregator);
QCOMPARE(manager.state(), QmlProfilerModelManager::Done);
view.resize(500, 500);
view.show();
diff --git a/src/plugins/qmlprofiler/tests/flamegraphview_test.h b/src/plugins/qmlprofiler/tests/flamegraphview_test.h
index c99a2177d2b..2729306412f 100644
--- a/src/plugins/qmlprofiler/tests/flamegraphview_test.h
+++ b/src/plugins/qmlprofiler/tests/flamegraphview_test.h
@@ -27,6 +27,9 @@
#include <qmlprofiler/flamegraphview.h>
#include <qmlprofiler/qmlprofilermodelmanager.h>
+
+#include <timeline/timelinemodelaggregator.h>
+
#include <QObject>
namespace QmlProfiler {
@@ -46,6 +49,7 @@ private slots:
private:
QmlProfilerModelManager manager;
+ Timeline::TimelineModelAggregator aggregator;
FlameGraphView view;
};
diff --git a/src/plugins/qmlprofiler/tests/inputeventsmodel_test.cpp b/src/plugins/qmlprofiler/tests/inputeventsmodel_test.cpp
index fb6896e6f11..b92eca9f931 100644
--- a/src/plugins/qmlprofiler/tests/inputeventsmodel_test.cpp
+++ b/src/plugins/qmlprofiler/tests/inputeventsmodel_test.cpp
@@ -38,7 +38,7 @@ static InputEventType inputType(int i)
}
InputEventsModelTest::InputEventsModelTest(QObject *parent) :
- QObject(parent), manager(nullptr), model(&manager)
+ QObject(parent), model(&manager, &aggregator)
{
keyTypeId = manager.numEventTypes();
manager.addEventType(QmlEventType(Event, MaximumRangeType, Key));
diff --git a/src/plugins/qmlprofiler/tests/inputeventsmodel_test.h b/src/plugins/qmlprofiler/tests/inputeventsmodel_test.h
index af8b4e39cbd..16c92d83bb4 100644
--- a/src/plugins/qmlprofiler/tests/inputeventsmodel_test.h
+++ b/src/plugins/qmlprofiler/tests/inputeventsmodel_test.h
@@ -51,6 +51,7 @@ private slots:
private:
QmlProfilerModelManager manager;
+ Timeline::TimelineModelAggregator aggregator;
InputEventsModel model;
int mouseTypeId = -1;
diff --git a/src/plugins/qmlprofiler/tests/memoryusagemodel_test.cpp b/src/plugins/qmlprofiler/tests/memoryusagemodel_test.cpp
index 92d17524613..8e7db17b7c0 100644
--- a/src/plugins/qmlprofiler/tests/memoryusagemodel_test.cpp
+++ b/src/plugins/qmlprofiler/tests/memoryusagemodel_test.cpp
@@ -30,7 +30,7 @@ namespace QmlProfiler {
namespace Internal {
MemoryUsageModelTest::MemoryUsageModelTest(QObject *parent) : QObject(parent),
- manager(nullptr), model(&manager)
+ model(&manager, &aggregator)
{
}
diff --git a/src/plugins/qmlprofiler/tests/memoryusagemodel_test.h b/src/plugins/qmlprofiler/tests/memoryusagemodel_test.h
index c8b1c4b8c12..2bd40aa6a4a 100644
--- a/src/plugins/qmlprofiler/tests/memoryusagemodel_test.h
+++ b/src/plugins/qmlprofiler/tests/memoryusagemodel_test.h
@@ -54,6 +54,7 @@ private slots:
private:
QmlProfilerModelManager manager;
+ Timeline::TimelineModelAggregator aggregator;
MemoryUsageModel model;
int heapPageTypeId = -1;
diff --git a/src/plugins/qmlprofiler/tests/pixmapcachemodel_test.cpp b/src/plugins/qmlprofiler/tests/pixmapcachemodel_test.cpp
index c0148f2c83a..0f4a0079b75 100644
--- a/src/plugins/qmlprofiler/tests/pixmapcachemodel_test.cpp
+++ b/src/plugins/qmlprofiler/tests/pixmapcachemodel_test.cpp
@@ -31,7 +31,7 @@ namespace QmlProfiler {
namespace Internal {
PixmapCacheModelTest::PixmapCacheModelTest(QObject *parent) : QObject(parent),
- manager(nullptr), model(&manager)
+ model(&manager, &aggregator)
{
}
diff --git a/src/plugins/qmlprofiler/tests/pixmapcachemodel_test.h b/src/plugins/qmlprofiler/tests/pixmapcachemodel_test.h
index 8a6448bb105..f4f5819f350 100644
--- a/src/plugins/qmlprofiler/tests/pixmapcachemodel_test.h
+++ b/src/plugins/qmlprofiler/tests/pixmapcachemodel_test.h
@@ -48,6 +48,7 @@ private slots:
private:
QmlProfilerModelManager manager;
+ Timeline::TimelineModelAggregator aggregator;
PixmapCacheModel model;
int eventTypeIndices[2 * MaximumPixmapEventType];
diff --git a/src/plugins/qmlprofiler/tests/qmlprofileranimationsmodel_test.cpp b/src/plugins/qmlprofiler/tests/qmlprofileranimationsmodel_test.cpp
index 6b18fde64fb..98e3883c677 100644
--- a/src/plugins/qmlprofiler/tests/qmlprofileranimationsmodel_test.cpp
+++ b/src/plugins/qmlprofiler/tests/qmlprofileranimationsmodel_test.cpp
@@ -31,7 +31,7 @@ namespace QmlProfiler {
namespace Internal {
QmlProfilerAnimationsModelTest::QmlProfilerAnimationsModelTest(QObject *parent) :
- QObject(parent), manager(nullptr), model(&manager)
+ QObject(parent), model(&manager, &aggregator)
{
}
diff --git a/src/plugins/qmlprofiler/tests/qmlprofileranimationsmodel_test.h b/src/plugins/qmlprofiler/tests/qmlprofileranimationsmodel_test.h
index c53515a2051..4ce91a93ac9 100644
--- a/src/plugins/qmlprofiler/tests/qmlprofileranimationsmodel_test.h
+++ b/src/plugins/qmlprofiler/tests/qmlprofileranimationsmodel_test.h
@@ -52,6 +52,7 @@ private slots:
private:
QmlProfilerModelManager manager;
+ Timeline::TimelineModelAggregator aggregator;
QmlProfilerAnimationsModel model;
};
diff --git a/src/plugins/qmlprofiler/tests/qmlprofilerbindingloopsrenderpass_test.cpp b/src/plugins/qmlprofiler/tests/qmlprofilerbindingloopsrenderpass_test.cpp
index 54e1bb4c133..ab451e04e3c 100644
--- a/src/plugins/qmlprofiler/tests/qmlprofilerbindingloopsrenderpass_test.cpp
+++ b/src/plugins/qmlprofiler/tests/qmlprofilerbindingloopsrenderpass_test.cpp
@@ -37,12 +37,13 @@ namespace Internal {
class DummyModel : public QmlProfilerRangeModel {
public:
- DummyModel(QmlProfilerModelManager *manager);
+ DummyModel(QmlProfilerModelManager *manager, Timeline::TimelineModelAggregator *aggregator);
void loadData();
};
-DummyModel::DummyModel(QmlProfilerModelManager *manager) :
- QmlProfilerRangeModel(manager, Binding)
+DummyModel::DummyModel(QmlProfilerModelManager *manager,
+ Timeline::TimelineModelAggregator *aggregator) :
+ QmlProfilerRangeModel(manager, Binding, aggregator)
{
}
@@ -90,8 +91,9 @@ void QmlProfilerBindingLoopsRenderPassTest::testUpdate()
inst->update(&renderer, &parentState, 0, 0, 0, true, 1);
QCOMPARE(result, nullState);
- QmlProfilerModelManager manager(nullptr);
- DummyModel model(&manager);
+ QmlProfilerModelManager manager;
+ Timeline::TimelineModelAggregator aggregator;
+ DummyModel model(&manager, &aggregator);
renderer.setModel(&model);
result = inst->update(&renderer, &parentState, 0, 0, 0, true, 1);
QCOMPARE(result, nullState);