mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-08-14 18:44:13 +02:00
Fix nameless "false" row in the element Informations panel
"exclude_from_bom" is listed in QETInformation::elementInfoKeys() so the project database can build the element_info table column for it, but it is not a free-text property: ElementInfoWidget already gives it its own "Exclure de la nomenclature" check box. Because buildInterface() creates one ElementInfoPartWidget per key in that list, the key also got a second, generic edit row. And since translatedInfoKey() has no case for it and falls through to "return QString()", that row carries no label at all - an anonymous edit line at the bottom of the panel. currentInfo() then writes exclude_from_bom unconditionally, so as soon as the user edits anything the nameless row fills with "true"/"false". Drop the key from the list buildInterface() iterates. The check box remains the only way to set it, currentInfo() still writes it exactly as before, elementInfoKeys() is untouched so the database schema and elementquerywidget are unaffected, and predefinedKeys() already excluded it from the custom-property rows. Reported by plc-user on #642.
This commit is contained in:
@@ -204,6 +204,14 @@ void ElementInfoWidget::buildInterface()
|
||||
keys = QETInformation::elementInfoKeys();
|
||||
}
|
||||
|
||||
//"exclude_from_bom" is part of elementInfoKeys() because the project
|
||||
//database builds the element_info table from that list, but it is not
|
||||
//a free-text property: it already has its own check box below. Without
|
||||
//this it also gets a generic edit row, and since translatedInfoKey()
|
||||
//has no entry for it that row carries no label at all - an anonymous
|
||||
//line that currentInfo() then fills with "true"/"false".
|
||||
keys.removeAll(QStringLiteral("exclude_from_bom"));
|
||||
|
||||
for (auto str : keys)
|
||||
{
|
||||
ElementInfoPartWidget *eipw = new ElementInfoPartWidget(str, QETInformation::translatedInfoKey(str), this);
|
||||
|
||||
Reference in New Issue
Block a user