forked from qt-creator/qt-creator
QmlProfiler: Avoid empty timeline when restricting to ranges
The timeline models were suspended for editing but never restored. To test the correct behavior a test case for the trace view is added. Change-Id: Ic1803e9d84656eed97795f1f1674e3d56c83f650 Task-number: QTCREATORBUG-18354 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -114,13 +114,16 @@ QmlProfilerTraceView::QmlProfilerTraceView(QWidget *parent, QmlProfilerViewManag
|
||||
break;
|
||||
case QmlProfilerModelManager::ClearingData:
|
||||
d->m_zoomControl->clear();
|
||||
if (!d->m_suspendedModels.isEmpty())
|
||||
break; // Models are suspended already. AcquiringData was aborted.
|
||||
// Fall through
|
||||
case QmlProfilerModelManager::AcquiringData:
|
||||
// Temporarily remove the models, while we're changing them
|
||||
d->m_suspendedModels = d->m_modelProxy->models();
|
||||
d->m_modelProxy->setModels(QVariantList());
|
||||
if (d->m_suspendedModels.isEmpty()) {
|
||||
// Temporarily remove the models, while we're changing them
|
||||
d->m_suspendedModels = d->m_modelProxy->models();
|
||||
d->m_modelProxy->setModels(QVariantList());
|
||||
}
|
||||
// Otherwise models are suspended already. This can happen if either acquiring was
|
||||
// aborted or we're doing a "restrict to range" which consists of a partial clearing and
|
||||
// then re-acquiring of data.
|
||||
break;
|
||||
}
|
||||
});
|
||||
@@ -308,6 +311,11 @@ bool QmlProfilerTraceView::isUsable() const
|
||||
#endif
|
||||
}
|
||||
|
||||
bool QmlProfilerTraceView::isSuspended() const
|
||||
{
|
||||
return !d->m_suspendedModels.isEmpty();
|
||||
}
|
||||
|
||||
void QmlProfilerTraceView::changeEvent(QEvent *e)
|
||||
{
|
||||
if (e->type() == QEvent::EnabledChange) {
|
||||
|
||||
Reference in New Issue
Block a user