From 7afc1eb56bfffe0e4ebbbc40b17d72adecbee3ef Mon Sep 17 00:00:00 2001 From: ispyisail Date: Tue, 11 Aug 2026 18:00:43 +1200 Subject: [PATCH] Enable Information tab in element editor for Slave and Terminal basetypes GitHub issue #663: the "Informations" tab in the element editor's properties dialog was only made visible for Simple and Master basetypes (setTabVisible gate in on_m_base_type_cb_currentIndexChanged), hiding it entirely for Slave and Terminal Block elements. This wasn't a data-model limitation: ElementData::m_informations is read and written identically for every basetype (elementdata.cpp), and updateTree() already special-cased Terminal as enabled and injected PLC-specific info rows for PLC Slave elements - that logic was simply unreachable because the tab itself was hidden for both types. Also flipped updateTree()'s Slave case from setDisabled to setEnabled so the tree is actually editable once visible, matching Terminal's existing behavior. This lets users attach manufacturer/part-number/reference metadata directly to Terminal Block and Slave (e.g. multi-part contactor) elements, as requested in the issue - useful when a Slave's part number differs from its Master's (e.g. a contactor's auxiliary contact block vs. its coil). Not verified: interactive element-editor GUI testing wasn't performed in this sandbox; verified via clean incremental build only. --- sources/editor/ui/elementpropertieseditorwidget.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sources/editor/ui/elementpropertieseditorwidget.cpp b/sources/editor/ui/elementpropertieseditorwidget.cpp index 6a09de091..b2ed5f3b9 100644 --- a/sources/editor/ui/elementpropertieseditorwidget.cpp +++ b/sources/editor/ui/elementpropertieseditorwidget.cpp @@ -292,7 +292,7 @@ void ElementPropertiesEditorWidget::updateTree() ui->m_tree->setEnabled(true); break; case ElementData::Slave: - ui->m_tree->setDisabled(true); + ui->m_tree->setEnabled(true); break; case ElementData::Terminal: ui->m_tree->setEnabled(true); @@ -426,7 +426,9 @@ void ElementPropertiesEditorWidget::on_m_base_type_cb_currentIndexChanged(int in #if QT_VERSION >= QT_VERSION_CHECK(5,15,0) ui->tabWidget->setTabVisible(1, (type_ == ElementData::Simple || - type_ == ElementData::Master)); + type_ == ElementData::Master || + type_ == ElementData::Slave || + type_ == ElementData::Terminal)); #endif updateTree();