Commit b1ee6ee8 authored by Ulf Hermann's avatar Ulf Hermann

QmlProfiler: Show a message when V8 profiler is not supported

People frequently wonder why the V8 pane is empty and disabled. This
change makes it more explicit.

Change-Id: I381bff072840dde1fdd038b3d00dd3a400261bc9
Reviewed-by: default avatarJoerg Bornemann <joerg.bornemann@theqtcompany.com>
Reviewed-by: default avatarEike Ziller <eike.ziller@theqtcompany.com>
parent ccbe4ee0
......@@ -187,57 +187,52 @@ void QmlProfilerStateWidget::paintEvent(QPaintEvent *event)
}
void QmlProfilerStateWidget::updateDisplay()
void QmlProfilerStateWidget::showText(const QString &text, bool showProgress)
{
// When datamodel is acquiring data
if (!d->loadingDone && !d->emptyList && !d->appKilled) {
setVisible(true);
d->text->setText(tr("Loading data"));
setVisible(true);
if (showProgress) {
if (d->isRecording) {
d->isRecording = false;
d->estimatedProfilingTime = d->profilingTimer.elapsed();
emit newTimeEstimation(d->estimatedProfilingTime);
}
d->progressBar->setValue(d->m_modelManager->progress() * 1000);
d->progressBar->setVisible(true);
resize(300,70);
reposition();
}
d->progressBar->setVisible(showProgress);
d->text->setText(text);
resize(showProgress ? 300 : 200, 70);
reposition();
}
void QmlProfilerStateWidget::updateDisplay()
{
// When datamodel is acquiring data
if (!d->loadingDone && !d->emptyList && !d->appKilled) {
showText(tr("Loading data"), true);
return;
}
// When application is being profiled
if (d->isRecording) {
setVisible(true);
d->progressBar->setVisible(false);
d->text->setText(tr("Profiling application"));
resize(200,70);
reposition();
showText(tr("Profiling application"));
return;
}
// After profiling, there is an empty trace
if (d->traceAvailable && d->loadingDone && d->emptyList) {
setVisible(true);
d->progressBar->setVisible(false);
d->text->setText(tr("No QML events recorded"));
resize(200,70);
reposition();
showText(tr("No QML events recorded"));
return;
}
// View is not supported for this kind of application
if (d->traceAvailable && d->loadingDone && !parentWidget()->isEnabled()) {
showText(tr("Not supported for this application"));
return;
}
// Application died before all data could be read
if (!d->loadingDone && !d->emptyList && d->appKilled) {
setVisible(true);
d->text->setText(tr("Application stopped before loading all data"));
if (d->isRecording) {
d->isRecording = false;
d->estimatedProfilingTime = d->profilingTimer.elapsed();
emit newTimeEstimation(d->estimatedProfilingTime);
}
d->progressBar->setValue(d->m_modelManager->progress() * 1000);
d->progressBar->setVisible(true);
resize(300,70);
reposition();
showText(tr("Application stopped before loading all data"), true);
return;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment