Simple implementation of CSV export.

This commit is contained in:
2026-01-06 10:04:26 +01:00
parent 3e6273cb7d
commit 99ed398c2f
8 changed files with 46 additions and 0 deletions

View File

@ -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!";