15 #ifndef BORNAGAIN_GUI_MODEL_MODEL_FITPARAMETERMODEL_H
16 #define BORNAGAIN_GUI_MODEL_MODEL_FITPARAMETERMODEL_H
18 #include <QAbstractItemModel>
19 #include <QStringList>
31 QObject*
parent =
nullptr);
37 Qt::ItemFlags
flags(
const QModelIndex&
index)
const override;
38 QModelIndex
index(
int row,
int column,
const QModelIndex&
parent)
const override;
39 QModelIndex
parent(
const QModelIndex& child)
const override;
42 QVariant
data(
const QModelIndex&
index,
int role = Qt::DisplayRole)
const override;
43 bool setData(
const QModelIndex&
index,
const QVariant& value,
int role)
override;
48 QMimeData*
mimeData(
const QModelIndexList& indexes)
const override;
50 const QModelIndex&
parent)
const override;
51 bool dropMimeData(
const QMimeData*
data, Qt::DropAction action,
int row,
int column,
52 const QModelIndex&
parent)
override;
54 QVariant
headerData(
int section, Qt::Orientation orientation,
int role)
const override;
65 const QVector<int>& roles);
80 return Qt::MoveAction | Qt::CopyAction;
85 return Qt::MoveAction | Qt::CopyAction;
The FitParameterContainerItem class is a collection of all defined fit parameters in JobItem.
Model to show items from FitParameterContainer in 5 column tree view.
int columnCount(const QModelIndex &parent) const override
Qt::DropActions supportedDragActions() const override
Qt::ItemFlags flags(const QModelIndex &index) const override
int rowCount(const QModelIndex &parent) const override
QModelIndex indexOfItem(SessionItem *item) const
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
void onSourceDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector< int > &roles)
SessionItem * itemForIndex(const QModelIndex &index) const
bool canDropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const override
void onSourceAboutToBeReset()
SessionModel * sourceModel() const
Qt::DropActions supportedDropActions() const override
FitParameterModel(FitParameterContainerItem *fitParContainer, QObject *parent=nullptr)
QMap< int, QString > m_columnToolTips
bool setData(const QModelIndex &index, const QVariant &value, int role) override
~FitParameterModel() override
QModelIndex parent(const QModelIndex &child) const override
QStringList mimeTypes() const override
QModelIndex index(int row, int column, const QModelIndex &parent) const override
void addColumn(EColumn id, const QString &name, const QString &tooltip)
FitParameterContainerItem * m_parameterContainer
void connectModel(QAbstractItemModel *sourceModel, bool isConnect=true) const
QMimeData * mimeData(const QModelIndexList &indexes) const override
void onSourceRowsRemoved(const QModelIndex &parent, int first, int last)
QMap< int, QString > m_columnNames
bool isValidSourceItem(SessionItem *item) const
Returns true if given item still exists in source model.
bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override
QVariant headerData(int section, Qt::Orientation orientation, int role) const override
Base class for a GUI data item.
Base class for a GUI data collection. A collection is e.g. all real data (RealDataModel)....
QString const & name(EShape k)