Timeline: Centralize the selection in zoom control.

This is where it logically belongs, given that trace, window, and range
are already there. Also, it fixes the types to qint64, making it easier
to reason about type conversions and numerical overflows.

Change-Id: I2f88b2646b9a649d34bdf4fe87c37e7afdeee078
Task-number: QTCREATORBUG-14170
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
This commit is contained in:
Ulf Hermann
2015-03-23 18:50:47 +01:00
parent 5e805bfb7c
commit a4b3c46250
5 changed files with 49 additions and 24 deletions

View File

@@ -171,18 +171,12 @@ bool QmlProfilerTraceView::hasValidSelection() const
qint64 QmlProfilerTraceView::selectionStart() const
{
QQuickItem *rootObject = d->m_mainView->rootObject();
if (rootObject)
return rootObject->property("selectionRangeStart").toLongLong();
return 0;
return d->m_zoomControl->selectionStart();
}
qint64 QmlProfilerTraceView::selectionEnd() const
{
QQuickItem *rootObject = d->m_mainView->rootObject();
if (rootObject)
return rootObject->property("selectionRangeEnd").toLongLong();
return 0;
return d->m_zoomControl->selectionEnd();
}
void QmlProfilerTraceView::clear()