Fixed the column names in CSV export.
This commit is contained in:
@ -23,9 +23,12 @@ QList<ModelItemValues> CsvParser::getItemsFromCSVFile(const QString& fileName) {
|
||||
|
||||
bool CsvParser::exportToCSVFile(const QList<QStringList>& rows, const QString& filePath) {
|
||||
Document doc(std::string(), LabelParams(0, -1));
|
||||
const QList<QString> headerNames = GET_HEADER_NAMES();
|
||||
for (int column = 0; column < headerNames.size(); ++column) {
|
||||
doc.SetColumnName(column, headerNames.at(column).toStdString());
|
||||
// const QList<QString> headerNames = GET_HEADER_NAMES();
|
||||
const int columnCount = USER_FACING_ROLES.size();
|
||||
for (int column = 0; column < columnCount; ++column) {
|
||||
const UserRoles role = GET_ROLE_FOR_COLUMN(column);
|
||||
std::string columnName = ROLE_NAMES.value(role).toStdString();
|
||||
doc.SetColumnName(column, columnName);
|
||||
}
|
||||
for (int row = 0; row < rows.size(); ++row) {
|
||||
QStringList rowValues = rows.at(row);
|
||||
|
||||
Reference in New Issue
Block a user