From 7b50f10749385c11f101c6b604925f94a5d6db2f Mon Sep 17 00:00:00 2001 From: Achim Date: Sun, 8 Dec 2024 19:36:22 +0100 Subject: [PATCH 1/4] ElementEditor elmt_info_cb sorting changed alphabetical sorting in the ComboBox changed according to the order in the elementInfoKeys list --- sources/editor/ui/dynamictextfieldeditor.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/sources/editor/ui/dynamictextfieldeditor.cpp b/sources/editor/ui/dynamictextfieldeditor.cpp index 15c3872e3..72cd666ba 100644 --- a/sources/editor/ui/dynamictextfieldeditor.cpp +++ b/sources/editor/ui/dynamictextfieldeditor.cpp @@ -226,15 +226,9 @@ void DynamicTextFieldEditor::fillInfoComboBox() else { strl = QETInformation::elementInfoKeys(); } - //We use a QMap because the keys of the map are sorted, then no matter the current local, - //the value of the combo box are always alphabetically sorted - QMap info_map; - for(const QString& str : strl) - info_map.insert(QETInformation::translatedInfoKey(str), str); - - - for (const QString& key : info_map.keys()) - ui -> m_elmt_info_cb -> addItem(key, info_map.value(key)); + for (int i=0; i m_elmt_info_cb -> addItem(strl[i], QETInformation::translatedInfoKey(strl[i])); + } } void DynamicTextFieldEditor::on_m_x_sb_editingFinished() From 3b32daf15df8e02360e07d462aa9c196a388f65a Mon Sep 17 00:00:00 2001 From: Achim Date: Mon, 16 Dec 2024 15:55:16 +0100 Subject: [PATCH 2/4] ComboBox change sorting alphabetical sorting in the ComboBox changed according to the order in the elementInfoKeys list --- sources/ui/compositetexteditdialog.cpp | 11 ++--------- sources/ui/dynamicelementtextmodel.cpp | 13 ++++--------- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/sources/ui/compositetexteditdialog.cpp b/sources/ui/compositetexteditdialog.cpp index 045615e3d..4ea643801 100644 --- a/sources/ui/compositetexteditdialog.cpp +++ b/sources/ui/compositetexteditdialog.cpp @@ -68,15 +68,8 @@ void CompositeTextEditDialog::setUpComboBox() qstrl.removeAll("formula"); } - //We use a QMap because the keys of the map are sorted, then no matter the current local, - //the value of the combo box are always alphabetically sorted - QMap info_map; - for(const QString& str : qstrl) { - info_map.insert(QETInformation::translatedInfoKey(str), - is_report ? QETInformation::folioReportInfoToVar(str) : QETInformation::elementInfoToVar(str)); - } - for(const QString& key : info_map.keys()) { - ui->m_info_cb->addItem(key, info_map.value(key)); + for (int i=0; i m_info_cb -> addItem(qstrl[i], QETInformation::translatedInfoKey(qstrl[i])); } } diff --git a/sources/ui/dynamicelementtextmodel.cpp b/sources/ui/dynamicelementtextmodel.cpp index 95b224446..2062f41ab 100644 --- a/sources/ui/dynamicelementtextmodel.cpp +++ b/sources/ui/dynamicelementtextmodel.cpp @@ -1622,18 +1622,13 @@ QWidget *DynamicTextItemDelegate::createEditor( DynamicElementTextItem *deti = detm->textFromIndex(index); if(!deti) break; - - //We use a QMap because the keys of the map are sorted, then no matter the current local, - //the value of the combo box are always alphabetically sorted - QMap info_map; - for(const QString& str : availableInfo(deti)) { - info_map.insert(QETInformation::translatedInfoKey(str), str); - } QComboBox *qcb = new QComboBox(parent); qcb->setObjectName("info_text"); - for (const QString& key : info_map.keys()) { - qcb->addItem(key, info_map.value(key)); + + QStringList strl = availableInfo(deti); + for (int i=0; i addItem(strl[i], QETInformation::translatedInfoKey(strl[i])); } return qcb; } From 15d9708c46e6b7d0ef7343d9055f360191f86b2c Mon Sep 17 00:00:00 2001 From: Achim Date: Mon, 16 Dec 2024 16:00:50 +0100 Subject: [PATCH 3/4] a few small corrections --- .../ui/elementpropertieseditorwidget.cpp | 2 ++ sources/qetinformation.cpp | 3 +- sources/qetinformation.h | 30 +++++++++---------- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/sources/editor/ui/elementpropertieseditorwidget.cpp b/sources/editor/ui/elementpropertieseditorwidget.cpp index 7c590040c..d69fe56a9 100644 --- a/sources/editor/ui/elementpropertieseditorwidget.cpp +++ b/sources/editor/ui/elementpropertieseditorwidget.cpp @@ -205,6 +205,8 @@ void ElementPropertiesEditorWidget::populateTree() QETInformation::translatedInfoKey(key)); qtwi->setData(0, Qt::UserRole, key); qtwi->setText(1, m_data.m_informations.value(key).toString()); + // Adjust column width + ui->m_tree->resizeColumnToContents(0); } } diff --git a/sources/qetinformation.cpp b/sources/qetinformation.cpp index 6ff5fbbb5..361337fbf 100644 --- a/sources/qetinformation.cpp +++ b/sources/qetinformation.cpp @@ -312,6 +312,7 @@ QStringList QETInformation::elementEditorElementInfoKeys() { QStringList list = { ELMT_LABEL, ELMT_PLANT, + ELMT_LOCATION, ELMT_COMMENT, ELMT_FUNCTION, ELMT_DESCRIPTION, @@ -322,8 +323,6 @@ QStringList QETInformation::elementEditorElementInfoKeys() ELMT_SUPPLIER, ELMT_QUANTITY, ELMT_UNITY, - ELMT_LOCATION, - ELMT_PLANT, ELMT_AUX1, ELMT_DESCRIPTION_AUX1, ELMT_DESIGNATION_AUX1, diff --git a/sources/qetinformation.h b/sources/qetinformation.h index 34946d639..c4c48e9f0 100644 --- a/sources/qetinformation.h +++ b/sources/qetinformation.h @@ -49,39 +49,39 @@ namespace QETInformation static QString ELMT_LOCATION = "location"; static QString ELMT_AUX1 = "auxiliary1"; static QString ELMT_DESCRIPTION_AUX1 = "description_auxiliary1"; - static QString ELMT_DESIGNATION_AUX1 = "designation_auxiliary1 "; + static QString ELMT_DESIGNATION_AUX1 = "designation_auxiliary1"; static QString ELMT_MANUFACTURER_AUX1 = "manufacturer_auxiliary1"; static QString ELMT_MANUFACTURER_REF_AUX1 = "manufacturer_reference_auxiliary1"; - static QString ELMT_MACHINE_MANUFACTURER_REF_AUX1 = "machine_manufacturer_reference_auxiliary1 "; - static QString ELMT_SUPPLIER_AUX1 = "supplier_auxiliary1 "; - static QString ELMT_QUANTITY_AUX1 = "quantity_auxiliary1 "; + static QString ELMT_MACHINE_MANUFACTURER_REF_AUX1 = "machine_manufacturer_reference_auxiliary1"; + static QString ELMT_SUPPLIER_AUX1 = "supplier_auxiliary1"; + static QString ELMT_QUANTITY_AUX1 = "quantity_auxiliary1"; static QString ELMT_UNITY_AUX1 = "unity_auxiliary1"; static QString ELMT_AUX2 = "auxiliary2"; static QString ELMT_DESCRIPTION_AUX2 = "description_auxiliary2"; - static QString ELMT_DESIGNATION_AUX2 = "designation_auxiliary2 "; + static QString ELMT_DESIGNATION_AUX2 = "designation_auxiliary2"; static QString ELMT_MANUFACTURER_AUX2 = "manufacturer_auxiliary2"; static QString ELMT_MANUFACTURER_REF_AUX2 = "manufacturer_reference_auxiliary2"; static QString ELMT_MACHINE_MANUFACTURER_REF_AUX2 = "machine_manufacturer_reference_auxiliary2"; - static QString ELMT_SUPPLIER_AUX2 = "supplier_auxiliary2 "; - static QString ELMT_QUANTITY_AUX2 = "quantity_auxiliary2 "; + static QString ELMT_SUPPLIER_AUX2 = "supplier_auxiliary2"; + static QString ELMT_QUANTITY_AUX2 = "quantity_auxiliary2"; static QString ELMT_UNITY_AUX2 = "unity_auxiliary2"; static QString ELMT_AUX3 = "auxiliary3"; static QString ELMT_DESCRIPTION_AUX3 = "description_auxiliary3"; - static QString ELMT_DESIGNATION_AUX3 = "designation_auxiliary3 "; + static QString ELMT_DESIGNATION_AUX3 = "designation_auxiliary3"; static QString ELMT_MANUFACTURER_AUX3 = "manufacturer_auxiliary3"; static QString ELMT_MANUFACTURER_REF_AUX3 = "manufacturer_reference_auxiliary3"; - static QString ELMT_MACHINE_MANUFACTURER_REF_AUX3 = "machine_manufacturer_reference_auxiliary3 "; - static QString ELMT_SUPPLIER_AUX3 = "supplier_auxiliary3 "; - static QString ELMT_QUANTITY_AUX3 = "quantity_auxiliary3 "; + static QString ELMT_MACHINE_MANUFACTURER_REF_AUX3 = "machine_manufacturer_reference_auxiliary3"; + static QString ELMT_SUPPLIER_AUX3 = "supplier_auxiliary3"; + static QString ELMT_QUANTITY_AUX3 = "quantity_auxiliary3"; static QString ELMT_UNITY_AUX3 = "unity_auxiliary3"; static QString ELMT_AUX4 = "auxiliary4"; static QString ELMT_DESCRIPTION_AUX4 = "description_auxiliary4"; - static QString ELMT_DESIGNATION_AUX4 = "designation_auxiliary4 "; + static QString ELMT_DESIGNATION_AUX4 = "designation_auxiliary4"; static QString ELMT_MANUFACTURER_AUX4 = "manufacturer_auxiliary4"; static QString ELMT_MANUFACTURER_REF_AUX4 = "manufacturer_reference_auxiliary4"; - static QString ELMT_MACHINE_MANUFACTURER_REF_AUX4 = "machine_manufacturer_reference_auxiliary4 "; - static QString ELMT_SUPPLIER_AUX4 = "supplier_auxiliary4 "; - static QString ELMT_QUANTITY_AUX4 = "quantity_auxiliary4 "; + static QString ELMT_MACHINE_MANUFACTURER_REF_AUX4 = "machine_manufacturer_reference_auxiliary4"; + static QString ELMT_SUPPLIER_AUX4 = "supplier_auxiliary4"; + static QString ELMT_QUANTITY_AUX4 = "quantity_auxiliary4"; static QString ELMT_UNITY_AUX4 = "unity_auxiliary4"; From c7481011e820d4c4a59a703f8f1b19a6fe334bfe Mon Sep 17 00:00:00 2001 From: Achim Date: Mon, 16 Dec 2024 16:01:37 +0100 Subject: [PATCH 4/4] german language file adapted --- lang/qet_de.ts | 72 +++++++++++++++++++++++++------------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/lang/qet_de.ts b/lang/qet_de.ts index c06457355..d26bb3126 100644 --- a/lang/qet_de.ts +++ b/lang/qet_de.ts @@ -9056,182 +9056,182 @@ Möchten Sie sie ersetzen? Bloc auxiliaire 1 - Zusatzinfo 1 + Zusatzinfo Zusatzartikel 1 Description textuelle auxiliaire 1 - + Artikelbeschreibung Zusatzartikel 1 Numéro d'article auxiliaire 1 - + Artikelnummer Zusatzartikel 1 Fabricant auxiliaire 1 - + Hersteller Zusatzartikel 1 Numéro de commande auxiliaire 1 - + Bestellnummer Zusatzartikel 1 Numéro interne auxiliaire 1 - + Interne Nummer Zusatzartikel 1 Fournisseur auxiliaire 1 - + Lieferant Zusatzartikel 1 Quantité auxiliaire 1 - + Menge Zusatzartikel 1 Unité auxiliaire 1 - + Einheit Zusatzartikel 1 Bloc auxiliaire 2 - Zusatzinfo 2 + Zusatzinfo Zusatzartikel 2 Description textuelle auxiliaire 2 - + Artikelbeschreibung Zusatzartikel 2 Numéro d'article auxiliaire 2 - + Artikelnummer Zusatzartikel 2 Fabricant auxiliaire 2 - + Hersteller Zusatzartikel 2 Numéro de commande auxiliaire 2 - + Bestellnummer Zusatzartikel 2 Numéro interne auxiliaire 2 - + Interne Nummer Zusatzartikel 2 Fournisseur auxiliaire 2 - + Lieferant Zusatzartikel 2 Quantité auxiliaire 2 - + Menge Zusatzartikel 2 Unité auxiliaire 2 - + Einheit Zusatzartikel 2 Bloc auxiliaire 3 - Zusatzinfo 3 + Zusatzinfo Zusatzartikel 3 Description textuelle auxiliaire 3 - + Artikelbeschreibung Zusatzartikel 3 Numéro d'article auxiliaire 3 - + Artikelnummer Zusatzartikel 3 Fabricant auxiliaire 3 - + Hersteller Zusatzartikel 3 Numéro de commande auxiliaire 3 - + Bestellnummer Zusatzartikel 3 Numéro interne auxiliaire 3 - + Interne Nummer Zusatzartikel 3 Fournisseur auxiliaire 3 - + Lieferant Zusatzartikel 3 Quantité auxiliaire 3 - + Menge Zusatzartikel 3 Unité auxiliaire 3 - + Einheit Zusatzartikel 3 Bloc auxiliaire 4 - Zusatzinfo 4 + Zusatzinfo Zusatzartikel 4 Description textuelle auxiliaire 4 - + Artikelbeschreibung Zusatzartikel 4 Numéro d'article auxiliaire 4 - + Artikelnummer Zusatzartikel 4 Fabricant auxiliaire 4 - + Hersteller Zusatzartikel 4 Numéro de commande auxiliaire 4 - + Bestellnummer Zusatzartikel 4 Numéro interne auxiliaire 4 - + Interne Nummer Zusatzartikel 4 Fournisseur auxiliaire 4 - + Lieferant Zusatzartikel 4 Quantité auxiliaire 4 - + Menge Zusatzartikel 4 Unité auxiliaire 4 - + Einheit Zusatzartikel 4