QmlProfiler: Retrieve common actions from ActionManager

This removes the need to pass the QmlProfilerTool instance to all views.
QmlProfilerTool is exported so that we can access the common actions
from plugins.

Change-Id: Ie7072c23ef35763b729f4b87acce47ecbdb76e43
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
This commit is contained in:
Ulf Hermann
2016-01-04 17:20:13 +01:00
parent c16b843ecc
commit e4efb9bb3b
9 changed files with 32 additions and 38 deletions

View File

@@ -77,7 +77,6 @@ public:
QmlProfilerTraceViewPrivate(QmlProfilerTraceView *qq) : q(qq) {}
QmlProfilerTraceView *q;
QmlProfilerTool *m_profilerTool;
QmlProfilerViewManager *m_viewContainer;
QSize m_sizeHint;
@@ -90,7 +89,8 @@ public:
Timeline::TimelineZoomControl *m_zoomControl;
};
QmlProfilerTraceView::QmlProfilerTraceView(QWidget *parent, QmlProfilerTool *profilerTool, QmlProfilerViewManager *container, QmlProfilerModelManager *modelManager)
QmlProfilerTraceView::QmlProfilerTraceView(QWidget *parent, QmlProfilerViewManager *container,
QmlProfilerModelManager *modelManager)
: QWidget(parent), d(new QmlProfilerTraceViewPrivate(this))
{
setObjectName(QLatin1String("QML Profiler"));
@@ -126,9 +126,7 @@ QmlProfilerTraceView::QmlProfilerTraceView(QWidget *parent, QmlProfilerTool *pro
groupLayout->addWidget(new Core::FindToolBarPlaceHolder(this));
setLayout(groupLayout);
d->m_profilerTool = profilerTool;
d->m_viewContainer = container;
d->m_modelProxy = new Timeline::TimelineModelAggregator(modelManager->notesModel(), this);
d->m_modelManager = modelManager;
@@ -241,11 +239,7 @@ void QmlProfilerTraceView::showContextMenu(QPoint position)
QMenu menu;
QAction *viewAllAction = 0;
QmlProfilerTool *profilerTool = qobject_cast<QmlProfilerTool *>(d->m_profilerTool);
if (profilerTool)
menu.addActions(profilerTool->profilerContextMenuActions());
menu.addActions(QmlProfilerTool::profilerContextMenuActions());
menu.addSeparator();
QAction *getLocalStatsAction = menu.addAction(tr("Limit Statistics Pane to Current Range"));