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
19 explicit CSVModelWriter(const QString &filename, QObject *parent = 0);
21 void setModel(const QAbstractItemModel *model);
22 void addColumn(const QString &title, int column, int role=Qt::EditRole);
24 /** Perform export of the model to CSV.
25 @returns true on success, false otherwise
31 const QAbstractItemModel *model;
39 QList<Column> columns;
42 #endif // CSVMODELWRITER_H