Commit 71e8c3ff authored by Ulf Hermann's avatar Ulf Hermann

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: default avatarChristian Kandeler <christian.kandeler@theqtcompany.com>
parent 21caa592
......@@ -93,7 +93,6 @@ void QmlProfilerTraceTime::setTime(qint64 startTime, qint64 endTime)
if (startTime != m_startTime || endTime != m_endTime) {
m_startTime = startTime;
m_endTime = endTime;
emit timeChanged(startTime, endTime);
}
}
......@@ -105,7 +104,6 @@ void QmlProfilerTraceTime::decreaseStartTime(qint64 time)
m_endTime = m_startTime;
else
QTC_ASSERT(m_endTime >= m_startTime, m_endTime = m_startTime);
emit timeChanged(time, m_endTime);
}
}
......@@ -117,7 +115,6 @@ void QmlProfilerTraceTime::increaseEndTime(qint64 time)
m_startTime = m_endTime;
else
QTC_ASSERT(m_endTime >= m_startTime, m_startTime = m_endTime);
emit timeChanged(m_startTime, time);
}
}
......
......@@ -51,9 +51,6 @@ public:
qint64 endTime() const;
qint64 duration() const;
signals:
void timeChanged(qint64,qint64);
public slots:
void clear();
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment