aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/cpptools/cppfindreferences.cpp
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2021-02-05 17:22:53 +0100
committerChristian Kandeler <christian.kandeler@qt.io>2021-02-05 16:55:06 +0000
commitaec61266342792563808c4c185f71aa9288ff4ef (patch)
tree8c0cb6fa4661a4bc3ed0a1129c8087116c72946a /src/plugins/cpptools/cppfindreferences.cpp
parentd920c98b11b9ba8042a253aa511380988e0f9aa1 (diff)
CppTools: Add dedicated filter option for declarations
... to the "Find Usages" result widget. Fixes: QTCREATORBUG-25302 Change-Id: If957cbffe55f6f9288ceae9d64847e8a4a367765 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/plugins/cpptools/cppfindreferences.cpp')
-rw-r--r--src/plugins/cpptools/cppfindreferences.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/plugins/cpptools/cppfindreferences.cpp b/src/plugins/cpptools/cppfindreferences.cpp
index 0a1427b588..ad3a3ff8e4 100644
--- a/src/plugins/cpptools/cppfindreferences.cpp
+++ b/src/plugins/cpptools/cppfindreferences.cpp
@@ -181,15 +181,20 @@ class Filter : public Core::SearchResultFilter
readsCheckBox->setChecked(m_showReads);
const auto writesCheckBox = new QCheckBox(tr("Writes"));
writesCheckBox->setChecked(m_showWrites);
+ const auto declsCheckBox = new QCheckBox(tr("Declarations"));
+ declsCheckBox->setChecked(m_showDecls);
const auto otherCheckBox = new QCheckBox(tr("Other"));
otherCheckBox->setChecked(m_showOther);
layout->addWidget(readsCheckBox);
layout->addWidget(writesCheckBox);
+ layout->addWidget(declsCheckBox);
layout->addWidget(otherCheckBox);
connect(readsCheckBox, &QCheckBox::toggled,
this, [this](bool checked) { setValue(m_showReads, checked); });
connect(writesCheckBox, &QCheckBox::toggled,
this, [this](bool checked) { setValue(m_showWrites, checked); });
+ connect(declsCheckBox, &QCheckBox::toggled,
+ this, [this](bool checked) { setValue(m_showDecls, checked); });
connect(otherCheckBox, &QCheckBox::toggled,
this, [this](bool checked) { setValue(m_showOther, checked); });
return widget;
@@ -205,6 +210,7 @@ class Filter : public Core::SearchResultFilter
case CPlusPlus::Usage::Type::Initialization:
return m_showWrites;
case CPlusPlus::Usage::Type::Declaration:
+ return m_showDecls;
case CPlusPlus::Usage::Type::Other:
return m_showOther;
}
@@ -219,6 +225,7 @@ class Filter : public Core::SearchResultFilter
bool m_showReads = true;
bool m_showWrites = true;
+ bool m_showDecls = true;
bool m_showOther = true;
};