Changeset View
Changeset View
Standalone View
Standalone View
src/qt/csvmodelwriter.h
Show All 14 Lines | |||||
/** Export a Qt table model to a CSV file. This is useful for analyzing or | /** Export a Qt table model to a CSV file. This is useful for analyzing or | ||||
post-processing the data in | post-processing the data in | ||||
a spreadsheet. | a spreadsheet. | ||||
*/ | */ | ||||
class CSVModelWriter : public QObject { | class CSVModelWriter : public QObject { | ||||
Q_OBJECT | Q_OBJECT | ||||
public: | public: | ||||
explicit CSVModelWriter(const QString &filename, QObject *parent = 0); | explicit CSVModelWriter(const QString &filename, QObject *parent = nullptr); | ||||
void setModel(const QAbstractItemModel *model); | void setModel(const QAbstractItemModel *model); | ||||
void addColumn(const QString &title, int column, int role = Qt::EditRole); | void addColumn(const QString &title, int column, int role = Qt::EditRole); | ||||
/** Perform export of the model to CSV. | /** Perform export of the model to CSV. | ||||
@returns true on success, false otherwise | @returns true on success, false otherwise | ||||
*/ | */ | ||||
bool write(); | bool write(); | ||||
Show All 14 Lines |