BornAgain
1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Model to show items from FitParameterContainer in 5 column tree view.
Definition at line 26 of file FitParameterModel.h.
Public Types | |
enum | EColumn { COL_NAME , COL_TYPE , COL_VALUE , COL_MIN , COL_MAX , NUM_COLUMNS } |
Public Member Functions | |
FitParameterModel (FitParameterContainerItem *fitParContainer, QObject *parent=nullptr) | |
~FitParameterModel () override | |
bool | canDropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const override |
int | columnCount (const QModelIndex &parent) const override |
QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override |
bool | dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override |
Qt::ItemFlags | flags (const QModelIndex &index) const override |
QVariant | headerData (int section, Qt::Orientation orientation, int role) const override |
QModelIndex | index (int row, int column, const QModelIndex &parent) const override |
QModelIndex | indexOfItem (SessionItem *item) const |
bool | isValidSourceItem (SessionItem *item) const |
Returns true if given item still exists in source model. More... | |
SessionItem * | itemForIndex (const QModelIndex &index) const |
QMimeData * | mimeData (const QModelIndexList &indexes) const override |
QStringList | mimeTypes () const override |
QModelIndex | parent (const QModelIndex &child) const override |
int | rowCount (const QModelIndex &parent) const override |
bool | setData (const QModelIndex &index, const QVariant &value, int role) override |
SessionModel * | sourceModel () const |
Qt::DropActions | supportedDragActions () const override |
Qt::DropActions | supportedDropActions () const override |
Private Slots | |
void | onSourceAboutToBeReset () |
void | onSourceDataChanged (const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector< int > &roles) |
void | onSourceRowsRemoved (const QModelIndex &parent, int first, int last) |
Private Member Functions | |
void | addColumn (EColumn id, const QString &name, const QString &tooltip) |
void | connectModel (QAbstractItemModel *sourceModel, bool isConnect=true) const |
Private Attributes | |
QMap< int, QString > | m_columnNames |
QMap< int, QString > | m_columnToolTips |
FitParameterContainerItem * | m_parameterContainer |
Enumerator | |
---|---|
COL_NAME | |
COL_TYPE | |
COL_VALUE | |
COL_MIN | |
COL_MAX | |
NUM_COLUMNS |
Definition at line 35 of file FitParameterModel.h.
|
explicit |
Definition at line 33 of file FitParameterModel.cpp.
References addColumn(), COL_MAX, COL_MIN, COL_NAME, COL_TYPE, COL_VALUE, connectModel(), Error, m_parameterContainer, SessionItem::mapper(), SessionItem::model(), and ModelMapper::setOnItemDestroy().
|
override |
Definition at line 56 of file FitParameterModel.cpp.
References m_parameterContainer, SessionItem::mapper(), and ModelMapper::unsubscribe().
|
private |
Definition at line 364 of file FitParameterModel.cpp.
References m_columnNames, m_columnToolTips, and GUI::RealSpace::Particles::name().
Referenced by FitParameterModel().
|
override |
Definition at line 264 of file FitParameterModel.cpp.
References data(), and parent().
|
override |
Definition at line 180 of file FitParameterModel.cpp.
References COL_NAME, itemForIndex(), m_parameterContainer, NUM_COLUMNS, and parent().
Referenced by index().
|
private |
Definition at line 344 of file FitParameterModel.cpp.
References onSourceAboutToBeReset(), onSourceDataChanged(), onSourceRowsRemoved(), and sourceModel().
Referenced by FitParameterModel().
|
override |
Definition at line 200 of file FitParameterModel.cpp.
References index(), itemForIndex(), m_parameterContainer, and NUM_COLUMNS.
Referenced by canDropMimeData(), dropMimeData(), and mimeData().
|
override |
Definition at line 278 of file FitParameterModel.cpp.
References FitParameterContainerItem::addToFitParameter(), FitParameterContainerItem::createFitParameter(), data(), itemForIndex(), GUI::Session::XML::LinkMimeType, m_parameterContainer, and parent().
|
override |
Definition at line 62 of file FitParameterModel.cpp.
References COL_NAME, SessionItem::hasModelType(), index(), itemForIndex(), and m_parameterContainer.
|
override |
Definition at line 302 of file FitParameterModel.cpp.
References m_columnNames, and m_columnToolTips.
|
override |
Definition at line 91 of file FitParameterModel.cpp.
References COL_MAX, COL_MIN, COL_NAME, COL_TYPE, COL_VALUE, columnCount(), SessionItem::hasModelType(), itemForIndex(), m_parameterContainer, FitParameterItem::maximumItem(), FitParameterItem::minimumItem(), parent(), FitParameterItem::startValueItem(), and FitParameterItem::typeItem().
Referenced by data(), flags(), indexOfItem(), itemForIndex(), mimeData(), setData(), and FitParameterWidget::spanParameters().
QModelIndex FitParameterModel::indexOfItem | ( | SessionItem * | item | ) | const |
Definition at line 371 of file FitParameterModel.cpp.
References COL_MAX, COL_MIN, COL_TYPE, COL_VALUE, SessionItem::hasModelType(), index(), m_parameterContainer, SessionItem::parentItem(), and SessionItem::parentRow().
Referenced by onSourceDataChanged().
bool FitParameterModel::isValidSourceItem | ( | SessionItem * | item | ) | const |
Returns true if given item still exists in source model.
Definition at line 426 of file FitParameterModel.cpp.
References SessionItem::index(), GUI::Model::Path::isValidItem(), m_parameterContainer, and sourceModel().
Referenced by itemForIndex(), parent(), and rowCount().
SessionItem * FitParameterModel::itemForIndex | ( | const QModelIndex & | index | ) | const |
Definition at line 403 of file FitParameterModel.cpp.
References index(), isValidSourceItem(), and m_parameterContainer.
Referenced by columnCount(), data(), dropMimeData(), flags(), index(), mimeData(), FitParameterWidget::onFitParametersSelectionChanged(), parent(), rowCount(), FitParameterWidget::selectedFitParameterLinks(), FitParameterWidget::selectedFitParameters(), and setData().
|
override |
Definition at line 248 of file FitParameterModel.cpp.
References data(), FitParameterHelper::getParameterItem(), index(), itemForIndex(), GUI::Session::XML::LinkMimeType, and m_parameterContainer.
|
override |
Definition at line 241 of file FitParameterModel.cpp.
References GUI::Session::XML::LinkMimeType.
|
privateslot |
Definition at line 336 of file FitParameterModel.cpp.
References m_parameterContainer.
Referenced by connectModel().
|
privateslot |
Definition at line 311 of file FitParameterModel.cpp.
References indexOfItem(), SessionModel::itemForIndex(), and sourceModel().
Referenced by connectModel().
|
privateslot |
Definition at line 327 of file FitParameterModel.cpp.
References parent().
Referenced by connectModel().
|
override |
Definition at line 138 of file FitParameterModel.cpp.
References isValidSourceItem(), itemForIndex(), m_parameterContainer, SessionItem::parentItem(), and SessionItem::parentRow().
Referenced by canDropMimeData(), columnCount(), dropMimeData(), index(), onSourceRowsRemoved(), and rowCount().
|
override |
Definition at line 161 of file FitParameterModel.cpp.
References COL_NAME, SessionItem::hasModelType(), isValidSourceItem(), itemForIndex(), m_parameterContainer, SessionItem::numberOfChildren(), and parent().
Referenced by FitParameterWidget::spanParameters().
|
override |
Definition at line 224 of file FitParameterModel.cpp.
References index(), itemForIndex(), and m_parameterContainer.
SessionModel * FitParameterModel::sourceModel | ( | ) | const |
Definition at line 419 of file FitParameterModel.cpp.
References m_parameterContainer, and SessionItem::model().
Referenced by connectModel(), isValidSourceItem(), and onSourceDataChanged().
|
inlineoverride |
Definition at line 78 of file FitParameterModel.h.
|
inlineoverride |
Definition at line 83 of file FitParameterModel.h.
|
private |
Definition at line 74 of file FitParameterModel.h.
Referenced by addColumn(), and headerData().
|
private |
Definition at line 75 of file FitParameterModel.h.
Referenced by addColumn(), and headerData().
|
private |
Definition at line 73 of file FitParameterModel.h.
Referenced by FitParameterModel(), ~FitParameterModel(), columnCount(), data(), dropMimeData(), flags(), index(), indexOfItem(), isValidSourceItem(), itemForIndex(), mimeData(), onSourceAboutToBeReset(), parent(), rowCount(), setData(), and sourceModel().