QmlProfiler: Make the views accessible from the view manager

And then, drop some methods we don't need anymore.

Change-Id: I057bdc012072abddca2df83918ee9a0460f78611
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Ulf Hermann
2016-12-20 13:00:18 +01:00
parent beea69e486
commit 2ad8e27d53
5 changed files with 24 additions and 50 deletions

View File

@@ -267,11 +267,11 @@ void QmlProfilerTraceView::showContextMenu(QPoint position)
menu.addSeparator();
QAction *getLocalStatsAction = menu.addAction(tr("Analyze Current Range"));
if (!d->m_viewContainer->hasValidSelection())
if (!hasValidSelection())
getLocalStatsAction->setEnabled(false);
QAction *getGlobalStatsAction = menu.addAction(tr("Analyze Full Range"));
if (!d->m_viewContainer->isEventsRestrictedToRange())
if (!d->m_modelManager->isRestrictedToRange())
getGlobalStatsAction->setEnabled(false);
if (d->m_zoomControl->traceDuration() > 0) {
@@ -287,11 +287,10 @@ void QmlProfilerTraceView::showContextMenu(QPoint position)
d->m_zoomControl->traceEnd());
}
if (selectedAction == getLocalStatsAction) {
d->m_viewContainer->restrictEventsToRange(d->m_viewContainer->selectionStart(),
d->m_viewContainer->selectionEnd());
d->m_modelManager->restrictToRange(selectionStart(), selectionEnd());
}
if (selectedAction == getGlobalStatsAction)
d->m_viewContainer->restrictEventsToRange(-1, -1);
d->m_modelManager->restrictToRange(-1, -1);
}
}