QmlProfiler: Disable timeline if it's unusable

Task-number: QTCREATORBUG-16503
Change-Id: I67fe5263ebca865e5ee08571754c1bf763a305d9
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Ulf Hermann
2016-12-14 13:54:25 +01:00
parent bba1304817
commit cd4e104a8b

View File

@@ -111,10 +111,17 @@ void QmlProfilerViewManager::createViews()
d->flameGraphView = new FlameGraphView(d->profilerModelManager); d->flameGraphView = new FlameGraphView(d->profilerModelManager);
prepareEventsView(d->flameGraphView); prepareEventsView(d->flameGraphView);
const QByteArray anchorDockId = d->traceView->objectName().toLatin1(); QByteArray anchorDockId;
if (d->traceView->isUsable()) {
anchorDockId = d->traceView->objectName().toLatin1();
perspective->addOperation({anchorDockId, d->traceView, {}, Perspective::SplitVertical}); perspective->addOperation({anchorDockId, d->traceView, {}, Perspective::SplitVertical});
perspective->addOperation({d->flameGraphView->objectName().toLatin1(), d->flameGraphView, perspective->addOperation({d->flameGraphView->objectName().toLatin1(), d->flameGraphView,
anchorDockId, Perspective::AddToTab}); anchorDockId, Perspective::AddToTab});
} else {
anchorDockId = d->flameGraphView->objectName().toLatin1();
perspective->addOperation({anchorDockId, d->flameGraphView, {},
Perspective::SplitVertical});
}
perspective->addOperation({d->statisticsView->objectName().toLatin1(), d->statisticsView, perspective->addOperation({d->statisticsView->objectName().toLatin1(), d->statisticsView,
anchorDockId, Perspective::AddToTab}); anchorDockId, Perspective::AddToTab});
perspective->addOperation({anchorDockId, 0, {}, Perspective::Raise}); perspective->addOperation({anchorDockId, 0, {}, Perspective::Raise});