QmlProfiler: Improve usability

Move the search and filter buttons left of the label, as the label's
length can change.
Don't auto-reshow the filter menus after selecting from them. This is
a very unusual feature and it gets in the way more often than it helps.

Change-Id: I23d0846eb2efaa20d872632175a21680a8216d85
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
This commit is contained in:
Ulf Hermann
2015-06-30 18:05:03 +02:00
parent 38cd7c31f7
commit a4da263a1f

View File

@@ -274,14 +274,6 @@ QWidget *QmlProfilerTool::createWidgets()
layout->addWidget(d->m_clearButton); layout->addWidget(d->m_clearButton);
d->m_timeLabel = new QLabel();
QPalette palette;
palette.setColor(QPalette::WindowText, Qt::white);
d->m_timeLabel->setPalette(palette);
d->m_timeLabel->setIndent(10);
updateTimeDisplay();
layout->addWidget(d->m_timeLabel);
d->m_searchButton = new QToolButton; d->m_searchButton = new QToolButton;
d->m_searchButton->setIcon(QIcon(QStringLiteral(":/timeline/ico_zoom.png"))); d->m_searchButton->setIcon(QIcon(QStringLiteral(":/timeline/ico_zoom.png")));
d->m_searchButton->setToolTip(tr("Search timeline event notes.")); d->m_searchButton->setToolTip(tr("Search timeline event notes."));
@@ -299,6 +291,14 @@ QWidget *QmlProfilerTool::createWidgets()
this, &QmlProfilerTool::toggleVisibleFeature); this, &QmlProfilerTool::toggleVisibleFeature);
layout->addWidget(d->m_displayFeaturesButton); layout->addWidget(d->m_displayFeaturesButton);
d->m_timeLabel = new QLabel();
QPalette palette;
palette.setColor(QPalette::WindowText, Qt::white);
d->m_timeLabel->setPalette(palette);
d->m_timeLabel->setIndent(10);
updateTimeDisplay();
layout->addWidget(d->m_timeLabel);
layout->addStretch(); layout->addStretch();
toolbarWidget->setLayout(layout); toolbarWidget->setLayout(layout);
@@ -777,9 +777,6 @@ void QmlProfilerTool::toggleRequestedFeature(QAction *action)
else else
d->m_profilerState->setRequestedFeatures( d->m_profilerState->setRequestedFeatures(
d->m_profilerState->requestedFeatures() & (~(1ULL << feature))); d->m_profilerState->requestedFeatures() & (~(1ULL << feature)));
// Keep the menu open to allow for more features to be toggled
d->m_recordButton->showMenu();
} }
void QmlProfilerTool::toggleVisibleFeature(QAction *action) void QmlProfilerTool::toggleVisibleFeature(QAction *action)
@@ -791,9 +788,6 @@ void QmlProfilerTool::toggleVisibleFeature(QAction *action)
else else
d->m_profilerModelManager->setVisibleFeatures( d->m_profilerModelManager->setVisibleFeatures(
d->m_profilerModelManager->visibleFeatures() & (~(1ULL << feature))); d->m_profilerModelManager->visibleFeatures() & (~(1ULL << feature)));
// Keep the menu open to allow for more features to be toggled
d->m_displayFeaturesButton->showMenu();
} }
} }