forked from qt-creator/qt-creator
		
	QmlProfiler: connect category labels to specific models
By listening only to the relevant expandedChanged and rowHeightChanged signals we avoid accessing invalid data on clearing. When clearing the models each one is collapsed. The collapsing in turn triggers rebuilding of the labels. Unrelated labels could access already cleared data like this. Change-Id: I3fad45f5c6279019fbc27ec54e758f498a9d55f2 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
		@@ -92,6 +92,15 @@ void TimelineModelAggregator::addModel(AbstractTimelineModel *m)
 | 
			
		||||
    d->modelList << m;
 | 
			
		||||
    connect(m,SIGNAL(expandedChanged()),this,SIGNAL(expandedChanged()));
 | 
			
		||||
    connect(m,SIGNAL(rowHeightChanged()),this,SIGNAL(rowHeightChanged()));
 | 
			
		||||
    emit modelsChanged();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
QVariantList TimelineModelAggregator::models() const
 | 
			
		||||
{
 | 
			
		||||
    QVariantList ret;
 | 
			
		||||
    foreach (AbstractTimelineModel *model, d->modelList)
 | 
			
		||||
        ret << QVariant::fromValue(model);
 | 
			
		||||
    return ret;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int TimelineModelAggregator::count(int modelIndex) const
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user