BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Tree model for real data item selection. Used for the tree in the import view. More...
Public Member Functions | |
virtual int | columnCount (const QModelIndex &parent=QModelIndex()) const override |
virtual QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override |
virtual Qt::ItemFlags | flags (const QModelIndex &index) const override |
virtual QModelIndex | index (int row, int column, const QModelIndex &parent=QModelIndex()) const override |
QModelIndex | indexForItem (RealDataItem *item) const |
RealDataItem * | insertIntensityDataItem () |
RealDataItem * | insertSpecularDataItem () |
RealDataItem * | itemForIndex (const QModelIndex &index) const |
virtual QModelIndex | parent (const QModelIndex &index) const override |
void | refreshAfterModelChange () |
void | removeItem (RealDataItem *item) |
virtual int | rowCount (const QModelIndex &parent=QModelIndex()) const override |
virtual bool | setData (const QModelIndex &index, const QVariant &value, int role) override |
void | setRealDataModel (RealDataModel *model) |
RealDataItem * | topMostItem () const |
The topmost visible item. Can be null of course. More... | |
Private Member Functions | |
void | clear () |
QModelIndex | create1DHeadlineIndex () const |
QModelIndex | create2DHeadlineIndex () const |
bool | isHeadline (const QModelIndex &index) const |
void | onContentsProcessed (RealDataItem *item) |
void | updateSubsriptions () |
Private Attributes | |
bool | m_intermediate1DHeadline = false |
bool | m_intermediate2DHeadline = false |
QVector< RealDataItem * > | m_items1D |
QVector< RealDataItem * > | m_items2D |
RealDataModel * | m_model = nullptr |
Tree model for real data item selection. Used for the tree in the import view.
Definition at line 24 of file RealDataTreeModel.h.
|
private |
Definition at line 49 of file RealDataTreeModel.cpp.
References m_items1D, m_items2D, and updateSubsriptions().
Referenced by setRealDataModel().
|
overridevirtual |
Definition at line 179 of file RealDataTreeModel.cpp.
|
private |
Definition at line 339 of file RealDataTreeModel.cpp.
Referenced by insertSpecularDataItem(), parent(), and removeItem().
|
private |
Definition at line 344 of file RealDataTreeModel.cpp.
References m_items1D.
Referenced by insertIntensityDataItem(), parent(), and removeItem().
|
overridevirtual |
Definition at line 209 of file RealDataTreeModel.cpp.
References SessionModel::data(), SessionItemUtils::DecorationRole(), SessionItemUtils::ForegroundRole(), index(), SessionModel::indexOfItem(), isHeadline(), itemForIndex(), m_items1D, m_model, and SessionItemUtils::ToolTipRole().
|
overridevirtual |
Definition at line 279 of file RealDataTreeModel.cpp.
References SessionModel::flags(), index(), SessionModel::indexOfItem(), isHeadline(), itemForIndex(), and m_model.
|
overridevirtual |
Definition at line 150 of file RealDataTreeModel.cpp.
References m_items1D, m_items2D, and parent().
Referenced by data(), flags(), indexForItem(), isHeadline(), itemForIndex(), onContentsProcessed(), parent(), removeItem(), and setData().
QModelIndex RealDataTreeModel::indexForItem | ( | RealDataItem * | item | ) | const |
Definition at line 313 of file RealDataTreeModel.cpp.
References index(), RealDataItem::isSpecularData(), m_items1D, and m_items2D.
Referenced by onContentsProcessed(), removeItem(), and RealDataSelectorWidget::setCurrentItem().
RealDataItem * RealDataTreeModel::insertIntensityDataItem | ( | ) |
Definition at line 122 of file RealDataTreeModel.cpp.
References create2DHeadlineIndex(), RealDataModel::insertIntensityDataItem(), m_intermediate2DHeadline, m_items1D, m_items2D, m_model, RealDataModel::realDataItems2D(), and updateSubsriptions().
Referenced by RealDataSelectorWidget::importData().
RealDataItem * RealDataTreeModel::insertSpecularDataItem | ( | ) |
Definition at line 103 of file RealDataTreeModel.cpp.
References create1DHeadlineIndex(), RealDataModel::insertSpecularDataItem(), m_intermediate1DHeadline, m_items1D, m_model, RealDataModel::realDataItems1D(), and updateSubsriptions().
Referenced by RealDataSelectorWidget::importData().
|
private |
RealDataItem * RealDataTreeModel::itemForIndex | ( | const QModelIndex & | index | ) | const |
Definition at line 305 of file RealDataTreeModel.cpp.
References index().
Referenced by RealDataSelectorWidget::currentItem(), data(), flags(), RealDataSelectorWidget::onContextMenuRequest(), parent(), and setData().
|
private |
Definition at line 363 of file RealDataTreeModel.cpp.
References index(), and indexForItem().
Referenced by updateSubsriptions().
|
overridevirtual |
Definition at line 165 of file RealDataTreeModel.cpp.
References create1DHeadlineIndex(), create2DHeadlineIndex(), index(), and itemForIndex().
Referenced by index(), and rowCount().
void RealDataTreeModel::refreshAfterModelChange | ( | ) |
Definition at line 37 of file RealDataTreeModel.cpp.
References m_items1D, m_items2D, m_model, RealDataModel::realDataItems1D(), RealDataModel::realDataItems2D(), and updateSubsriptions().
Referenced by setRealDataModel().
void RealDataTreeModel::removeItem | ( | RealDataItem * | item | ) |
Definition at line 58 of file RealDataTreeModel.cpp.
References create1DHeadlineIndex(), create2DHeadlineIndex(), RealDataItem::dataLoader(), index(), indexForItem(), RealDataItem::isSpecularData(), m_intermediate1DHeadline, m_intermediate2DHeadline, m_items1D, m_items2D, m_model, and SessionModel::removeItem().
Referenced by RealDataSelectorWidget::importData(), and RealDataSelectorWidget::removeCurrentItem().
|
overridevirtual |
Definition at line 184 of file RealDataTreeModel.cpp.
References m_intermediate1DHeadline, m_intermediate2DHeadline, m_items1D, m_items2D, and parent().
|
overridevirtual |
Definition at line 291 of file RealDataTreeModel.cpp.
References index(), itemForIndex(), and RealDataItem::setName().
void RealDataTreeModel::setRealDataModel | ( | RealDataModel * | model | ) |
Definition at line 22 of file RealDataTreeModel.cpp.
References clear(), m_model, RealDataModel::realDataAddedOrRemoved(), and refreshAfterModelChange().
Referenced by RealDataSelectorWidget::setModel().
RealDataItem * RealDataTreeModel::topMostItem | ( | ) | const |
The topmost visible item. Can be null of course.
Definition at line 141 of file RealDataTreeModel.cpp.
References m_items1D, and m_items2D.
Referenced by RealDataSelectorWidget::showEvent().
|
private |
Definition at line 350 of file RealDataTreeModel.cpp.
References RealDataItem::importContentsProcessed(), m_items1D, m_items2D, and onContentsProcessed().
Referenced by clear(), insertIntensityDataItem(), insertSpecularDataItem(), and refreshAfterModelChange().
|
private |
Definition at line 61 of file RealDataTreeModel.h.
Referenced by insertSpecularDataItem(), removeItem(), and rowCount().
|
private |
Definition at line 62 of file RealDataTreeModel.h.
Referenced by insertIntensityDataItem(), removeItem(), and rowCount().
|
private |
Definition at line 59 of file RealDataTreeModel.h.
Referenced by clear(), create2DHeadlineIndex(), data(), index(), indexForItem(), insertIntensityDataItem(), insertSpecularDataItem(), refreshAfterModelChange(), removeItem(), rowCount(), topMostItem(), and updateSubsriptions().
|
private |
Definition at line 60 of file RealDataTreeModel.h.
Referenced by clear(), index(), indexForItem(), insertIntensityDataItem(), refreshAfterModelChange(), removeItem(), rowCount(), topMostItem(), and updateSubsriptions().
|
private |
Definition at line 58 of file RealDataTreeModel.h.
Referenced by data(), flags(), insertIntensityDataItem(), insertSpecularDataItem(), refreshAfterModelChange(), removeItem(), and setRealDataModel().