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>
This commit is contained in:
Christian Kandeler
2021-02-05 17:22:53 +01:00
parent d920c98b11
commit aec6126634

View File

@@ -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;
};