BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
The DocumentModel class is a model with GUI settings related to the opened project. More...
Signals | |
void | modelLoaded () |
Public Member Functions | |
DocumentModel (QObject *parent=nullptr) | |
QVector< QString > | acceptableDefaultItemTypes (const QModelIndex &parent) const |
virtual bool | canDropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const |
virtual void | clear () |
virtual int | columnCount (const QModelIndex &parent) const |
template<typename T > | |
T * | copyItem (const T *item_to_copy, SessionItem *new_parent=0, const QString &tag="") |
virtual SessionModel * | createCopy (SessionItem *parent=0) |
void | createRootItem () |
virtual QVariant | data (const QModelIndex &index, int role) const |
virtual bool | dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) |
virtual Qt::ItemFlags | flags (const QModelIndex &index) const |
QString | getModelName () const |
QString | getModelTag () const |
virtual QVariant | headerData (int section, Qt::Orientation orientation, int role) const |
virtual QModelIndex | index (int row, int column, const QModelIndex &parent) const |
QModelIndex | indexOfItem (SessionItem *item) const |
virtual void | initFrom (SessionModel *model, SessionItem *parent) |
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="") |
SessionItem * | itemForIndex (const QModelIndex &index) const |
void | load (const QString &filename="") |
virtual QMimeData * | mimeData (const QModelIndexList &indexes) const |
virtual QStringList | mimeTypes () const |
SessionItem * | moveItem (SessionItem *item, SessionItem *new_parent=0, int row=-1, const QString &tag="") |
Move given parameterized item to the new_parent at given row. More... | |
virtual QVector< SessionItem * > | nonXMLItems () const |
virtual QModelIndex | parent (const QModelIndex &child) const |
virtual void | readFrom (QXmlStreamReader *reader, MessageService *messageService=0) |
void | removeItem (SessionItem *item) |
virtual bool | removeRows (int row, int count, const QModelIndex &parent) |
SessionItem * | rootItem () const |
virtual int | rowCount (const QModelIndex &parent) const |
void | save (const QString &filename="") |
virtual bool | setData (const QModelIndex &index, const QVariant &value, int role) |
void | setDraggedItemType (const QString &type) |
virtual bool | setHeaderData (int, Qt::Orientation, const QVariant &, int=Qt::EditRole) |
SimulationOptionsItem * | simulationOptionsItem () |
virtual Qt::DropActions | supportedDragActions () const |
virtual Qt::DropActions | supportedDropActions () const |
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, SessionItem *parent=0) |
Protected Member Functions | |
void | setRootItem (SessionItem *root) |
Private Member Functions | |
SessionItem * | copy (const SessionItem *item_to_copy, SessionItem *new_parent=0, const QString &tag="") |
Copy given item to the new_parent at given row. More... | |
Private Attributes | |
QString | m_dragged_item_type |
QString | m_model_tag |
model tag (SampleModel, InstrumentModel) More... | |
QString | m_name |
model name More... | |
SessionItem * | m_root_item |
The DocumentModel class is a model with GUI settings related to the opened project.
Can be the place to store splitter position, etc.
Definition at line 25 of file DocumentModel.h.
|
explicit |
Definition at line 18 of file DocumentModel.cpp.
References SessionXML::DocumentModelTag().
|
inherited |
Definition at line 299 of file SessionModel.cpp.
References SessionModel::itemForIndex(), and SessionModel::parent().
Referenced by SessionModel::canDropMimeData(), SessionModel::flags(), and SampleTreeWidget::showContextMenu().
|
virtualinherited |
Definition at line 199 of file SessionModel.cpp.
References SessionModel::acceptableDefaultItemTypes(), SessionModel::data(), SessionXML::ItemMimeType, SessionXML::ItemTag(), SessionXML::ModelTypeAttribute(), and SessionModel::parent().
Referenced by SessionModel::dropMimeData().
|
virtualinherited |
Reimplemented in JobModel.
Definition at line 308 of file SessionModel.cpp.
References SessionModel::createRootItem(), and SessionModel::m_root_item.
Referenced by JobModel::clear(), DetectorMaskDelegate::createIntensityDataItem(), SessionModel::load(), MaterialEditorDialog::onOKButton(), SessionModel::readFrom(), and ApplicationModels::resetModels().
|
virtualinherited |
Definition at line 119 of file SessionModel.cpp.
References SessionFlags::MAX_COLUMNS, and SessionModel::parent().
Referenced by SessionModel::data(), and SessionModel::index().
|
privateinherited |
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 419 of file SessionModel.cpp.
References SessionItem::defaultTag(), SessionItem::getItems(), SessionModel::m_root_item, SessionXML::readItems(), and SessionXML::writeItemAndChildItems().
Referenced by SessionModel::copyItem().
|
inherited |
Definition at line 136 of file SessionModel.h.
References SessionModel::copy().
Referenced by JobModel::addJob(), MaterialModel::cloneMaterial(), JobModelFunctions::copyRealDataItem(), DetectorItem::importMasks(), MaterialItemContainer::insertCopy(), InstrumentViewActions::onCloneInstrument(), JobModelFunctions::setupJobItemInstrument(), and JobModelFunctions::setupJobItemSampleData().
|
virtualinherited |
Reimplemented in InstrumentModel, SampleModel, and MaterialModel.
Definition at line 437 of file SessionModel.cpp.
References SessionModel::parent().
|
inherited |
Definition at line 36 of file SessionModel.cpp.
References ItemFactory::CreateEmptyItem(), SessionModel::m_root_item, SessionItem::registerTag(), SessionItem::setDefaultTag(), and SessionItem::setModel().
Referenced by SessionModel::SessionModel(), and SessionModel::clear().
|
virtualinherited |
Definition at line 70 of file SessionModel.cpp.
References SessionModel::columnCount(), SessionModel::index(), SessionFlags::ITEM_NAME, SessionFlags::ITEM_VALUE, SessionModel::itemForIndex(), SessionModel::m_root_item, and SessionItemUtils::ToolTipRole().
Referenced by SessionModel::canDropMimeData(), RealDataTreeModel::data(), SessionModel::dropMimeData(), gui2::JobModel::updateSLDProfile(), and gui2::JobModel::updateSpecularData().
|
virtualinherited |
Definition at line 227 of file SessionModel.cpp.
References SessionModel::canDropMimeData(), SessionModel::data(), SessionModel::itemForIndex(), SessionXML::ItemMimeType, and SessionModel::parent().
|
virtualinherited |
Definition at line 51 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().
Referenced by RealDataTreeModel::flags().
|
inlineinherited |
Definition at line 196 of file SessionModel.h.
References SessionModel::m_name.
Referenced by SessionXML::writeTo().
|
inlineinherited |
Definition at line 191 of file SessionModel.h.
References SessionModel::m_model_tag.
Referenced by ModelTreeView::ModelTreeView(), SessionXML::readItems(), and SessionXML::writeTo().
|
virtualinherited |
Definition at line 98 of file SessionModel.cpp.
References SessionFlags::ITEM_NAME, and SessionFlags::ITEM_VALUE.
|
virtualinherited |
Definition at line 126 of file SessionModel.cpp.
References SessionItem::childAt(), SessionModel::columnCount(), SessionModel::itemForIndex(), SessionModel::m_root_item, and SessionModel::parent().
Referenced by SampleViewAligner::alignSample(), JobModel::cancelJob(), MaterialModel::cloneMaterial(), MaskResultsPresenter::createMaskPresentation(), SessionModel::data(), MaskGraphicsScene::deleteViews(), DesignerScene::deleteViews(), SessionModel::flags(), JobModel::generateJobName(), SampleTreeWidget::getIndexAtColumnZero(), JobModel::getJobItemForIdentifier(), JobModel::getJobItemForIndex(), MaterialEditor::init_views(), ModelPath::isValidItem(), SessionModel::itemForIndex(), MaterialModel::materialFromIndex(), ModelMapper::onBeginRemoveRows(), MaterialPropertyController::onMaterialRowsAboutToBeRemoved(), ModelMapper::onRowRemoved(), MaskGraphicsScene::onRowsAboutToBeRemoved(), RealSpaceCanvas::onRowsAboutToBeRemoved(), DesignerScene::onRowsAboutToBeRemoved(), ItemStackWidget::onRowsAboutToBeRemoved(), ModelMapper::onRowsInserted(), SessionModel::removeItem(), JobModel::removeJob(), JobModel::runJob(), ItemSelectorWidget::selectLast(), SessionModel::setData(), MaskGraphicsScene::setItemName(), MaskGraphicsScene::setZValues(), ItemSelectorWidget::showEvent(), SessionModel::topItems(), JobQueueData::updateGlobalProgress(), InstrumentViewActions::updateSelection(), SampleViewAligner::updateViews(), MaskGraphicsScene::updateViews(), and DesignerScene::updateViews().
|
inherited |
Definition at line 251 of file SessionModel.cpp.
References SessionModel::m_root_item, SessionItem::parent(), and SessionItem::rowOfChild().
Referenced by SampleTreeWidget::addItem(), SampleViewAligner::alignSample(), MaskGraphicsScene::cancelCurrentDrawing(), MaskEditorActions::changeMaskStackingOrder(), RealDataTreeModel::data(), SessionItem::emitDataChanged(), RealDataTreeModel::flags(), SessionItem::index(), DetectorMaskDelegate::initMaskEditorContext(), MaskGraphicsScene::onSceneSelectionChanged(), DesignerScene::onSceneSelectionChanged(), MaskGraphicsScene::onSessionSelectionChanged(), DesignerScene::onSessionSelectionChanged(), MaskGraphicsScene::processLineItem(), MaskGraphicsScene::processPolygonItem(), SessionModel::removeItem(), and MaterialEditor::setInitialMaterialProperty().
|
virtualinherited |
Definition at line 443 of file SessionModel.cpp.
References SessionModel::modelLoaded(), SessionModel::readFrom(), and SessionModel::writeTo().
Referenced by MaterialModel::createCopy(), SampleModel::createCopy(), InstrumentModel::createCopy(), and MaterialEditorDialog::onOKButton().
|
inherited |
Definition at line 130 of file SessionModel.h.
References SessionModel::itemForIndex(), and SessionModel::parent().
|
inherited |
Definition at line 125 of file SessionModel.h.
References SessionModel::insertNewItem(), SessionItem::modelType(), and SessionModel::parent().
Referenced by IntensityDataFFTPresenter::IntensityDataFFTPresenter(), FitComparison1DViewController::createDiffViewItem(), FitParameterHelper::createFitParameter(), DetectorMaskDelegate::createIntensityDataItem(), DetectorItem::createMaskContainer(), ParameterTreeUtils::createParameterTree(), DesignerScene::dropEvent(), TestComponentView::init_source(), InstrumentViewActions::initAddInstrumentMenu(), RealDataItem::initDataItem(), JobModelFunctions::initDataView(), TestComponentView::onAddItemRequest(), ProjectionsEditorCanvas::onEnteringColorMap(), ParameterTreeUtils::parameterDictionary(), ParameterTreeUtils::parameterNameToLinkedItem(), GUIObjectBuilder::populateDocumentModel(), ParameterTreeUtils::populateParameterContainer(), MaskGraphicsScene::processHorizontalLineItem(), MaskGraphicsScene::processMaskAllItem(), MaskGraphicsScene::processPolygonItem(), MaskGraphicsScene::processVerticalLineItem(), ApplicationModels::resetModels(), JobModelFunctions::setupJobItemOutput(), JobModelFunctions::setupJobItemSampleData(), TestView::test_MinimizerSettings(), TestView::test_specular_data_widget(), and GUIDomainSampleVisitor::visit().
|
inherited |
Definition at line 286 of file SessionModel.cpp.
References SessionModel::insertNewItem(), and SessionModel::itemForIndex().
|
inherited |
Definition at line 260 of file SessionModel.cpp.
References ItemFactory::CreateItem(), SessionItem::defaultTag(), SessionItem::insertItem(), SessionItemTags::isValid(), SessionModel::m_root_item, SessionItem::numberOfChildren(), and SessionItem::sessionItemTags().
Referenced by SampleTreeWidget::addItem(), FitParameterHelper::addToFitParameter(), DesignerScene::dropEvent(), MultiLayerView::dropEvent(), GUIDomainSampleVisitor::InsertIParticle(), SessionModel::insertItem(), SessionModel::insertNewItem(), RealDataMaskWidget::maskContainer(), InstrumentViewActions::onCloneInstrument(), MaskGraphicsScene::processRectangleShapeItem(), and IntensityDataProjectionsWidget::projectionContainer().
|
inherited |
Definition at line 347 of file SessionModel.cpp.
References SessionModel::index(), and SessionModel::m_root_item.
Referenced by SessionModel::acceptableDefaultItemTypes(), MaskEditorActions::changeMaskStackingOrder(), SessionDecorationModel::createIcon(), MaskResultsPresenter::createMaskPresentation(), SessionModel::data(), DataProperties::dataItem(), DesignerScene::deleteSelectedItems(), MaskGraphicsScene::deleteViews(), DesignerScene::deleteViews(), SessionModel::dropMimeData(), SessionModel::flags(), JobModel::generateJobName(), ModelPath::getItemFromPath(), JobModel::getJobItemForIndex(), ParameterTuningModel::getParameterItem(), SampleViewAligner::getViewForIndex(), SessionModel::index(), SessionModel::insertItem(), SessionModel::insertNewItem(), MaskEditorActions::isSendToBackPossible(), ModelPath::isValidItem(), ParameterItem::linkedItem(), MaterialModel::materialFromIndex(), SessionModel::mimeData(), ModelMapper::onBeginRemoveRows(), InstrumentViewActions::onCloneInstrument(), PySampleWidget::onDataChanged(), RealSpaceCanvas::onDataChanged(), ComponentFlatView::onDataChanged(), ModelMapper::onDataChanged(), MaterialPropertyController::onMaterialDataChanged(), MaterialPropertyController::onMaterialRowsAboutToBeRemoved(), ModelMapper::onRowRemoved(), ItemStackWidget::onRowsAboutToBeRemoved(), ModelMapper::onRowsInserted(), ItemSelectorWidget::onSelectionChanged(), MaskEditorPropertyPanel::onSelectionChanged(), MaterialEditor::onSelectionChanged(), TestComponentView::onSelectionChanged(), FitParameterProxyModel::onSourceDataChanged(), MaskEditorActions::onToggleMaskValueAction(), SessionModel::parent(), ComponentProxyStrategy::processSourceIndex(), MaterialPropertyController::relatedSampleItems(), SessionModel::removeRows(), SessionModel::rowCount(), SessionModel::setData(), MaskGraphicsScene::setItemName(), MaskEditor::setMaskContext(), MaskGraphicsScene::setMaskContext(), MaskEditorPropertyPanel::setPanelHidden(), MaskGraphicsScene::setZValues(), ComponentProxyModel::sourceDataChanged(), SessionDecorationModel::textColor(), SessionModel::topItems(), MaskGraphicsScene::updateScene(), RealSpaceCanvas::updateScene(), MaskGraphicsScene::updateViews(), and DesignerScene::updateViews().
|
inherited |
Definition at line 316 of file SessionModel.cpp.
References SessionModel::clear(), ItemFactory::CreateEmptyItem(), FileSystemUtils::filename(), SessionModel::m_root_item, and SessionXML::readItems().
|
virtualinherited |
Definition at line 183 of file SessionModel.cpp.
References SessionModel::itemForIndex(), SessionXML::ItemMimeType, and SessionXML::writeItemAndChildItems().
|
virtualinherited |
Definition at line 178 of file SessionModel.cpp.
References SessionXML::ItemMimeType.
|
signalinherited |
Referenced by SessionModel::initFrom(), and MaterialPropertyController::setModels().
|
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 384 of file SessionModel.cpp.
References SessionItem::defaultTag(), SessionItem::getItems(), SessionItem::insertItem(), SessionItemTags::isValid(), SessionModel::m_root_item, SessionItemTags::maximumReached(), SessionItem::modelType(), SessionItem::parent(), SessionItem::rowOfChild(), SessionItem::sessionItemTags(), SessionItem::takeItem(), and SessionItem::takeRow().
Referenced by MaskEditorActions::changeMaskStackingOrder(), ILayerView::mouseReleaseEvent(), DesignerScene::onEstablishedConnection(), and DesignerScene::removeConnection().
|
virtualinherited |
Reimplemented in RealDataModel, JobModel, and InstrumentModel.
Definition at line 466 of file SessionModel.cpp.
|
virtualinherited |
Definition at line 139 of file SessionModel.cpp.
References SessionModel::itemForIndex(), SessionModel::m_root_item, SessionItem::parent(), and SessionItemUtils::ParentRow().
Referenced by SessionModel::acceptableDefaultItemTypes(), SessionModel::canDropMimeData(), SessionModel::columnCount(), SessionModel::createCopy(), MaterialModel::createCopy(), SampleModel::createCopy(), InstrumentModel::createCopy(), SampleTreeWidget::deleteItem(), SessionModel::dropMimeData(), SampleTreeWidget::getIndexAtColumnZero(), SessionModel::index(), SessionModel::insertItem(), InstrumentModel::onRowsChange(), RealDataModel::onRowsChange(), SessionModel::removeRows(), SessionModel::rowCount(), and SessionModel::writeTo().
|
virtualinherited |
Reimplemented in RealDataModel, JobModel, and InstrumentModel.
Definition at line 356 of file SessionModel.cpp.
References ASSERT, SessionModel::clear(), SessionModel::m_model_tag, SessionModel::m_name, SessionModel::m_root_item, SessionXML::ModelNameAttribute(), and SessionXML::readItems().
Referenced by SessionModel::initFrom(), InstrumentModel::readFrom(), JobModel::readFrom(), and RealDataModel::readFrom().
|
inherited |
Definition at line 292 of file SessionModel.cpp.
References SessionModel::index(), SessionModel::indexOfItem(), and SessionModel::removeRows().
Referenced by RealDataTreeModel::removeItem().
|
virtualinherited |
Definition at line 168 of file SessionModel.cpp.
References SessionModel::itemForIndex(), SessionModel::m_root_item, SessionModel::parent(), and SessionItem::takeRow().
Referenced by MaskGraphicsScene::cancelCurrentDrawing(), SampleTreeWidget::deleteItem(), DesignerScene::deleteSelectedItems(), ProjectionsEditorActions::onDeleteAction(), MaskEditorActions::onDeleteMaskAction(), InstrumentViewActions::onRemoveInstrument(), MaterialEditorToolBar::onRemoveMaterialAction(), SessionModel::removeItem(), and JobModel::removeJob().
|
inherited |
Definition at line 461 of file SessionModel.cpp.
References SessionModel::m_root_item.
Referenced by ModelPath::getIndexFromPath(), and ModelMapper::nestlingDepth().
|
virtualinherited |
Definition at line 111 of file SessionModel.cpp.
References SessionModel::itemForIndex(), SessionItem::numberOfChildren(), and SessionModel::parent().
Referenced by SampleViewAligner::alignSample(), MaskResultsPresenter::createMaskPresentation(), MaskGraphicsScene::deleteViews(), DesignerScene::deleteViews(), JobModel::generateJobName(), JobModel::getJobItemForIdentifier(), ModelPath::isValidItem(), ItemSelectorWidget::selectLast(), MaskGraphicsScene::setItemName(), MaskGraphicsScene::setZValues(), ItemSelectorWidget::showEvent(), SessionModel::topItems(), JobQueueData::updateGlobalProgress(), InstrumentViewActions::updateSelection(), SampleViewAligner::updateViews(), MaskGraphicsScene::updateViews(), and DesignerScene::updateViews().
|
inherited |
Definition at line 331 of file SessionModel.cpp.
References FileSystemUtils::filename(), GUIHelpers::getBornAgainVersionString(), SessionModel::m_root_item, and SessionXML::writeItemAndChildItems().
|
virtualinherited |
Definition at line 155 of file SessionModel.cpp.
References SessionModel::index(), and SessionModel::itemForIndex().
|
inlineinherited |
Definition at line 201 of file SessionModel.h.
References SessionModel::m_dragged_item_type.
Referenced by ItemTreeView::dragMoveEvent().
|
inlinevirtualinherited |
Definition at line 176 of file SessionModel.h.
|
inlineprotectedinherited |
SimulationOptionsItem * DocumentModel::simulationOptionsItem | ( | ) |
Definition at line 23 of file DocumentModel.cpp.
Referenced by SimulationSetupWidget::onExportToPythonScript(), SimulationSetupWidget::onRunSimulation(), and SimulationSetupWidget::updateViewElements().
|
inlinevirtualinherited |
Definition at line 181 of file SessionModel.h.
|
inlinevirtualinherited |
Definition at line 186 of file SessionModel.h.
|
inherited |
Returns first item in list of topItems.
Definition at line 141 of file SessionModel.h.
|
inherited |
Definition at line 147 of file SessionModel.h.
References SessionModel::index(), SessionItem::item(), SessionModel::itemForIndex(), and SessionModel::rowCount().
Referenced by JobModel::clear(), MaterialItemUtils::defaultMaterialProperty(), PySampleWidget::generateCodeSnippet(), SimulationDataSelectorWidget::selectedInstrumentItem(), SimulationDataSelectorWidget::selectedMultiLayerItem(), and ModelUtils::topItemNames().
|
inherited |
Definition at line 161 of file SessionModel.h.
References SessionModel::index(), SessionItem::item(), SessionModel::itemForIndex(), and SessionModel::rowCount().
|
virtualinherited |
Definition at line 374 of file SessionModel.cpp.
References SessionModel::m_root_item, SessionModel::parent(), and SessionXML::writeTo().
Referenced by SessionModel::initFrom().
|
privateinherited |
Definition at line 120 of file SessionModel.h.
Referenced by SessionModel::flags(), and SessionModel::setDraggedItemType().
|
privateinherited |
model tag (SampleModel, InstrumentModel)
Definition at line 122 of file SessionModel.h.
Referenced by SessionModel::getModelTag(), and SessionModel::readFrom().
|
privateinherited |
model name
Definition at line 121 of file SessionModel.h.
Referenced by SessionModel::getModelName(), and SessionModel::readFrom().
|
privateinherited |
Definition at line 119 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::load(), SessionModel::moveItem(), SessionModel::parent(), SessionModel::readFrom(), SessionModel::removeRows(), SessionModel::rootItem(), SessionModel::save(), SessionModel::setRootItem(), and SessionModel::writeTo().