forked from qt-creator/qt-creator
ClangTools: Add expand/collapse button
Change-Id: I0981aeb4dad001eb561a4e83201ab21f3510b3e5 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
@@ -260,6 +260,23 @@ ClangTidyClazyTool::ClangTidyClazyTool()
|
|||||||
});
|
});
|
||||||
m_clear = action;
|
m_clear = action;
|
||||||
|
|
||||||
|
// Expand/Collapse
|
||||||
|
action = new QAction(this);
|
||||||
|
action->setDisabled(true);
|
||||||
|
action->setCheckable(true);
|
||||||
|
action->setIcon(Utils::Icons::EXPAND_ALL_TOOLBAR.icon());
|
||||||
|
action->setToolTip(tr("Expand All"));
|
||||||
|
connect(action, &QAction::toggled, [this](bool checked){
|
||||||
|
if (checked) {
|
||||||
|
m_expandCollapse->setToolTip(tr("Collapse All"));
|
||||||
|
m_diagnosticView->expandAll();
|
||||||
|
} else {
|
||||||
|
m_expandCollapse->setToolTip(tr("Expand All"));
|
||||||
|
m_diagnosticView->collapseAll();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
m_expandCollapse = action;
|
||||||
|
|
||||||
// Filter line edit
|
// Filter line edit
|
||||||
m_filterLineEdit = new Utils::FancyLineEdit();
|
m_filterLineEdit = new Utils::FancyLineEdit();
|
||||||
m_filterLineEdit->setFiltering(true);
|
m_filterLineEdit->setFiltering(true);
|
||||||
@@ -310,6 +327,7 @@ ClangTidyClazyTool::ClangTidyClazyTool()
|
|||||||
m_perspective.addToolBarAction(m_clear);
|
m_perspective.addToolBarAction(m_clear);
|
||||||
m_perspective.addToolBarAction(m_goBack);
|
m_perspective.addToolBarAction(m_goBack);
|
||||||
m_perspective.addToolBarAction(m_goNext);
|
m_perspective.addToolBarAction(m_goNext);
|
||||||
|
m_perspective.addToolBarAction(m_expandCollapse);
|
||||||
m_perspective.addToolBarWidget(m_filterLineEdit);
|
m_perspective.addToolBarWidget(m_filterLineEdit);
|
||||||
m_perspective.addToolBarWidget(m_applyFixitsButton);
|
m_perspective.addToolBarWidget(m_applyFixitsButton);
|
||||||
|
|
||||||
@@ -426,6 +444,7 @@ void ClangTidyClazyTool::handleStateUpdate()
|
|||||||
const int issuesVisible = m_diagnosticFilterModel->rowCount();
|
const int issuesVisible = m_diagnosticFilterModel->rowCount();
|
||||||
m_goBack->setEnabled(issuesVisible > 1);
|
m_goBack->setEnabled(issuesVisible > 1);
|
||||||
m_goNext->setEnabled(issuesVisible > 1);
|
m_goNext->setEnabled(issuesVisible > 1);
|
||||||
|
m_expandCollapse->setEnabled(issuesVisible);
|
||||||
|
|
||||||
QString message;
|
QString message;
|
||||||
if (m_running) {
|
if (m_running) {
|
||||||
|
@@ -71,6 +71,7 @@ private:
|
|||||||
QAction *m_goBack = nullptr;
|
QAction *m_goBack = nullptr;
|
||||||
QAction *m_goNext = nullptr;
|
QAction *m_goNext = nullptr;
|
||||||
QAction *m_clear = nullptr;
|
QAction *m_clear = nullptr;
|
||||||
|
QAction *m_expandCollapse = nullptr;
|
||||||
|
|
||||||
Utils::Perspective m_perspective{ClangTidyClazyPerspectiveId, tr("Clang-Tidy and Clazy")};
|
Utils::Perspective m_perspective{ClangTidyClazyPerspectiveId, tr("Clang-Tidy and Clazy")};
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user