4 QAbstractTableModel(parent)
10 : QAbstractTableModel(parent)
12 dataset_ = QSharedPointer<VespucciDataset>(0);
17 if (dataset_.data())
return dataset_->spectra_ref().n_cols;
28 if (role != Qt::DisplayRole)
return QVariant();
30 if (!dataset_.data())
return QVariant();
32 switch (index.column()){
33 case 0:
return QString::number(index.row());
34 case 1:
return QString::number(dataset_->x_ptr()->at(index.row()));
35 case 2:
return QString::number(dataset_->y_ptr()->at(index.row()));
36 default:
return QVariant();
42 if (dataset_.data()) dataset_->ShedSpectrum(row);
47 if (role != Qt::DisplayRole)
return QVariant();
48 if (orientation != Qt::Orientation::Horizontal)
return QVariant();
49 if (section > 2)
return QVariant();
50 if (section == 0)
return QVariant(
"ind");
51 if (section == 1)
return QVariant(
"x");
52 if (section == 2)
return QVariant(
"y");
int columnCount(const QModelIndex &parent) const
QVariant data(const QModelIndex &index, int role) const
QVariant headerData(int section, Qt::Orientation orientation, int role) const
SpectraTableModel(QObject *parent, QSharedPointer< VespucciDataset > dataset)
int rowCount(const QModelIndex &parent) const