From 3513f692fdfa885ee5a545eeb9f1022ce5c6125f Mon Sep 17 00:00:00 2001 From: ispyisail Date: Thu, 24 Sep 2026 22:34:42 +1200 Subject: [PATCH] Read the remaining element flags through QET::infoFlagIsTrue() 5b0785fcc routed most reads of auto_num_locked, potential_isolating and exclude_from_bom through QET::infoFlagIsTrue(), which accepts the same spellings as the parts-list query (true/1/yes/on, trimmed, any case). Four checkbox reads still compared against a literal lowercase "true": the "exclude from parts list" box in the folio properties panel, and all three flags in the element editor. A value such as "True" or "1" from a hand-written .elmt/.qet was therefore left out of the parts list, but shown unticked in both panels, and pressing Apply there wrote back "false" and flipped the flag. Revives the unconverted part of PR #785. Co-Authored-By: Claude Opus 5.5 --- sources/editor/ui/elementpropertieseditorwidget.cpp | 7 ++++--- sources/ui/elementinfowidget.cpp | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/sources/editor/ui/elementpropertieseditorwidget.cpp b/sources/editor/ui/elementpropertieseditorwidget.cpp index 6680b9152..7a24f984f 100644 --- a/sources/editor/ui/elementpropertieseditorwidget.cpp +++ b/sources/editor/ui/elementpropertieseditorwidget.cpp @@ -17,6 +17,7 @@ */ #include "elementpropertieseditorwidget.h" +#include "../../qet.h" #include "../../qetapp.h" #include "../../qetinformation.h" #include "ui_elementpropertieseditorwidget.h" @@ -185,13 +186,13 @@ void ElementPropertiesEditorWidget::upDateInterface() const DiagramContext &info = m_data.m_informations; ui->m_auto_num_locked_cb->setChecked( - info.value(QStringLiteral("auto_num_locked")).toString() == QLatin1String("true")); + QET::infoFlagIsTrue(info.value(QStringLiteral("auto_num_locked")).toString())); ui->m_potential_isolating_cb->setChecked( - info.value(QStringLiteral("potential_isolating")).toString() == QLatin1String("true")); + QET::infoFlagIsTrue(info.value(QStringLiteral("potential_isolating")).toString())); } ui->m_exclude_from_bom_cb->setChecked( - m_data.m_informations.value(QStringLiteral("exclude_from_bom")).toString() == QLatin1String("true")); + QET::infoFlagIsTrue(m_data.m_informations.value(QStringLiteral("exclude_from_bom")).toString())); on_m_base_type_cb_currentIndexChanged(ui->m_base_type_cb->currentIndex()); } diff --git a/sources/ui/elementinfowidget.cpp b/sources/ui/elementinfowidget.cpp index f67f2bd85..61bc49651 100644 --- a/sources/ui/elementinfowidget.cpp +++ b/sources/ui/elementinfowidget.cpp @@ -378,7 +378,7 @@ void ElementInfoWidget::updateUi() // English: Load the BOM exclusion status from the element information mapping if (m_exclude_from_bom_cb) { QString exclude_bom_value = element_info.value(QStringLiteral("exclude_from_bom")).toString(); - m_exclude_from_bom_cb->setChecked(exclude_bom_value == QLatin1String("true")); + m_exclude_from_bom_cb->setChecked(QET::infoFlagIsTrue(exclude_bom_value)); } if (m_live_edit) {