diff options
author | hjk <[email protected]> | 2018-07-31 16:13:11 +0200 |
---|---|---|
committer | hjk <[email protected]> | 2018-08-01 11:27:21 +0000 |
commit | 01f2b982a2f31cbf6cae4fce9ec72b35b47ad35b (patch) | |
tree | 807a9ba4377172b2df3be7a7747a1618775dfad6 /src/plugins/qmlprofiler | |
parent | 01e16537344c301a71670eac810067cc0efce57b (diff) |
Debugger: Move ownership of perspective dock widgets to plugins
Similar to the previous patch, but affecting more plugins: with dynamic
perspectives lifetime is better managed close to the code that knows how
to (re-)construct the items.
Change-Id: I0e7bfcf769d198ec2afa88b972be900baa1b6a46
Reviewed-by: Christian Stenger <[email protected]>
Diffstat (limited to 'src/plugins/qmlprofiler')
-rw-r--r-- | src/plugins/qmlprofiler/qmlprofilerviewmanager.cpp | 26 | ||||
-rw-r--r-- | src/plugins/qmlprofiler/qmlprofilerviewmanager.h | 1 |
2 files changed, 16 insertions, 11 deletions
diff --git a/src/plugins/qmlprofiler/qmlprofilerviewmanager.cpp b/src/plugins/qmlprofiler/qmlprofilerviewmanager.cpp index a18ffa8a8ec..69b38790462 100644 --- a/src/plugins/qmlprofiler/qmlprofilerviewmanager.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerviewmanager.cpp @@ -83,24 +83,28 @@ QmlProfilerViewManager::QmlProfilerViewManager(QObject *parent, m_flameGraphView = new FlameGraphView(m_profilerModelManager); prepareEventsView(m_flameGraphView); - QByteArray anchorDockId; + QWidget *anchor = nullptr; if (m_traceView->isUsable()) { - anchorDockId = m_traceView->objectName().toLatin1(); - perspective->addOperation({anchorDockId, m_traceView, {}, Perspective::SplitVertical}); - perspective->addOperation({m_flameGraphView->objectName().toLatin1(), m_flameGraphView, - anchorDockId, Perspective::AddToTab}); + anchor = m_traceView; + perspective->addWindow(m_traceView, Perspective::SplitVertical, nullptr); + perspective->addWindow(m_flameGraphView, Perspective::AddToTab, anchor); } else { - anchorDockId = m_flameGraphView->objectName().toLatin1(); - perspective->addOperation({anchorDockId, m_flameGraphView, {}, - Perspective::SplitVertical}); + anchor = m_flameGraphView; + perspective->addWindow(m_flameGraphView, Perspective::SplitVertical, nullptr); } - perspective->addOperation({m_statisticsView->objectName().toLatin1(), m_statisticsView, - anchorDockId, Perspective::AddToTab}); - perspective->addOperation({anchorDockId, nullptr, {}, Perspective::Raise}); + perspective->addWindow(m_statisticsView, Perspective::AddToTab, anchor); + perspective->addWindow(anchor, Perspective::Raise, nullptr); Debugger::registerPerspective(Constants::QmlProfilerPerspectiveId, perspective); } +QmlProfilerViewManager::~QmlProfilerViewManager() +{ + delete m_traceView; + delete m_flameGraphView; + delete m_statisticsView; +} + void QmlProfilerViewManager::clear() { m_traceView->clear(); diff --git a/src/plugins/qmlprofiler/qmlprofilerviewmanager.h b/src/plugins/qmlprofiler/qmlprofilerviewmanager.h index 655c1933eb2..3fba19d7b1c 100644 --- a/src/plugins/qmlprofiler/qmlprofilerviewmanager.h +++ b/src/plugins/qmlprofiler/qmlprofilerviewmanager.h @@ -44,6 +44,7 @@ public: QmlProfilerViewManager(QObject *parent, QmlProfilerModelManager *modelManager, QmlProfilerStateManager *profilerState); + ~QmlProfilerViewManager(); QmlProfilerTraceView *traceView() const { return m_traceView; } QmlProfilerStatisticsView *statisticsView() const { return m_statisticsView; } |