BornAgain
1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
|
The RealDataModel class is a model to store all imported RealDataItem's.
Definition at line 24 of file RealDataModel.h.
Signals | |
void | realDataAddedOrRemoved () |
Public Member Functions | |
RealDataModel (QObject *parent=nullptr) | |
QVector< QString > | acceptableDefaultItemTypes (const QModelIndex &parent) const |
bool | canDropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const override |
virtual void | clear () |
int | columnCount (const QModelIndex &parent) const override |
SessionItem * | copy (const SessionItem *item_to_copy, SessionItem *new_parent=nullptr, const QString &tag="") |
Copy given item to the new_parent at given row. Item intended for copying can belong to another model and it will remain intact. Returns pointer to the new child. More... | |
template<typename T > | |
T * | copyItem (const T *item_to_copy, SessionItem *new_parent=nullptr, const QString &tag="") |
void | createRootItem () |
QVariant | data (const QModelIndex &index, int role) 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 |
QString | getModelTag () const |
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 |
virtual void | initFrom (SessionModel *model, SessionItem *parent) |
RealDataItem * | insertDataItem (int rank) |
RealDataItem * | insertIntensityDataItem () |
template<typename T > | |
T * | insertItem (const QModelIndex &parent, int row=-1, QString tag="") |
template<typename T > | |
T * | insertItem (SessionItem *parent=nullptr, int row=-1, QString tag="") |
SessionItem * | insertNewItem (QString model_type, const QModelIndex &parent_item, int row=-1, QString tag="") |
SessionItem * | insertNewItem (QString model_type, SessionItem *parent_item=nullptr, int row=-1, QString tag="") |
RealDataItem * | insertSpecularDataItem () |
SessionItem * | itemForIndex (const QModelIndex &index) const |
QMimeData * | mimeData (const QModelIndexList &indices) const override |
QStringList | mimeTypes () const override |
SessionItem * | moveItem (SessionItem *item, SessionItem *new_parent=nullptr, int row=-1, const QString &tag="") |
Move given parameterized item to the new_parent at given row. If new_parent is not defined, use root_item as a new parent. More... | |
QVector< SessionItem * > | nonXMLItems () const override |
QModelIndex | parent (const QModelIndex &child) const override |
void | readFrom (QXmlStreamReader *reader, MessageService *messageService=nullptr) override |
QVector< RealDataItem * > | realDataItems () const |
QVector< RealDataItem * > | realDataItems (int rank) const |
QVector< RealDataItem * > | realDataItems1D () const |
QVector< RealDataItem * > | realDataItems2D () const |
QStringList | realDataNames () const |
void | remove (RealDataItem *item) |
void | removeItem (SessionItem *item) |
bool | removeRows (int row, int count, const QModelIndex &parent) override |
SessionItem * | rootItem () const |
int | rowCount (const QModelIndex &parent) const override |
bool | setData (const QModelIndex &index, const QVariant &value, int role) override |
void | setDraggedItemType (const QString &type) |
Qt::DropActions | supportedDragActions () const override |
Qt::DropActions | supportedDropActions () const override |
template<typename T = SessionItem> | |
T * | topItem () const |
Returns first item in list of topItems. More... | |
template<typename T = SessionItem> | |
QVector< T * > | topItems () const |
template<typename T = SessionItem> | |
QVector< T * > | topItems (std::function< bool(const T &)> accept) const |
virtual void | writeTo (QXmlStreamWriter *writer) |
Protected Member Functions | |
void | setRootItem (SessionItem *root) |
Private Member Functions | |
SessionItem * | itemForIndex (const QModelIndex &index) const |
void | onRowsChange (const QModelIndex &parent, int, int) |
void | removeItem (SessionItem *item) |
bool | removeRows (int row, int count, const QModelIndex &parent) override |
Private Attributes | |
QString | m_dragged_item_type |
QString | m_model_tag |
SessionItem * | m_root_item |
|
explicit |
Definition at line 20 of file RealDataModel.cpp.
References onRowsChange(), and GUI::Session::XML::RealDataModelTag().
|
inherited |
Definition at line 310 of file SessionModel.cpp.
References SessionModel::itemForIndex(), and SessionModel::parent().
Referenced by SessionModel::canDropMimeData(), and SessionModel::flags().
|
overrideinherited |
Definition at line 213 of file SessionModel.cpp.
References SessionModel::acceptableDefaultItemTypes(), SessionModel::data(), GUI::Session::XML::ItemMimeType, GUI::Session::XML::ItemTag(), GUI::Session::XML::ModelTypeAttribute(), and SessionModel::parent().
Referenced by SessionModel::dropMimeData().
|
virtualinherited |
Reimplemented in JobModel, and MaskItems.
Definition at line 319 of file SessionModel.cpp.
References SessionModel::createRootItem(), and SessionModel::m_root_item.
Referenced by MaskItems::clear(), JobModel::clear(), ApplicationModels::readFrom(), and SessionModel::readFrom().
|
overrideinherited |
Definition at line 134 of file SessionModel.cpp.
References SessionFlags::MAX_COLUMNS, and SessionModel::parent().
Referenced by SessionModel::data(), and SessionModel::index().
|
inherited |
Copy given item to the new_parent at given row. Item intended for copying can belong to another model and it will remain intact. Returns pointer to the new child.
Definition at line 395 of file SessionModel.cpp.
References SessionItem::defaultTag(), SessionItem::getItems(), SessionModel::m_root_item, GUI::Session::XML::readItems(), and GUI::Session::XML::writeItemAndChildItems().
Referenced by SessionModel::copyItem().
|
inherited |
Definition at line 149 of file SessionModel.h.
References SessionModel::copy().
Referenced by MaskItems::copy(), and JobItem::copyRealDataIntoJob().
|
inherited |
Definition at line 56 of file SessionModel.cpp.
References SessionModel::m_root_item, SessionItem::registerTag(), SessionModel::SessionItem, and SessionItem::setModel().
Referenced by SessionModel::SessionModel(), and SessionModel::clear().
|
overrideinherited |
Definition at line 88 of file SessionModel.cpp.
References SessionModel::columnCount(), SessionModel::index(), SessionFlags::ITEM_NAME, SessionFlags::ITEM_VALUE, SessionModel::itemForIndex(), SessionItem::itemName(), SessionModel::m_root_item, and SessionItem::value().
Referenced by SessionModel::canDropMimeData(), and SessionModel::dropMimeData().
|
overrideinherited |
Definition at line 241 of file SessionModel.cpp.
References SessionModel::canDropMimeData(), SessionModel::data(), SessionModel::itemForIndex(), GUI::Session::XML::ItemMimeType, SessionItem::numberOfChildren(), and SessionModel::parent().
|
overrideinherited |
Definition at line 71 of file SessionModel.cpp.
References SessionModel::acceptableDefaultItemTypes(), SessionModel::index(), SessionItem::isEditable(), SessionItem::isEnabled(), SessionFlags::ITEM_VALUE, SessionModel::itemForIndex(), SessionModel::m_dragged_item_type, and SessionItem::value().
|
inlineinherited |
Definition at line 202 of file SessionModel.h.
References SessionModel::m_model_tag.
Referenced by ApplicationModels::readFrom(), GUI::Session::XML::readItems(), and GUI::Session::XML::writeModel().
|
overrideinherited |
Definition at line 112 of file SessionModel.cpp.
References SessionFlags::ITEM_NAME, and SessionFlags::ITEM_VALUE.
|
overrideinherited |
Definition at line 141 of file SessionModel.cpp.
References SessionItem::childAt(), SessionModel::columnCount(), SessionModel::itemForIndex(), SessionModel::m_root_item, and SessionModel::parent().
Referenced by MaskResultsPresenter::createMaskPresentation(), SessionModel::data(), MaskGraphicsScene::deleteViews(), SessionModel::flags(), MaskItems::insertMask(), GUI::Model::Path::isValidItem(), SessionModel::itemForIndex(), ModelMapper::onBeginRemoveRows(), ModelMapper::onRowRemoved(), MaskGraphicsScene::onRowsAboutToBeRemoved(), ItemStackWidget::onRowsAboutToBeRemoved(), ModelMapper::onRowsInserted(), SessionModel::removeItem(), SessionModel::setData(), MaskGraphicsScene::setItemName(), MaskGraphicsScene::setZValues(), SessionModel::topItems(), and MaskGraphicsScene::updateViews().
|
inherited |
Definition at line 265 of file SessionModel.cpp.
References SessionModel::m_root_item, SessionItem::parentItem(), and SessionItem::rowOfChild().
Referenced by MaskGraphicsScene::cancelCurrentDrawing(), MaskEditorActions::changeMaskStackingOrder(), SessionItem::emitDataChanged(), SessionItem::index(), MaskGraphicsScene::onSceneSelectionChanged(), MaskGraphicsScene::onSessionSelectionChanged(), MaskGraphicsScene::processLineItem(), MaskGraphicsScene::processPolygonItem(), and SessionModel::removeItem().
|
virtualinherited |
Definition at line 413 of file SessionModel.cpp.
References SessionModel::readFrom(), and SessionModel::writeTo().
RealDataItem * RealDataModel::insertDataItem | ( | int | rank | ) |
Definition at line 71 of file RealDataModel.cpp.
References insertIntensityDataItem(), and insertSpecularDataItem().
Referenced by RealDataTreeModel::insertDataItem().
RealDataItem * RealDataModel::insertIntensityDataItem | ( | ) |
Definition at line 64 of file RealDataModel.cpp.
Referenced by insertDataItem().
|
inherited |
Definition at line 143 of file SessionModel.h.
References SessionModel::itemForIndex(), and SessionModel::parent().
|
inherited |
Definition at line 137 of file SessionModel.h.
References SessionModel::insertNewItem(), SessionItem::modelType(), and SessionModel::parent().
Referenced by IntensityDataFFTPresenter::IntensityDataFFTPresenter(), FitParameterItem::addLink(), JobItem::createDataViewItem(), FitComparison1DViewController::createDiffViewItem(), FitParameterContainerItem::createFitParameter(), FitSuiteItem::createFitParametersContainer(), JobItem::createFitSuiteItem(), FitSuiteItem::createMinimizerContainer(), Data1DViewItem::createPropertyContainerItem(), JobItem::createRealDataItem(), IntensityDataItem::getOrCreateMaskContainerItem(), IntensityDataItem::getOrCreateProjectionContainerItem(), RealDataItem::initDataItem(), ProjectionsEditorCanvas::onEnteringColorMap(), MaskGraphicsScene::processHorizontalLineItem(), MaskGraphicsScene::processMaskAllItem(), MaskGraphicsScene::processPolygonItem(), MaskGraphicsScene::processVerticalLineItem(), and JobItem::setDataType().
|
inherited |
Definition at line 297 of file SessionModel.cpp.
References SessionModel::insertNewItem(), and SessionModel::itemForIndex().
|
inherited |
Definition at line 274 of file SessionModel.cpp.
References GUI::Model::ItemFactory::CreateItem(), SessionItem::defaultTag(), SessionItem::insertChild(), SessionItemTags::isValid(), SessionModel::m_root_item, SessionItem::numberOfChildren(), and SessionItem::sessionItemTags().
Referenced by SessionModel::insertItem(), SessionModel::insertNewItem(), and MaskGraphicsScene::processRectangleShapeItem().
RealDataItem * RealDataModel::insertSpecularDataItem | ( | ) |
Definition at line 57 of file RealDataModel.cpp.
Referenced by insertDataItem().
|
private |
Definition at line 100 of file SessionModel.cpp.
|
inherited |
Definition at line 327 of file SessionModel.cpp.
References SessionModel::index(), and SessionModel::m_root_item.
Referenced by SessionModel::acceptableDefaultItemTypes(), MaskEditorActions::changeMaskStackingOrder(), MaskResultsPresenter::createMaskPresentation(), SessionModel::data(), DataProperties::dataItem(), MaskGraphicsScene::deleteViews(), SessionModel::dropMimeData(), SessionModel::flags(), SessionModel::index(), SessionModel::insertItem(), SessionModel::insertNewItem(), MaskEditorActions::isSendToBackPossible(), GUI::Model::Path::isValidItem(), MaskEditorPropertyPanel::maskItemForIndex(), SessionModel::mimeData(), ModelMapper::onBeginRemoveRows(), ModelMapper::onDataChanged(), ModelMapper::onRowRemoved(), ItemStackWidget::onRowsAboutToBeRemoved(), ModelMapper::onRowsInserted(), FitParameterModel::onSourceDataChanged(), MaskEditorActions::onToggleMaskValueAction(), SessionModel::parent(), SessionModel::removeRows(), SessionModel::rowCount(), SessionModel::setData(), MaskGraphicsScene::setItemName(), MaskEditor::setMaskContext(), MaskGraphicsScene::setMaskContext(), MaskGraphicsScene::setZValues(), SessionDecorationModel::textColor(), SessionModel::topItems(), MaskGraphicsScene::updateScene(), and MaskGraphicsScene::updateViews().
|
overrideinherited |
Definition at line 197 of file SessionModel.cpp.
References SessionModel::itemForIndex(), GUI::Session::XML::ItemMimeType, and GUI::Session::XML::writeItemAndChildItems().
|
overrideinherited |
Definition at line 192 of file SessionModel.cpp.
References GUI::Session::XML::ItemMimeType.
|
inherited |
Move given parameterized item to the new_parent at given row. If new_parent is not defined, use root_item as a new parent.
Definition at line 360 of file SessionModel.cpp.
References SessionItem::defaultTag(), SessionItem::getItems(), SessionItem::insertChild(), SessionItemTags::isValid(), SessionModel::m_root_item, SessionItemTags::maximumReached(), SessionItem::modelType(), SessionItem::parentItem(), SessionItem::rowOfChild(), SessionItem::sessionItemTags(), SessionItem::takeItem(), and SessionItem::takeRow().
Referenced by MaskEditorActions::changeMaskStackingOrder().
|
overridevirtual |
Reimplemented from SessionModel.
Definition at line 29 of file RealDataModel.cpp.
Referenced by ApplicationModels::nonXMLItems().
|
private |
Definition at line 110 of file RealDataModel.cpp.
References SessionModel::parent(), and realDataAddedOrRemoved().
Referenced by RealDataModel(), and readFrom().
|
overrideinherited |
Definition at line 155 of file SessionModel.cpp.
References SessionModel::itemForIndex(), SessionModel::m_root_item, and SessionItem::parentItem().
Referenced by SessionModel::acceptableDefaultItemTypes(), SessionModel::canDropMimeData(), SessionModel::columnCount(), SessionModel::dropMimeData(), SessionModel::index(), SessionModel::insertItem(), onRowsChange(), SessionModel::removeRows(), and SessionModel::rowCount().
|
overridevirtual |
Reimplemented from SessionModel.
Definition at line 43 of file RealDataModel.cpp.
References onRowsChange(), SessionModel::readFrom(), realDataAddedOrRemoved(), and realDataItems().
Referenced by ApplicationModels::readFrom().
|
signal |
Referenced by onRowsChange(), and readFrom().
QVector< RealDataItem * > RealDataModel::realDataItems | ( | ) | const |
Definition at line 76 of file RealDataModel.cpp.
Referenced by RealDataTreeModel::insertDataItem(), LinkInstrumentManager::onInstrumentAddedOrRemoved(), LinkInstrumentManager::onInstrumentChanged(), readFrom(), SimulationView::realDataItems(), realDataNames(), RealDataTreeModel::refreshAfterModelChange(), and RealDataTreeModel::setVisibleRanks().
QVector< RealDataItem * > RealDataModel::realDataItems | ( | int | rank | ) | const |
Definition at line 82 of file RealDataModel.cpp.
References realDataItems1D(), and realDataItems2D().
QVector< RealDataItem * > RealDataModel::realDataItems1D | ( | ) | const |
Definition at line 87 of file RealDataModel.cpp.
References RealDataItem::isSpecularData().
Referenced by realDataItems().
QVector< RealDataItem * > RealDataModel::realDataItems2D | ( | ) | const |
Definition at line 92 of file RealDataModel.cpp.
References RealDataItem::isSpecularData().
Referenced by realDataItems().
QStringList RealDataModel::realDataNames | ( | ) | const |
Definition at line 102 of file RealDataModel.cpp.
References realDataItems().
Referenced by SimulationView::writeOptionsToUI().
void RealDataModel::remove | ( | RealDataItem * | item | ) |
Definition at line 97 of file RealDataModel.cpp.
References removeItem().
Referenced by RealDataTreeModel::removeItem().
|
private |
Definition at line 88 of file SessionModel.cpp.
Referenced by remove().
|
inherited |
Definition at line 303 of file SessionModel.cpp.
References SessionModel::index(), SessionModel::indexOfItem(), and SessionModel::removeRows().
|
overrideprivate |
Definition at line 61 of file SessionModel.cpp.
|
overrideinherited |
Definition at line 183 of file SessionModel.cpp.
References SessionModel::itemForIndex(), SessionModel::m_root_item, SessionModel::parent(), and SessionItem::takeRow().
Referenced by MaskGraphicsScene::cancelCurrentDrawing(), MaskContainerItem::clear(), ProjectionsEditorActions::onDeleteAction(), MaskEditorActions::onDeleteMaskAction(), SessionModel::removeItem(), and JobModel::removeJob().
|
inherited |
Definition at line 430 of file SessionModel.cpp.
References SessionModel::m_root_item.
Referenced by ModelMapper::nestlingDepth().
|
overrideinherited |
Definition at line 126 of file SessionModel.cpp.
References SessionModel::itemForIndex(), SessionItem::numberOfChildren(), and SessionModel::parent().
Referenced by MaskResultsPresenter::createMaskPresentation(), MaskGraphicsScene::deleteViews(), GUI::Model::Path::isValidItem(), MaskGraphicsScene::setItemName(), MaskGraphicsScene::setZValues(), SessionModel::topItems(), and MaskGraphicsScene::updateViews().
|
overrideinherited |
Definition at line 170 of file SessionModel.cpp.
References SessionModel::index(), SessionModel::itemForIndex(), and SessionItem::setRoleProperty().
|
inlineinherited |
Definition at line 207 of file SessionModel.h.
References SessionModel::m_dragged_item_type.
|
inlineprotectedinherited |
|
inlineoverrideinherited |
Definition at line 192 of file SessionModel.h.
|
inlineoverrideinherited |
Definition at line 197 of file SessionModel.h.
|
inherited |
Returns first item in list of topItems.
Definition at line 155 of file SessionModel.h.
References SessionItem::items().
|
inherited |
Definition at line 162 of file SessionModel.h.
References SessionModel::index(), SessionItem::item(), SessionModel::itemForIndex(), and SessionModel::rowCount().
|
inherited |
Definition at line 177 of file SessionModel.h.
References SessionModel::index(), SessionItem::item(), SessionModel::itemForIndex(), and SessionModel::rowCount().
|
virtualinherited |
Definition at line 352 of file SessionModel.cpp.
References SessionModel::m_root_item, and GUI::Session::XML::writeModel().
Referenced by SessionModel::initFrom(), and ApplicationModels::writeTo().
|
privateinherited |
Definition at line 132 of file SessionModel.h.
Referenced by SessionModel::flags(), and SessionModel::setDraggedItemType().
|
privateinherited |
Definition at line 133 of file SessionModel.h.
Referenced by SessionModel::getModelTag(), and SessionModel::readFrom().
|
privateinherited |
Definition at line 131 of file SessionModel.h.
Referenced by SessionModel::~SessionModel(), SessionModel::clear(), SessionModel::copy(), SessionModel::createRootItem(), SessionModel::data(), SessionModel::index(), SessionModel::indexOfItem(), SessionModel::insertNewItem(), SessionModel::itemForIndex(), SessionModel::moveItem(), SessionModel::parent(), SessionModel::readFrom(), SessionModel::removeRows(), SessionModel::rootItem(), SessionModel::setRootItem(), and SessionModel::writeTo().