aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmlprofiler/qmlprofilertraceview.cpp
diff options
context:
space:
mode:
authorUlf Hermann <[email protected]>2017-08-07 12:05:11 +0200
committerUlf Hermann <[email protected]>2017-08-07 11:50:19 +0000
commit1e781cd396ce78995677a530ca4d788c737dc877 (patch)
tree1db7abd88559b0cba7fafe5c5382110ab50b27b7 /src/plugins/qmlprofiler/qmlprofilertraceview.cpp
parent48d3fd1af578c03657e74ecba09430ac00683b4e (diff)
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 <[email protected]> Reviewed-by: Christian Stenger <[email protected]>
Diffstat (limited to 'src/plugins/qmlprofiler/qmlprofilertraceview.cpp')
-rw-r--r--src/plugins/qmlprofiler/qmlprofilertraceview.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/plugins/qmlprofiler/qmlprofilertraceview.cpp b/src/plugins/qmlprofiler/qmlprofilertraceview.cpp
index 8519d124223..acbff5eb93a 100644
--- a/src/plugins/qmlprofiler/qmlprofilertraceview.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilertraceview.cpp
@@ -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) {