Bitcoin
Classes | Public Member Functions | Private Attributes | List of all members
CSVModelWriter Class Reference

#include <csvmodelwriter.h>

Inheritance diagram for CSVModelWriter:

Classes

struct  Column
 

Public Member Functions

 CSVModelWriter (const QString &filename, QObject *parent=nullptr)
 
void setModel (const QAbstractItemModel *model)
 
void addColumn (const QString &title, int column, int role=Qt::EditRole)
 
bool write ()
 

Private Attributes

QString filename
 
const QAbstractItemModel * model
 
QList< Columncolumns
 

Detailed Description

Export a Qt table model to a CSV file. This is useful for analyzing or post-processing the data in a spreadsheet.

Constructor & Destructor Documentation

◆ CSVModelWriter()

CSVModelWriter::CSVModelWriter ( const QString &  filename,
QObject *  parent = nullptr 
)
explicit

Member Function Documentation

◆ addColumn()

void CSVModelWriter::addColumn ( const QString &  title,
int  column,
int  role = Qt::EditRole 
)

◆ setModel()

void CSVModelWriter::setModel ( const QAbstractItemModel *  model)

◆ write()

bool CSVModelWriter::write ( )

Perform export of the model to CSV.

Returns
true on success, false otherwise

Member Data Documentation

◆ columns

QList<Column> CSVModelWriter::columns
private

◆ filename

QString CSVModelWriter::filename
private

◆ model

const QAbstractItemModel* CSVModelWriter::model
private

The documentation for this class was generated from the following files: