Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
Export a Qt table model to a CSV file. More...
#include <csvmodelwriter.h>
Classes | |
struct | Column |
Public Member Functions | |
CSVModelWriter (const QString &filename, QObject *parent=0) | |
void | setModel (const QAbstractItemModel *model) |
void | addColumn (const QString &title, int column, int role=Qt::EditRole) |
bool | write () |
Perform export of the model to CSV. More... | |
Private Attributes | |
QString | filename |
const QAbstractItemModel * | model |
QList< Column > | columns |
Detailed Description
Export a Qt table model to a CSV file.
This is useful for analyzing or post-processing the data in a spreadsheet.
Definition at line 18 of file csvmodelwriter.h.
Constructor & Destructor Documentation
◆ CSVModelWriter()
|
explicit |
Definition at line 11 of file csvmodelwriter.cpp.
Member Function Documentation
◆ addColumn()
void CSVModelWriter::addColumn | ( | const QString & | title, |
int | column, | ||
int | role = Qt::EditRole |
||
) |
Definition at line 22 of file csvmodelwriter.cpp.
References CSVModelWriter::Column::column, columns, CSVModelWriter::Column::role, and CSVModelWriter::Column::title.
Referenced by TransactionView::exportClicked(), and AddressBookPage::on_exportButton_clicked().
◆ setModel()
void CSVModelWriter::setModel | ( | const QAbstractItemModel * | model | ) |
Definition at line 17 of file csvmodelwriter.cpp.
References model.
Referenced by TransactionView::exportClicked(), and AddressBookPage::on_exportButton_clicked().
◆ write()
bool CSVModelWriter::write | ( | ) |
Perform export of the model to CSV.
- Returns
- true on success, false otherwise
Definition at line 49 of file csvmodelwriter.cpp.
References columns, filename, model, writeNewline(), writeSep(), and writeValue().
Referenced by TransactionView::exportClicked(), and AddressBookPage::on_exportButton_clicked().
Member Data Documentation
◆ columns
|
private |
Definition at line 43 of file csvmodelwriter.h.
Referenced by addColumn(), and write().
◆ filename
|
private |
Definition at line 34 of file csvmodelwriter.h.
Referenced by write().
◆ model
|
private |
Definition at line 35 of file csvmodelwriter.h.
Referenced by setModel(), and write().
The documentation for this class was generated from the following files:
- src/qt/csvmodelwriter.h
- src/qt/csvmodelwriter.cpp