diff --git a/src/plugins/qmlprofiler/qmlprofilereventview.cpp b/src/plugins/qmlprofiler/qmlprofilereventview.cpp index 5f9c5db06d5..5570e5d153f 100644 --- a/src/plugins/qmlprofiler/qmlprofilereventview.cpp +++ b/src/plugins/qmlprofiler/qmlprofilereventview.cpp @@ -216,8 +216,6 @@ void QmlProfilerEventsWidget::contextMenuEvent(QContextMenuEvent *ev) QAction *copyRowAction = 0; QAction *copyTableAction = 0; QAction *showExtendedStatsAction = 0; - QAction *showJavaScriptAction = 0; - QAction *showQmlAction = 0; QAction *getLocalStatsAction = 0; QAction *getGlobalStatsAction = 0; @@ -249,14 +247,6 @@ void QmlProfilerEventsWidget::contextMenuEvent(QContextMenuEvent *ev) if (hasGlobalStats()) getGlobalStatsAction->setEnabled(false); - showJavaScriptAction = menu.addAction(tr("Show JavaScript Events")); - showJavaScriptAction->setCheckable(true); - showJavaScriptAction->setChecked(showJavaScript()); - - showQmlAction = menu.addAction(tr("Show QML Events")); - showQmlAction->setCheckable(true); - showQmlAction->setChecked(showQml()); - QAction *selectedAction = menu.exec(position); if (selectedAction) { @@ -272,10 +262,6 @@ void QmlProfilerEventsWidget::contextMenuEvent(QContextMenuEvent *ev) getStatisticsInRange(-1, -1); if (selectedAction == showExtendedStatsAction) setShowExtendedStatistics(!showExtendedStatistics()); - if (selectedAction == showJavaScriptAction) - setShowJavaScript(showJavaScriptAction->isChecked()); - if (selectedAction == showQmlAction) - setShowQml(showQmlAction->isChecked()); } } @@ -313,6 +299,17 @@ void QmlProfilerEventsWidget::selectBySourceLocation(const QString &filename, in d->m_eventTree->selectByLocation(filename, line, column); } +void QmlProfilerEventsWidget::onVisibleFeaturesChanged(quint64 features) +{ + for (int i = 0; i < MaximumRangeType; ++i) { + RangeType range = static_cast(i); + quint64 featureFlag = 1ULL << featureFromRangeType(range); + if (QmlDebug::Constants::QML_JS_RANGE_FEATURES & featureFlag) + d->modelProxy->setEventTypeAccepted(range, features & featureFlag); + } + d->modelProxy->limitToRange(d->rangeStart, d->rangeEnd); +} + bool QmlProfilerEventsWidget::hasGlobalStats() const { return d->rangeStart == -1 && d->rangeEnd == -1; @@ -328,34 +325,6 @@ bool QmlProfilerEventsWidget::showExtendedStatistics() const return d->m_eventTree->showExtendedStatistics(); } -void QmlProfilerEventsWidget::setShowJavaScript(bool show) -{ - d->modelProxy->setEventTypeAccepted(Javascript, show); - d->modelProxy->limitToRange(d->rangeStart, d->rangeEnd); -} - -void QmlProfilerEventsWidget::setShowQml(bool show) -{ - d->modelProxy->setEventTypeAccepted(Binding, show); - d->modelProxy->setEventTypeAccepted(HandlingSignal, show); - d->modelProxy->setEventTypeAccepted(Compiling, show); - d->modelProxy->setEventTypeAccepted(Creating, show); - d->modelProxy->limitToRange(d->rangeStart, d->rangeEnd); -} - -bool QmlProfilerEventsWidget::showJavaScript() const -{ - return d->modelProxy->eventTypeAccepted(Javascript); -} - -bool QmlProfilerEventsWidget::showQml() const -{ - return d->modelProxy->eventTypeAccepted(Binding) && - d->modelProxy->eventTypeAccepted(HandlingSignal) && - d->modelProxy->eventTypeAccepted(Compiling) && - d->modelProxy->eventTypeAccepted(Creating); -} - class QmlProfilerEventsMainView::QmlProfilerEventsMainViewPrivate { public: diff --git a/src/plugins/qmlprofiler/qmlprofilereventview.h b/src/plugins/qmlprofiler/qmlprofilereventview.h index 41f61830b0c..8dfeefab5da 100644 --- a/src/plugins/qmlprofiler/qmlprofilereventview.h +++ b/src/plugins/qmlprofiler/qmlprofilereventview.h @@ -78,12 +78,6 @@ public: void setShowExtendedStatistics(bool show); bool showExtendedStatistics() const; - void setShowJavaScript(bool show); - bool showJavaScript() const; - - void setShowQml(bool show); - bool showQml() const; - signals: void gotoSourceLocation(const QString &fileName, int lineNumber, int columnNumber); void typeSelected(int typeIndex); @@ -92,6 +86,7 @@ signals: public slots: void selectByTypeId(int typeIndex) const; void selectBySourceLocation(const QString &filename, int line, int column); + void onVisibleFeaturesChanged(quint64 features); private slots: void profilerDataModelStateChanged(); diff --git a/src/plugins/qmlprofiler/qmlprofilerviewmanager.cpp b/src/plugins/qmlprofiler/qmlprofilerviewmanager.cpp index bbba9394bf6..2730d494fdf 100644 --- a/src/plugins/qmlprofiler/qmlprofilerviewmanager.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerviewmanager.cpp @@ -103,6 +103,8 @@ void QmlProfilerViewManager::createViews() SIGNAL(gotoSourceLocation(QString,int,int))); connect(d->eventsView, SIGNAL(typeSelected(int)), d->traceView, SLOT(selectByTypeId(int))); connect(d->traceView, SIGNAL(typeSelected(int)), d->eventsView, SLOT(selectByTypeId(int))); + connect(d->profilerModelManager, &QmlProfilerModelManager::visibleFeaturesChanged, + d->eventsView, &QmlProfilerEventsWidget::onVisibleFeaturesChanged); QDockWidget *eventsDock = AnalyzerManager::createDockWidget (QmlProfilerToolId, d->eventsView);