forked from qt-creator/qt-creator
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: Joerg Bornemann <joerg.bornemann@theqtcompany.com> Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
@@ -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);
|
setVisible(true);
|
||||||
d->text->setText(tr("Loading data"));
|
if (showProgress) {
|
||||||
if (d->isRecording) {
|
if (d->isRecording) {
|
||||||
d->isRecording = false;
|
d->isRecording = false;
|
||||||
d->estimatedProfilingTime = d->profilingTimer.elapsed();
|
d->estimatedProfilingTime = d->profilingTimer.elapsed();
|
||||||
emit newTimeEstimation(d->estimatedProfilingTime);
|
emit newTimeEstimation(d->estimatedProfilingTime);
|
||||||
}
|
}
|
||||||
d->progressBar->setValue(d->m_modelManager->progress() * 1000);
|
d->progressBar->setValue(d->m_modelManager->progress() * 1000);
|
||||||
d->progressBar->setVisible(true);
|
}
|
||||||
resize(300,70);
|
d->progressBar->setVisible(showProgress);
|
||||||
|
d->text->setText(text);
|
||||||
|
resize(showProgress ? 300 : 200, 70);
|
||||||
reposition();
|
reposition();
|
||||||
|
}
|
||||||
|
|
||||||
|
void QmlProfilerStateWidget::updateDisplay()
|
||||||
|
{
|
||||||
|
// When datamodel is acquiring data
|
||||||
|
if (!d->loadingDone && !d->emptyList && !d->appKilled) {
|
||||||
|
showText(tr("Loading data"), true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// When application is being profiled
|
// When application is being profiled
|
||||||
if (d->isRecording) {
|
if (d->isRecording) {
|
||||||
setVisible(true);
|
showText(tr("Profiling application"));
|
||||||
d->progressBar->setVisible(false);
|
|
||||||
d->text->setText(tr("Profiling application"));
|
|
||||||
resize(200,70);
|
|
||||||
reposition();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// After profiling, there is an empty trace
|
// After profiling, there is an empty trace
|
||||||
if (d->traceAvailable && d->loadingDone && d->emptyList) {
|
if (d->traceAvailable && d->loadingDone && d->emptyList) {
|
||||||
setVisible(true);
|
showText(tr("No QML events recorded"));
|
||||||
d->progressBar->setVisible(false);
|
return;
|
||||||
d->text->setText(tr("No QML events recorded"));
|
}
|
||||||
resize(200,70);
|
|
||||||
reposition();
|
// View is not supported for this kind of application
|
||||||
|
if (d->traceAvailable && d->loadingDone && !parentWidget()->isEnabled()) {
|
||||||
|
showText(tr("Not supported for this application"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Application died before all data could be read
|
// Application died before all data could be read
|
||||||
if (!d->loadingDone && !d->emptyList && d->appKilled) {
|
if (!d->loadingDone && !d->emptyList && d->appKilled) {
|
||||||
setVisible(true);
|
showText(tr("Application stopped before loading all data"), 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();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user