BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Custom selection model for layer view model (AbstractViewModel). More...
Public Member Functions | |
LayerSelectionModel (ModelView::ViewModel *view_model, QObject *parent=nullptr) | |
~LayerSelectionModel ()=default | |
bool | firstSelected () const |
Checks if the first row is presen in the selection. More... | |
bool | lastSelected () const |
checks if the last row is present in the selection More... | |
std::vector< ModelView::SessionItem * > | selectedItems () const |
Returns vector of selected layers or multilayers. More... | |
void | selectItem (ModelView::SessionItem *item) |
Selects whole row corresponding to given item. More... | |
void | selectItems (std::vector< ModelView::SessionItem * > items) |
Selects all rows corresponding to given items. More... | |
const ModelView::ViewModel * | viewModel () const |
Return the casted view model. More... | |
Custom selection model for layer view model (AbstractViewModel).
Definition at line 33 of file layerselectionmodel.h.
gui2::LayerSelectionModel::LayerSelectionModel | ( | ModelView::ViewModel * | view_model, |
QObject * | parent = nullptr |
||
) |
Definition at line 23 of file layerselectionmodel.cpp.
|
default |
bool gui2::LayerSelectionModel::firstSelected | ( | ) | const |
Checks if the first row is presen in the selection.
Definition at line 81 of file layerselectionmodel.cpp.
Referenced by gui2::LayerEditor::selectionChanged().
bool gui2::LayerSelectionModel::lastSelected | ( | ) | const |
checks if the last row is present in the selection
Definition at line 92 of file layerselectionmodel.cpp.
References viewModel().
Referenced by gui2::LayerEditor::selectionChanged().
std::vector< ModelView::SessionItem * > gui2::LayerSelectionModel::selectedItems | ( | ) | const |
Returns vector of selected layers or multilayers.
We assume, that there is a single line selection mode switched on, and that the columns contains property items related to either LayerItem or MultiLayerItem.
Definition at line 60 of file layerselectionmodel.cpp.
References viewModel().
void gui2::LayerSelectionModel::selectItem | ( | ModelView::SessionItem * | item | ) |
Selects whole row corresponding to given item.
Definition at line 51 of file layerselectionmodel.cpp.
References selectItems().
void gui2::LayerSelectionModel::selectItems | ( | std::vector< ModelView::SessionItem * > | items | ) |
Selects all rows corresponding to given items.
Definition at line 32 of file layerselectionmodel.cpp.
References ModelView::ViewModel::indexOfSessionItem(), gui2::LayerItem::P_NAME, and viewModel().
Referenced by selectItem().
const ModelView::ViewModel * gui2::LayerSelectionModel::viewModel | ( | ) | const |
Return the casted view model.
Definition at line 75 of file layerselectionmodel.cpp.
Referenced by lastSelected(), selectedItems(), and selectItems().