Bitcoin ABC
0.26.3
P2P Digital Currency
Loading...
Searching...
No Matches
src
qt
csvmodelwriter.h
Go to the documentation of this file.
1
// Copyright (c) 2011-2014 The Bitcoin Core developers
2
// Distributed under the MIT software license, see the accompanying
3
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5
#ifndef BITCOIN_QT_CSVMODELWRITER_H
6
#define BITCOIN_QT_CSVMODELWRITER_H
7
8
#include <QList>
9
#include <QObject>
10
11
QT_BEGIN_NAMESPACE
12
class
QAbstractItemModel
;
13
QT_END_NAMESPACE
14
19
class
CSVModelWriter
:
public
QObject {
20
Q_OBJECT
21
22
public
:
23
explicit
CSVModelWriter
(
const
QString
&
filename
, QObject *parent =
nullptr
);
24
25
void
setModel
(
const
QAbstractItemModel
*
model
);
26
void
addColumn
(
const
QString
&title,
int
column,
int
role = Qt::EditRole);
27
31
bool
write
();
32
33
private
:
34
QString
filename
;
35
const
QAbstractItemModel
*
model
;
36
37
struct
Column
{
38
QString
title
;
39
int
column
;
40
int
role
;
41
};
42
QList<Column>
columns
;
43
};
44
45
#endif
// BITCOIN_QT_CSVMODELWRITER_H
CSVModelWriter
Export a Qt table model to a CSV file.
Definition
csvmodelwriter.h:19
CSVModelWriter::columns
QList< Column > columns
Definition
csvmodelwriter.h:42
CSVModelWriter::write
bool write()
Perform export of the model to CSV.
Definition
csvmodelwriter.cpp:41
CSVModelWriter::setModel
void setModel(const QAbstractItemModel *model)
Definition
csvmodelwriter.cpp:14
CSVModelWriter::filename
QString filename
Definition
csvmodelwriter.h:34
CSVModelWriter::addColumn
void addColumn(const QString &title, int column, int role=Qt::EditRole)
Definition
csvmodelwriter.cpp:18
CSVModelWriter::model
const QAbstractItemModel * model
Definition
csvmodelwriter.h:35
GetRand
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
Definition
random.h:85
CSVModelWriter::Column
Definition
csvmodelwriter.h:37
CSVModelWriter::Column::title
QString title
Definition
csvmodelwriter.h:38
CSVModelWriter::Column::role
int role
Definition
csvmodelwriter.h:40
CSVModelWriter::Column::column
int column
Definition
csvmodelwriter.h:39
Generated on Sat Nov 23 2024 02:37:59 for Bitcoin ABC by
1.9.8