Fabcoin Core  0.16.2
P2P Digital Currency
Classes | Public Member Functions | Private Attributes | List of all members
CSVModelWriter Class Reference

Export a Qt table model to a CSV file. More...

#include <csvmodelwriter.h>

Inheritance diagram for CSVModelWriter:
[legend]
Collaboration diagram for CSVModelWriter:
[legend]

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< 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.

Definition at line 18 of file csvmodelwriter.h.

Constructor & Destructor Documentation

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

Definition at line 11 of file csvmodelwriter.cpp.

Member Function Documentation

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

Definition at line 22 of file csvmodelwriter.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void CSVModelWriter::setModel ( const QAbstractItemModel *  model)

Definition at line 17 of file csvmodelwriter.cpp.

Here is the caller graph for this function:

bool CSVModelWriter::write ( )

Perform export of the model to CSV.

Returns
true on success, false otherwise

Definition at line 49 of file csvmodelwriter.cpp.

Here is the caller graph for this function:

Member Data Documentation

QList<Column> CSVModelWriter::columns
private

Definition at line 43 of file csvmodelwriter.h.

QString CSVModelWriter::filename
private

Definition at line 34 of file csvmodelwriter.h.

const QAbstractItemModel* CSVModelWriter::model
private

Definition at line 35 of file csvmodelwriter.h.


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