feat: basic geometry spreadsheet model

This commit is contained in:
parker
2025-08-05 22:10:10 +01:00
parent ef372a9630
commit 2c139a5f6a
4 changed files with 56 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
#include "Gui/GeometrySpreadsheetPanel/GeometrySpreadsheetModel.h"
int GeometrySpreadsheetModel::rowCount(const QModelIndex &parent) const
{
return stringList.count();
}
QVariant GeometrySpreadsheetModel::data(const QModelIndex &index, int role) const
{
if (!index.isValid())
return QVariant();
if (index.row() >= stringList.size())
return QVariant();
if (role == Qt::DisplayRole)
return stringList.at(index.row());
else
return QVariant();
}
QVariant GeometrySpreadsheetModel::headerData(int section, Qt::Orientation orientation,
int role) const
{
if (role != Qt::DisplayRole)
return QVariant();
if (orientation == Qt::Horizontal)
return QStringLiteral("Column %1").arg(section);
else
return QStringLiteral("Row %1").arg(section);
}