forked from qt-creator/qt-creator
QmlProfiler: nonzero trace starttimes
Change-Id: I734c1af79a4975f5f331f212721331ea877b391a Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
This commit is contained in:
@@ -117,6 +117,7 @@ TraceWindow::TraceWindow(QWidget *parent)
|
||||
m_eventList = new QmlProfilerEventList(this);
|
||||
connect(this,SIGNAL(range(int,qint64,qint64,QStringList,QString,int)), m_eventList, SLOT(addRangedEvent(int,qint64,qint64,QStringList,QString,int)));
|
||||
connect(this, SIGNAL(traceFinished(qint64)), m_eventList, SLOT(setTraceEndTime(qint64)));
|
||||
connect(this, SIGNAL(traceStarted(qint64)), m_eventList, SLOT(setTraceStartTime(qint64)));
|
||||
connect(this,SIGNAL(viewUpdated()), m_eventList, SLOT(complete()));
|
||||
m_mainView->rootContext()->setContextProperty("qmlEventList", m_eventList);
|
||||
m_overview->rootContext()->setContextProperty("qmlEventList", m_eventList);
|
||||
@@ -256,6 +257,7 @@ void TraceWindow::reset(QDeclarativeDebugConnection *conn)
|
||||
connect(m_v8plugin.data(), SIGNAL(complete()), this, SLOT(v8Complete()));
|
||||
connect(m_v8plugin.data(), SIGNAL(v8range(int,QString,QString,int,double,double)), this, SIGNAL(v8range(int,QString,QString,int,double,double)));
|
||||
connect(m_plugin.data(), SIGNAL(traceFinished(qint64)), this, SIGNAL(traceFinished(qint64)));
|
||||
connect(m_plugin.data(), SIGNAL(traceStarted(qint64)), this, SIGNAL(traceStarted(qint64)));
|
||||
|
||||
m_mainView->rootContext()->setContextProperty("connection", m_plugin.data());
|
||||
m_mainView->rootContext()->setContextProperty("zoomControl", m_zoomControl.data());
|
||||
@@ -448,10 +450,9 @@ void TraceWindow::updateRange()
|
||||
qreal duration = m_zoomControl.data()->endTime() - m_zoomControl.data()->startTime();
|
||||
if (duration <= 0)
|
||||
return;
|
||||
qreal totalTime = m_eventList->traceEndTime() - m_eventList->traceStartTime();
|
||||
if (totalTime <= 0)
|
||||
if (m_eventList->traceDuration() <= 0)
|
||||
return;
|
||||
int newLevel = pow(duration / totalTime, 1/sliderExp) * sliderTicks;
|
||||
int newLevel = pow(duration / m_eventList->traceDuration(), 1/sliderExp) * sliderTicks;
|
||||
if (m_currentZoomLevel != newLevel) {
|
||||
m_currentZoomLevel = newLevel;
|
||||
emit zoomLevelChanged(newLevel);
|
||||
|
||||
Reference in New Issue
Block a user