1 #ifndef CSVMODELWRITER_H
2 #define CSVMODELWRITER_H
8 class QAbstractItemModel;
11 /** Export a Qt table model to a CSV file. This is useful for analyzing or post-processing the data in
14 class CSVModelWriter : public QObject
18 explicit CSVModelWriter(const QString &filename, QObject *parent = 0);
20 void setModel(const QAbstractItemModel *model);
21 void addColumn(const QString &title, int column, int role=Qt::EditRole);
23 /** Perform export of the model to CSV.
24 @returns true on success, false otherwise
30 const QAbstractItemModel *model;
38 QList<Column> columns;
46 #endif // CSVMODELWRITER_H