1 // Copyright (c) 2011-2013 The Bitcoin developers
2 // Distributed under the MIT/X11 software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 #ifndef CSVMODELWRITER_H
6 #define CSVMODELWRITER_H
12 class QAbstractItemModel;
15 /** Export a Qt table model to a CSV file. This is useful for analyzing or post-processing the data in
18 class CSVModelWriter : public QObject
23 explicit CSVModelWriter(const QString &filename, QObject *parent = 0);
25 void setModel(const QAbstractItemModel *model);
26 void addColumn(const QString &title, int column, int role=Qt::EditRole);
28 /** Perform export of the model to CSV.
29 @returns true on success, false otherwise
35 const QAbstractItemModel *model;
43 QList<Column> columns;
46 #endif // CSVMODELWRITER_H