Simple implementation of CSV export.
This commit is contained in:
@ -146,6 +146,19 @@ QJsonDocument TableModel::getAllItemsAsJsonDoc() const {
|
||||
return doc;
|
||||
}
|
||||
|
||||
QList<QStringList> TableModel::getItemsAsStringLists() const {
|
||||
QList<QStringList> result;
|
||||
foreach (shared_ptr<ModelItem> item, m_items) {
|
||||
QStringList valueList;
|
||||
for (int column = 0; column < columnCount(); ++column) {
|
||||
QString value = item->data(GET_ROLE_FOR_COLUMN(column)).toString();
|
||||
valueList.append(value);
|
||||
}
|
||||
result.append(valueList);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
bool TableModel::removeRows(int firstRow, int nRows, const QModelIndex& parentIndex) {
|
||||
if (parentIndex != QModelIndex()) {
|
||||
qWarning() << "Removing of child rows is not supported yet!";
|
||||
|
||||
Reference in New Issue
Block a user