kaddressbook
#include <qcsvmodel.h>
Inherits QAbstractTableModel.
Signals | |
void | finishedLoading () |
Public Member Functions | |
QCsvModel (QObject *parent) | |
~QCsvModel () | |
virtual int | columnCount (const QModelIndex &parent=QModelIndex()) const |
virtual QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const |
QChar | delimiter () const |
virtual Qt::ItemFlags | flags (const QModelIndex &index) const |
bool | load (QIODevice *device) |
virtual int | rowCount (const QModelIndex &parent=QModelIndex()) const |
virtual bool | setData (const QModelIndex &index, const QVariant &data, int role=Qt::EditRole) |
void | setDelimiter (const QChar &delimiter) |
void | setStartRow (uint startRow) |
void | setTextCodec (QTextCodec *textCodec) |
void | setTextQuote (const QChar &textQuote) |
uint | startRow () const |
QTextCodec * | textCodec () const |
QChar | textQuote () const |
Detailed Description
Definition at line 25 of file qcsvmodel.h.
Constructor & Destructor Documentation
|
explicit |
Creates a new csv model.
Definition at line 147 of file qcsvmodel.cpp.
QCsvModel::~QCsvModel | ( | ) |
Destroys the csv model.
Definition at line 161 of file qcsvmodel.cpp.
Member Function Documentation
|
virtual |
Inherited from QAbstractTableModel.
Definition at line 263 of file qcsvmodel.cpp.
|
virtual |
Inherited from QAbstractTableModel.
Definition at line 281 of file qcsvmodel.cpp.
QChar QCsvModel::delimiter | ( | ) | const |
Returns the delimiter that is used as delimiter for fields.
Definition at line 216 of file qcsvmodel.cpp.
|
signal |
This signal is emitted whenever the model has loaded all data.
|
virtual |
Inherited from QAbstractTableModel.
Definition at line 326 of file qcsvmodel.cpp.
bool QCsvModel::load | ( | QIODevice * | device | ) |
Loads the data from the device
into the model.
Definition at line 166 of file qcsvmodel.cpp.
|
virtual |
Inherited from QAbstractTableModel.
Definition at line 272 of file qcsvmodel.cpp.
|
virtual |
Inherited from QAbstractTableModel.
Definition at line 313 of file qcsvmodel.cpp.
void QCsvModel::setDelimiter | ( | const QChar & | delimiter | ) |
Sets the character that is used as delimiter for fields.
The default is ' '.
Definition at line 200 of file qcsvmodel.cpp.
void QCsvModel::setStartRow | ( | uint | startRow | ) |
Sets the row from where the parsing shall be started.
Some csv files have some kind of header in the first line with the column titles. To retrieve only the real data, set the start row to '1' in this case.
The default start row is 0.
Definition at line 221 of file qcsvmodel.cpp.
void QCsvModel::setTextCodec | ( | QTextCodec * | textCodec | ) |
Sets the text codec that shall be used for parsing the csv list.
The default is the system locale.
Definition at line 242 of file qcsvmodel.cpp.
void QCsvModel::setTextQuote | ( | const QChar & | textQuote | ) |
Sets the character that is used for quoting.
The default is '"'.
Definition at line 179 of file qcsvmodel.cpp.
uint QCsvModel::startRow | ( | ) | const |
Returns the start row.
Definition at line 237 of file qcsvmodel.cpp.
QTextCodec * QCsvModel::textCodec | ( | ) | const |
Returns the text codec that is used for parsing the csv list.
Definition at line 258 of file qcsvmodel.cpp.
QChar QCsvModel::textQuote | ( | ) | const |
Returns the character that is used for quoting.
Definition at line 195 of file qcsvmodel.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:55:52 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.