forked from qt-creator/qt-creator
QmlProfiler: Make the progress bar somewhat nicer.
Allow adding a weight to certain tasks so that the movement of the bar gets smoother and update the progress from more places. Change-Id: Ifb8331dc77116cc0464b3970cd6344fbbeacec41 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
@@ -69,6 +69,9 @@ QmlProfilerEventsModelProxy::QmlProfilerEventsModelProxy(QmlProfilerModelManager
|
||||
connect(modelManager->simpleModel(), SIGNAL(changed()), this, SLOT(dataChanged()));
|
||||
d->modelId = modelManager->registerModelProxy();
|
||||
|
||||
// We're iterating twice in loadData.
|
||||
modelManager->setProxyCountWeight(d->modelId, 2);
|
||||
|
||||
d->acceptedTypes << QmlDebug::Compiling << QmlDebug::Creating << QmlDebug::Binding << QmlDebug::HandlingSignal << QmlDebug::Javascript;
|
||||
}
|
||||
|
||||
@@ -211,6 +214,8 @@ void QmlProfilerEventsModelProxy::loadData(qint64 rangeStart, qint64 rangeEnd)
|
||||
}
|
||||
|
||||
// post-process: calc mean time, median time, percentoftime
|
||||
int i = d->data.size();
|
||||
int total = i * 2;
|
||||
foreach (const QString &hash, d->data.keys()) {
|
||||
QmlEventStats* stats = &d->data[hash];
|
||||
if (stats->calls > 0)
|
||||
@@ -223,6 +228,7 @@ void QmlProfilerEventsModelProxy::loadData(qint64 rangeStart, qint64 rangeEnd)
|
||||
}
|
||||
|
||||
stats->percentOfTime = stats->duration * 100.0 / qmlTime;
|
||||
d->modelManager->modelProxyCountUpdated(d->modelId, i++, total);
|
||||
}
|
||||
|
||||
// set binding loop flag
|
||||
|
||||
Reference in New Issue
Block a user