##// END OF EJS Templates
Handles StateRole in variable model
Alexandre Leroux -
r809:892af30fdefb
parent child
Show More
@@ -13,8 +13,7
13
13
14 Q_DECLARE_LOGGING_CATEGORY(LOG_VariableModel)
14 Q_DECLARE_LOGGING_CATEGORY(LOG_VariableModel)
15
15
16 enum VariableRoles { ProgressRole = Qt::UserRole };
16 enum VariableRoles { ProgressRole = Qt::UserRole, StateRole };
17
18
17
19 class IDataSeries;
18 class IDataSeries;
20 class Variable;
19 class Variable;
@@ -228,6 +228,11 QVariant VariableModel::data(const QModelIndex &index, int role) const
228 }
228 }
229 }
229 }
230 }
230 }
231 else if (role == VariableRoles::StateRole) {
232 if (auto variable = impl->m_Variables.at(index.row())) {
233 return variable->stateData();
234 }
235 }
231
236
232 return QVariant{};
237 return QVariant{};
233 }
238 }
General Comments 0
You need to be logged in to leave comments. Login now