mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-23 23:44:13 +02:00
Keep the terminal number out of the export columns
Manual testing found that the CSV export of the project offered the
terminal number as a column, and failed when it was chosen. The export
takes its columns from the element info keys, but the query behind the
nomenclature has no terminal_number column, so the query breaks.
The widget which offers the columns skips the keys it cannot query
(formula and exclude_from_bom) and skips the terminal number with them,
with a comment saying why.
The key itself stays an element info key: the element editor keeps
offering %{terminal_number} as a text variable, and the label keeps
splitting into label and number the way it was drawn.
This commit is contained in:
@@ -548,6 +548,12 @@ void ElementQueryWidget::setUpItems()
|
||||
{
|
||||
if (key == "formula" || key == "exclude_from_bom")
|
||||
continue;
|
||||
// Terminal number is read-only and not a column of the nomenclature
|
||||
// query, so offering it as an export/query column would break the
|
||||
// export (query fails with "no such column"). It stays available as a
|
||||
// text variable (%{terminal_number}) in the element editor.
|
||||
if (key == QETInformation::ELMT_TERMINAL_NUMBER)
|
||||
continue;
|
||||
|
||||
auto item = new QListWidgetItem(QETInformation::translatedInfoKey(key), ui->m_var_list);
|
||||
item->setData(Qt::UserRole, key);
|
||||
|
||||
Reference in New Issue
Block a user