aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmlprofiler/qmlprofilertraceview.cpp
diff options
context:
space:
mode:
authorUlf Hermann <[email protected]>2016-04-28 15:43:00 +0200
committerUlf Hermann <[email protected]>2016-05-10 12:33:25 +0000
commit71e8c3ffd7658550bb2539bc67d4fd6cf307c4b6 (patch)
tree7359ce1fdf16c0c430eee15e335d9dc41d0713b2 /src/plugins/qmlprofiler/qmlprofilertraceview.cpp
parent21caa592929568f1470aabb03b46ca1a27a0beec (diff)
QmlProfiler: Reset the zoom control only when we're finished loading
Drop the timeChanged signal of QmlProfilerTraceTime, too, as that doesn't serve a purpose anymore. We don't want intermittent changes of the trace time to be reflected in the UI when loading. Change-Id: I85f18b90fc404ec254c68625104d3e3f9077a1d9 Reviewed-by: Christian Kandeler <[email protected]>
Diffstat (limited to 'src/plugins/qmlprofiler/qmlprofilertraceview.cpp')
-rw-r--r--src/plugins/qmlprofiler/qmlprofilertraceview.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/plugins/qmlprofiler/qmlprofilertraceview.cpp b/src/plugins/qmlprofiler/qmlprofilertraceview.cpp
index 7d2b5c3fe9d..02601f0a413 100644
--- a/src/plugins/qmlprofiler/qmlprofilertraceview.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilertraceview.cpp
@@ -90,10 +90,15 @@ QmlProfilerTraceView::QmlProfilerTraceView(QWidget *parent, QmlProfilerViewManag
setObjectName(QLatin1String("QML Profiler"));
d->m_zoomControl = new Timeline::TimelineZoomControl(this);
- connect(modelManager->traceTime(), &QmlProfilerTraceTime::timeChanged,
- this, [this](qint64 start, qint64 end) {
- d->m_zoomControl->setTrace(start, end);
- d->m_zoomControl->setRange(start, start + (end - start) / 10);
+ connect(modelManager, &QmlProfilerModelManager::stateChanged, this, [modelManager, this]() {
+ if (modelManager->state() == QmlProfilerModelManager::Done) {
+ qint64 start = modelManager->traceTime()->startTime();
+ qint64 end = modelManager->traceTime()->endTime();
+ d->m_zoomControl->setTrace(start, end);
+ d->m_zoomControl->setRange(start, start + (end - start) / 10);
+ } else if (modelManager->state() == QmlProfilerModelManager::ClearingData) {
+ d->m_zoomControl->clear();
+ }
});
QVBoxLayout *groupLayout = new QVBoxLayout;