forked from qt-creator/qt-creator
QmlProfiler: Require model manager when constructing timeline models
This relieves us of the headaches created by figuring out what should happen if the model manager is changed later. Extension models can be safely created through a factory. Change-Id: I8cf8fd6d639e4e6c9da66351ea44cfc35fd614a5 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
This commit is contained in:
@@ -80,20 +80,15 @@ void TimelineModelAggregator::setModelManager(QmlProfilerModelManager *modelMana
|
||||
connect(modelManager,SIGNAL(dataAvailable()),this,SIGNAL(dataAvailable()));
|
||||
|
||||
// external models pushed on top
|
||||
foreach (AbstractTimelineModel *timelineModel, QmlProfilerPlugin::instance->getModels()) {
|
||||
timelineModel->setModelManager(modelManager);
|
||||
foreach (AbstractTimelineModel *timelineModel,
|
||||
QmlProfilerPlugin::instance->getModels(modelManager)) {
|
||||
addModel(timelineModel);
|
||||
}
|
||||
|
||||
QmlProfilerAnimationsModel *paintEventsModelProxy = new QmlProfilerAnimationsModel(this);
|
||||
paintEventsModelProxy->setModelManager(modelManager);
|
||||
addModel(paintEventsModelProxy);
|
||||
addModel(new QmlProfilerAnimationsModel(modelManager, this));
|
||||
|
||||
for (int i = 0; i < QmlDebug::MaximumRangeType; ++i) {
|
||||
QmlProfilerRangeModel *rangeModel = new QmlProfilerRangeModel((QmlDebug::RangeType)i, this);
|
||||
rangeModel->setModelManager(modelManager);
|
||||
addModel(rangeModel);
|
||||
}
|
||||
for (int i = 0; i < QmlDebug::MaximumRangeType; ++i)
|
||||
addModel(new QmlProfilerRangeModel(modelManager, (QmlDebug::RangeType)i, this));
|
||||
|
||||
// Connect this last so that it's executed after the models have updated their data.
|
||||
connect(modelManager->qmlModel(),SIGNAL(changed()),this,SIGNAL(stateChanged()));
|
||||
|
||||
Reference in New Issue
Block a user