BornAgain
1.19.79
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.
Definition at line 25 of file RealDataTreeModel.h.
Public Member Functions | |
RealDataTreeModel (QObject *parent, RealDataModel *model) | |
int | columnCount (const QModelIndex &parent=QModelIndex()) const override |
QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override |
Qt::ItemFlags | flags (const QModelIndex &index) const override |
QModelIndex | index (int row, int column, const QModelIndex &parent=QModelIndex()) const override |
QModelIndex | indexForItem (RealDataItem *item) const |
QModelIndex | indexOfHeadline (int rank) const |
RealDataItem * | insertDataItem (int rank) |
RealDataItem * | insertIntensityDataItem () |
RealDataItem * | insertSpecularDataItem () |
bool | isHeadline (const QModelIndex &index) const |
RealDataItem * | itemForIndex (const QModelIndex &index) const |
QModelIndex | parent (const QModelIndex &index) const override |
void | refreshAfterModelChange () |
void | removeItem (RealDataItem *item) |
int | rowCount (const QModelIndex &parent=QModelIndex()) const override |
bool | setData (const QModelIndex &index, const QVariant &value, int role) override |
void | setVisibleRanks (QSet< int > visibleRanks) |
RealDataItem * | topMostItem () const |
The topmost visible item. Can be null of course. More... | |
Private Member Functions | |
void | clear () |
void | onContentsProcessed (RealDataItem *item) |
void | updateSubscriptions () |
Private Attributes | |
QVector< RealDataItem * > | m_items [2] |
RealDataModel * | m_model = nullptr |
QSet< int > | m_visibleRanks |
|
explicit |
Definition at line 23 of file RealDataTreeModel.cpp.
|
private |
Definition at line 65 of file RealDataTreeModel.cpp.
References m_items, and updateSubscriptions().
|
override |
Definition at line 171 of file RealDataTreeModel.cpp.
|
override |
Definition at line 189 of file RealDataTreeModel.cpp.
References appSettings, ApplicationSettings::Palette::headlineBackground, ApplicationSettings::Palette::headlineText, index(), indexOfHeadline(), isHeadline(), itemForIndex(), m_visibleRanks, and ApplicationSettings::styleSheetPalette().
|
override |
Definition at line 258 of file RealDataTreeModel.cpp.
References index(), and isHeadline().
|
override |
Definition at line 142 of file RealDataTreeModel.cpp.
References indexOfHeadline(), m_items, m_visibleRanks, and parent().
Referenced by data(), flags(), indexForItem(), isHeadline(), itemForIndex(), onContentsProcessed(), parent(), removeItem(), and setData().
QModelIndex RealDataTreeModel::indexForItem | ( | RealDataItem * | item | ) | const |
Definition at line 294 of file RealDataTreeModel.cpp.
References index(), RealDataItem::isSpecularData(), m_items, and m_visibleRanks.
Referenced by onContentsProcessed(), removeItem(), and RealDataSelectorWidget::setCurrentItem().
QModelIndex RealDataTreeModel::indexOfHeadline | ( | int | rank | ) | const |
Definition at line 126 of file RealDataTreeModel.cpp.
References m_visibleRanks.
Referenced by data(), RealDataSelectorWidget::getOverlayActions(), index(), insertDataItem(), parent(), refreshAfterModelChange(), removeItem(), and rowCount().
RealDataItem * RealDataTreeModel::insertDataItem | ( | int | rank | ) |
Definition at line 103 of file RealDataTreeModel.cpp.
References indexOfHeadline(), RealDataModel::insertDataItem(), m_items, m_model, m_visibleRanks, RealDataModel::realDataItems(), and updateSubscriptions().
Referenced by insertIntensityDataItem(), and insertSpecularDataItem().
RealDataItem * RealDataTreeModel::insertIntensityDataItem | ( | ) |
Definition at line 98 of file RealDataTreeModel.cpp.
References insertDataItem().
Referenced by RealDataSelectorWidget::importData2D().
RealDataItem * RealDataTreeModel::insertSpecularDataItem | ( | ) |
Definition at line 93 of file RealDataTreeModel.cpp.
References insertDataItem().
Referenced by RealDataSelectorWidget::importData1D().
bool RealDataTreeModel::isHeadline | ( | const QModelIndex & | index | ) | const |
Definition at line 307 of file RealDataTreeModel.cpp.
References index().
Referenced by data(), flags(), and RealDataSelectorWidget::getOverlayActions().
RealDataItem * RealDataTreeModel::itemForIndex | ( | const QModelIndex & | index | ) | const |
Definition at line 286 of file RealDataTreeModel.cpp.
References index().
Referenced by RealDataSelectorWidget::currentItem(), data(), RealDataSelectorWidget::getOverlayActions(), RealDataSelectorWidget::onContextMenuRequest(), parent(), and setData().
|
private |
Definition at line 326 of file RealDataTreeModel.cpp.
References index(), and indexForItem().
Referenced by updateSubscriptions().
|
override |
Definition at line 157 of file RealDataTreeModel.cpp.
References index(), indexOfHeadline(), and itemForIndex().
Referenced by index(), and rowCount().
void RealDataTreeModel::refreshAfterModelChange | ( | ) |
Definition at line 52 of file RealDataTreeModel.cpp.
References indexOfHeadline(), m_items, m_model, m_visibleRanks, RealDataModel::realDataItems(), and updateSubscriptions().
void RealDataTreeModel::removeItem | ( | RealDataItem * | item | ) |
Definition at line 74 of file RealDataTreeModel.cpp.
References RealDataItem::dataLoader(), index(), indexForItem(), indexOfHeadline(), RealDataItem::isSpecularData(), m_items, m_model, m_visibleRanks, and RealDataModel::remove().
Referenced by RealDataSelectorWidget::getOverlayActions(), RealDataSelectorWidget::importData1D(), RealDataSelectorWidget::importData2D(), and RealDataSelectorWidget::removeCurrentItem().
|
override |
Definition at line 176 of file RealDataTreeModel.cpp.
References indexOfHeadline(), m_items, m_visibleRanks, and parent().
|
override |
Definition at line 272 of file RealDataTreeModel.cpp.
References index(), itemForIndex(), and RealDataItem::setDataName().
void RealDataTreeModel::setVisibleRanks | ( | QSet< int > | visibleRanks | ) |
Definition at line 37 of file RealDataTreeModel.cpp.
References m_items, m_model, m_visibleRanks, RealDataModel::realDataItems(), and updateSubscriptions().
Referenced by RealDataSelectorWidget::updateFunctionalities().
RealDataItem * RealDataTreeModel::topMostItem | ( | ) | const |
The topmost visible item. Can be null of course.
Definition at line 117 of file RealDataTreeModel.cpp.
References m_items, and m_visibleRanks.
Referenced by RealDataSelectorWidget::RealDataSelectorWidget().
|
private |
Definition at line 315 of file RealDataTreeModel.cpp.
References RealDataItem::importContentsProcessed(), m_items, and onContentsProcessed().
Referenced by clear(), insertDataItem(), refreshAfterModelChange(), and setVisibleRanks().
|
private |
Definition at line 62 of file RealDataTreeModel.h.
Referenced by clear(), index(), indexForItem(), insertDataItem(), refreshAfterModelChange(), removeItem(), rowCount(), setVisibleRanks(), topMostItem(), and updateSubscriptions().
|
private |
Definition at line 61 of file RealDataTreeModel.h.
Referenced by insertDataItem(), refreshAfterModelChange(), removeItem(), and setVisibleRanks().
|
private |
Definition at line 63 of file RealDataTreeModel.h.
Referenced by data(), index(), indexForItem(), indexOfHeadline(), insertDataItem(), refreshAfterModelChange(), removeItem(), rowCount(), setVisibleRanks(), and topMostItem().