mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-20 08:10:52 +01:00
Element editor : minor fix
In the part list widget, the terminal name is empty if terminal haven't got name. Now "terminal" is always displayed and if the terminal have a name the name is appended to "terminal". Example : if the terminal name is 24 then the the part list widget show "terminal : 24"
This commit is contained in:
@@ -469,6 +469,12 @@ void QETElementEditor::fillPartsList()
|
||||
if (CustomElementPart *cep = dynamic_cast<CustomElementPart *>(qgi))
|
||||
{
|
||||
QString part_desc = cep -> name();
|
||||
if (PartTerminal *terminal = dynamic_cast<PartTerminal *>(qgi)) {
|
||||
const auto t_name { terminal->terminalName() } ;
|
||||
if (!t_name.isEmpty()) {
|
||||
part_desc += QLatin1String(" : ") + t_name;
|
||||
}
|
||||
}
|
||||
QListWidgetItem *qlwi = new QListWidgetItem(part_desc);
|
||||
QVariant v;
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) // ### Qt 6: remove
|
||||
|
||||
Reference in New Issue
Block a user