From 2df9528082d5daa9b3368eac730a2b3a5dc95000 Mon Sep 17 00:00:00 2001 From: joshua Date: Fri, 8 Nov 2019 19:06:11 +0100 Subject: [PATCH] CSV export : fix some missing informations. --- sources/ui/bomexportdialog.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sources/ui/bomexportdialog.cpp b/sources/ui/bomexportdialog.cpp index c3dbedb87..a12238417 100644 --- a/sources/ui/bomexportdialog.cpp +++ b/sources/ui/bomexportdialog.cpp @@ -103,9 +103,9 @@ void BOMExportDialog::setUpItems() { for(QString key : QETApp::elementInfoKeys()) { - auto item = new QListWidgetItem(QETApp::elementTranslatedInfoKey(key), ui->m_var_list); - item->setData(Qt::UserRole, key.replace("-", "_")); //We must to replace "-" by "_" because "-" is a sql keyword. - item->setData(Qt::UserRole+1, key); //But we store the real key for easily retrieve it in the element information + auto item = new QListWidgetItem(QETApp::elementTranslatedInfoKey(key), ui->m_var_list); + item->setData(Qt::UserRole+1, key); //We store the real key before replace "-" by "_" to easily retrieve it in the element information + item->setData(Qt::UserRole, key.replace("-", "_")); //We must to replace "-" by "_" because "-" is a sql keyword. } QStringList other_keys({"pos", "folio_title", "folio_pos", "folio_num", "designation_qty"}); QStringList other_translated({tr("Position"), tr("Titre du folio"), tr("Position de folio"), tr("Numéro de folio"), tr("Quantité (Numéro d'article)")}); @@ -273,7 +273,7 @@ QString BOMExportDialog::headers() const bool BOMExportDialog::createDataBase() { //Create a sqlite data base to sort the bom - m_data_base = QSqlDatabase::addDatabase("QSQLITE", "bill_of_material"); + m_data_base = QSqlDatabase::addDatabase("QSQLITE", "bill_of_material"); if (!m_data_base.open()) { m_data_base.close(); @@ -421,7 +421,7 @@ QHash BOMExportDialog::elementInfoToString(Element *elmt) cons hash.insert(key, QString::number(elmt->diagram()->folioIndex() + 1)); } else if (key == "folio_num") { - hash.insert(key, elmt->diagram()->border_and_titleblock.folio()); + hash.insert(key, elmt->diagram()->border_and_titleblock.finalfolio()); } else if (key == "designation_qty") { hash.insert(key, key);