diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2011-07-07 14:27:16 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2011-07-07 14:27:16 +0200 |
commit | fbaee7a8533b23d846ee16837320f709c4e83d47 (patch) | |
tree | f867d31077177c79d27a2c475fb19b566c5010bf /src/qt/csvmodelwriter.h | |
parent | d52a0f3bca2c8df8360308b062185d803e34f0d9 (diff) |
Export functionality for transaction list
Diffstat (limited to 'src/qt/csvmodelwriter.h')
-rw-r--r-- | src/qt/csvmodelwriter.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/qt/csvmodelwriter.h b/src/qt/csvmodelwriter.h new file mode 100644 index 0000000000..7367f3a6a9 --- /dev/null +++ b/src/qt/csvmodelwriter.h @@ -0,0 +1,43 @@ +#ifndef CSVMODELWRITER_H +#define CSVMODELWRITER_H + +#include <QObject> +#include <QList> + +QT_BEGIN_NAMESPACE +class QAbstractItemModel; +QT_END_NAMESPACE + +// Export TableModel to CSV file +class CSVModelWriter : public QObject +{ + Q_OBJECT +public: + explicit CSVModelWriter(const QString &filename, QObject *parent = 0); + + void setModel(const QAbstractItemModel *model); + void addColumn(const QString &title, int column, int role=Qt::EditRole); + + // Perform write operation + // Returns true on success, false otherwise + bool write(); + +private: + QString filename; + const QAbstractItemModel *model; + + struct Column + { + QString title; + int column; + int role; + }; + QList<Column> columns; + +signals: + +public slots: + +}; + +#endif // CSVMODELWRITER_H |