BornAgain
1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
|
List of MaskItems.
Makes it possible to keep a list of MaskItems in a class which itself is not using SessionModel and which is not derived from SessionItem.
This class is only for migration away from SessionModel. To keep a list of items which are derived from SessionItem, right now a containing SessionModel is necessary. Once MaskItem is not derived from SessionItem any more, this class can be replaced by e.g. a simple QVector<MaskItem*>
Definition at line 232 of file MaskItems.h.
Public Member Functions | |
MaskItems () | |
void | clear () |
Removes all maskItems. More... | |
void | copy (const MaskContainerItem *maskContainer) |
Copy the mask items stored in the given maskContainer. More... | |
void | insertMask (int index, MaskItem *maskItem) |
Takes ownership of maskItem. More... | |
QVector< MaskItem * > | maskItems () const |
void | serialize (Streamer &s) |
Protected Member Functions | |
QVector< QString > | acceptableDefaultItemTypes (const QModelIndex &parent) const |
bool | canDropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const override |
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) |
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 |
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... | |
virtual QVector< SessionItem * > | nonXMLItems () const |
QModelIndex | parent (const QModelIndex &child) const override |
virtual void | readFrom (QXmlStreamReader *reader, MessageService *messageService=nullptr) |
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) |
void | setRootItem (SessionItem *root) |
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) |
Private Attributes | |
QString | m_dragged_item_type |
MaskContainerItem * | m_maskContainer |
QString | m_model_tag |
SessionItem * | m_root_item |
MaskItems::MaskItems | ( | ) |
Definition at line 491 of file MaskItems.cpp.
References m_maskContainer.
|
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().
|
virtual |
Removes all maskItems.
Reimplemented from SessionModel.
Definition at line 515 of file MaskItems.cpp.
References SessionModel::clear(), and m_maskContainer.
|
overrideinherited |
Definition at line 134 of file SessionModel.cpp.
References SessionFlags::MAX_COLUMNS, and SessionModel::parent().
Referenced by SessionModel::data(), and SessionModel::index().
void MaskItems::copy | ( | const MaskContainerItem * | maskContainer | ) |
Copy the mask items stored in the given maskContainer.
maskContainer can be nullptr.
Definition at line 507 of file MaskItems.cpp.
References MaskContainerItem::clear(), SessionModel::copyItem(), m_maskContainer, and MaskContainerItem::maskItems().
Referenced by DetectorItem::importMasks().
|
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 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(), 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().
|
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().
void MaskItems::insertMask | ( | int | index, |
MaskItem * | maskItem | ||
) |
Takes ownership of maskItem.
Definition at line 497 of file MaskItems.cpp.
References SessionModel::index(), SessionItem::insertChild(), and m_maskContainer.
|
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().
|
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().
QVector< MaskItem * > MaskItems::maskItems | ( | ) | const |
Definition at line 502 of file MaskItems.cpp.
References m_maskContainer, and MaskContainerItem::maskItems().
Referenced by DetectorItem::addMasksToCore(), and serialize().
|
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().
|
virtualinherited |
Reimplemented in RealDataModel, and JobModel.
Definition at line 436 of file SessionModel.cpp.
|
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(), RealDataModel::onRowsChange(), SessionModel::removeRows(), and SessionModel::rowCount().
|
virtualinherited |
Reimplemented in RealDataModel, and JobModel.
Definition at line 336 of file SessionModel.cpp.
References SessionModel::clear(), Error, SessionModel::m_model_tag, SessionModel::m_root_item, and GUI::Session::XML::readItems().
Referenced by SessionModel::initFrom(), JobModel::readFrom(), and RealDataModel::readFrom().
|
inherited |
Definition at line 303 of file SessionModel.cpp.
References SessionModel::index(), SessionModel::indexOfItem(), and SessionModel::removeRows().
|
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().
void MaskItems::serialize | ( | Streamer & | s | ) |
Definition at line 521 of file MaskItems.cpp.
References MaskContainerItem::addMask(), Streamer::assertVersion(), m_maskContainer, maskItems(), and Streamer::xmlReader().
|
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().
|
private |
Definition at line 252 of file MaskItems.h.
Referenced by MaskItems(), clear(), copy(), insertMask(), maskItems(), and serialize().
|
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().