Feature: Allow excluding specific elements from BOM (Nomenclature)

This commit is contained in:
Kellermorph
2026-05-28 12:23:54 +02:00
parent 19704cf5ca
commit c071e92c58
6 changed files with 122 additions and 99 deletions
+6 -1
View File
@@ -373,6 +373,11 @@ QString ElementQueryWidget::queryStr() const
where.clear();
}
QString exclude_condition = "(exclude_from_bom IS NULL OR exclude_from_bom != '1')";
filter_ += " AND " + exclude_condition;
// -------------------------------------------------------------
if (where.isEmpty() && !filter_.isEmpty()) {
filter_.remove(0, 4); //Remove the first " AND" of filter.
filter_.prepend( " WHERE");
@@ -456,7 +461,7 @@ void ElementQueryWidget::setUpItems()
{
for(QString key : QETInformation::elementInfoKeys())
{
if (key == "formula")
if (key == "formula" || key == "exclude_from_bom")
continue;
auto item = new QListWidgetItem(QETInformation::translatedInfoKey(key), ui->m_var_list);