Export a Qt table model to a CSV file.
More...
#include <csvmodelwriter.h>
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.
◆ CSVModelWriter()
CSVModelWriter::CSVModelWriter |
( |
const QString & |
filename, |
|
|
QObject * |
parent = nullptr |
|
) |
| |
|
explicit |
◆ 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
Definition at line 49 of file csvmodelwriter.cpp.
◆ columns
QList<Column> CSVModelWriter::columns |
|
private |
◆ filename
QString CSVModelWriter::filename |
|
private |
◆ model
const QAbstractItemModel* CSVModelWriter::model {nullptr} |
|
private |
The documentation for this class was generated from the following files: