13 #ifndef QmitkSimpleBarrierModel_h
14 #define QmitkSimpleBarrierModel_h
16 #include <QAbstractTableModel>
79 Qt::ItemFlags
flags(
const QModelIndex& index)
const override;
92 QVariant
data(
const QModelIndex& index,
int role)
const override;
104 QVariant
headerData(
int section, Qt::Orientation orientation,
int role)
const override;
111 int rowCount(
const QModelIndex& parent = QModelIndex())
const override;
118 int columnCount(
const QModelIndex& parent = QModelIndex())
const override;
132 bool setData(
const QModelIndex& index,
const QVariant& value,
int role = Qt::EditRole)
override;
#define MITKMODELFITUI_EXPORT
Qt table model for viewing and editing the constraints of a SimpleBarrierConstraintChecker.
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
Sets data for a given index.
void addConstraint()
Adds a new default lower barrier constraint for parameter 0 with barrier value 0.
QmitkSimpleBarrierModel(QObject *parent=nullptr)
Constructs a QmitkSimpleBarrierModel.
~QmitkSimpleBarrierModel() override
Destructor.
void setChecker(mitk::SimpleBarrierConstraintChecker *pChecker, const mitk::ModelTraitsInterface::ParameterNamesType &names, const mitk::ModelTraitsInterface::ParamterUnitMapType units)
Sets the constraint checker and parameter metadata managed by this model.
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Returns the number of columns (always 5).
QVariant data(const QModelIndex &index, int role) const override
Returns data for the given index and role.
Qt::ItemFlags flags(const QModelIndex &index) const override
Returns item flags for the given model index.
QVariant headerData(int section, Qt::Orientation orientation, int role) const override
Returns header data for the specified section.
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Returns the number of constraints (rows).
bool isModified()
Indicates whether the model content has been modified since the last setChecker() call.
void deleteConstraint(const QModelIndex &index)
Deletes the constraint at the specified model index.
std::map< ParameterNameType, std::string > ParamterUnitMapType
Map type associating parameter names to their unit strings.
std::vector< ParameterNameType > ParameterNamesType
Type for a list of parameter names.
This class implements constraints as simple barrier functions.