forked from qt-creator/qt-creator
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 <christian.stenger@qt.io>
This commit is contained in:
@@ -203,7 +203,7 @@ ClangTidyClazyTool::ClangTidyClazyTool()
|
||||
m_diagnosticFilterModel = new DiagnosticFilterModel(this);
|
||||
m_diagnosticFilterModel->setSourceModel(m_diagnosticModel);
|
||||
|
||||
m_diagnosticView = new DiagnosticView;
|
||||
m_diagnosticView = std::make_unique<DiagnosticView>();
|
||||
initDiagnosticView();
|
||||
m_diagnosticView->setModel(m_diagnosticFilterModel);
|
||||
m_diagnosticView->setObjectName(QLatin1String("ClangTidyClazyIssuesView"));
|
||||
@@ -226,7 +226,7 @@ ClangTidyClazyTool::ClangTidyClazyTool()
|
||||
action->setDisabled(true);
|
||||
action->setIcon(Utils::Icons::PREV_TOOLBAR.icon());
|
||||
action->setToolTip(tr("Go to previous diagnostic."));
|
||||
connect(action, &QAction::triggered, m_diagnosticView, &DetailedErrorView::goBack);
|
||||
connect(action, &QAction::triggered, m_diagnosticView.get(), &DetailedErrorView::goBack);
|
||||
m_goBack = action;
|
||||
|
||||
// Go to next diagnostic
|
||||
@@ -234,7 +234,7 @@ ClangTidyClazyTool::ClangTidyClazyTool()
|
||||
action->setDisabled(true);
|
||||
action->setIcon(Utils::Icons::NEXT_TOOLBAR.icon());
|
||||
action->setToolTip(tr("Go to next diagnostic."));
|
||||
connect(action, &QAction::triggered, m_diagnosticView, &DetailedErrorView::goNext);
|
||||
connect(action, &QAction::triggered, m_diagnosticView.get(), &DetailedErrorView::goNext);
|
||||
m_goNext = action;
|
||||
|
||||
// Filter line edit
|
||||
@@ -254,7 +254,7 @@ ClangTidyClazyTool::ClangTidyClazyTool()
|
||||
&ClangToolsDiagnosticModel::fixItsToApplyCountChanged,
|
||||
[this](int c) {
|
||||
m_applyFixitsButton->setEnabled(c);
|
||||
static_cast<DiagnosticView *>(m_diagnosticView)->setSelectedFixItsCount(c);
|
||||
static_cast<DiagnosticView *>(m_diagnosticView.get())->setSelectedFixItsCount(c);
|
||||
});
|
||||
connect(m_applyFixitsButton, &QToolButton::clicked, [this]() {
|
||||
QVector<DiagnosticItem *> diagnosticItems;
|
||||
@@ -269,10 +269,9 @@ ClangTidyClazyTool::ClangTidyClazyTool()
|
||||
const QString toolTip = tr("Clang-Tidy and Clazy use a customized Clang executable from the "
|
||||
"Clang project to search for errors and warnings.");
|
||||
|
||||
Debugger::registerPerspective(ClangTidyClazyPerspectiveId, new Perspective(
|
||||
tr("Clang-Tidy and Clazy"),
|
||||
{{ClangTidyClazyDockId, m_diagnosticView, {}, Perspective::SplitVertical}}
|
||||
));
|
||||
auto perspective = new Perspective(tr("Clang-Tidy and Clazy"));
|
||||
perspective->addWindow(m_diagnosticView.get(), Perspective::SplitVertical, nullptr);
|
||||
Debugger::registerPerspective(ClangTidyClazyPerspectiveId, perspective);
|
||||
|
||||
action = new QAction(tr("Clang-Tidy and Clazy..."), this);
|
||||
action->setToolTip(toolTip);
|
||||
|
||||
Reference in New Issue
Block a user