17 if (role == Qt::DisplayRole)
18 {
if (index.column()==0)
22 if (index.column()==1)
31 return "Particle Size";
33 return "Organic Carbon";
36 if (index.column()==2)
43 if (index.column()==3)
50 if (index.column()==4)
58 if (role == Qt::ItemIsEnabled)
60 if (index.column()==2 || index.column()==3)
72 if (role == Qt::DisplayRole)
74 if (orientation == Qt::Horizontal)
81 return "Constituent Type";
85 return "Base Element";
89 return "Standard isotope ratio";
93 return "Include in analysis";
101 if (role==Qt::EditRole)
105 if (index.column()==1)
107 if (value.toString()==
"Element")
109 if (value.toString()==
"Isotope")
111 if (value.toString()==
"Exclude")
113 if (value.toString()==
"Particle Size")
115 if (value.toString()==
"Organic Carbon")
119 if (index.column()==2)
123 if (index.column()==3)
127 if (index.column()==4)
129 if (value.toString()==
"Yes" || value.toBool())
136 QString result =
"Done";
142 if (index.column()!=0 && index.column()!=4)
143 return Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled ;
144 else if (index.column()==4)
145 return Qt::ItemIsSelectable | Qt::ItemFlag::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsEditable ;
147 return Qt::ItemIsSelectable | Qt::ItemIsEnabled ;
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
ElementTableModel(SourceSinkData *Data, QObject *parent=nullptr)
QVariant headerData(int section, Qt::Orientation orientation, int role) const override
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Qt::ItemFlags flags(const QModelIndex &index) const override
int rowCount(const QModelIndex &parent=QModelIndex()) const override
void editCompleted(const QString &)
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
vector< string > GetElementNames() const
Get all element names in the dataset.
map< string, element_information > * GetElementInformation()
Retrieves pointer to the element information map.