Modifies the toCsv functions of qxtcsvmodel to be const.
This commit is contained in:
parent
7c83e1694e
commit
b987ed3957
|
@ -434,9 +434,9 @@ static QString qxt_addCsvQuotes(QxtCsvModel::QuoteMode mode, QString field)
|
|||
Fields in the output file will be separated by \a separator. Set \a withHeader to true
|
||||
to output a row of headers at the top of the file.
|
||||
*/
|
||||
void QxtCsvModel::toCSV(QIODevice* dest, bool withHeader, QChar separator, QTextCodec* codec)
|
||||
void QxtCsvModel::toCSV(QIODevice* dest, bool withHeader, QChar separator, QTextCodec* codec) const
|
||||
{
|
||||
QxtCsvModelPrivate& d_ptr = qxt_d();
|
||||
const QxtCsvModelPrivate& d_ptr = qxt_d();
|
||||
int row, col, rows, cols;
|
||||
rows = rowCount();
|
||||
cols = columnCount();
|
||||
|
@ -477,7 +477,7 @@ void QxtCsvModel::toCSV(QIODevice* dest, bool withHeader, QChar separator, QText
|
|||
Fields in the output file will be separated by \a separator. Set \a withHeader to true
|
||||
to output a row of headers at the top of the file.
|
||||
*/
|
||||
void QxtCsvModel::toCSV(const QString filename, bool withHeader, QChar separator, QTextCodec* codec)
|
||||
void QxtCsvModel::toCSV(const QString filename, bool withHeader, QChar separator, QTextCodec* codec) const
|
||||
{
|
||||
QFile dest(filename);
|
||||
toCSV(&dest, withHeader, separator, codec);
|
||||
|
|
|
@ -76,8 +76,8 @@ public:
|
|||
void setSource(QIODevice *file, bool withHeader = false, QChar separator = ',', QTextCodec* codec = 0);
|
||||
void setSource(const QString filename, bool withHeader = false, QChar separator = ',', QTextCodec* codec = 0);
|
||||
|
||||
void toCSV(QIODevice *file, bool withHeader = false, QChar separator = ',', QTextCodec* codec = 0);
|
||||
void toCSV(const QString filename, bool withHeader = false, QChar separator = ',', QTextCodec* codec = 0);
|
||||
void toCSV(QIODevice *file, bool withHeader = false, QChar separator = ',', QTextCodec* codec = 0) const;
|
||||
void toCSV(const QString filename, bool withHeader = false, QChar separator = ',', QTextCodec* codec = 0) const;
|
||||
|
||||
enum QuoteOption { NoQuotes = 0, SingleQuote = 1, DoubleQuote = 2, BothQuotes = 3,
|
||||
NoEscape = 0, TwoQuoteEscape = 4, BackslashEscape = 8,
|
||||
|
|
Loading…
Reference in New Issue
Block a user