|
BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Collection of actions to add/remove/clone instrument. More...
Public Slots | |
| void | onCloneInstrument () |
| Clones currently selected instrument. More... | |
| void | onContextMenuRequest (const QPoint &point, const QModelIndex &indexAtPoint) |
| void | onRemoveInstrument () |
| Removes currently selected instrument. More... | |
Public Member Functions | |
| InstrumentViewActions (QWidget *parent=nullptr) | |
| ~InstrumentViewActions () | |
| QMenu * | instrumentMenu () |
| Returns menu to create one of available instrument types. More... | |
| void | setModel (SessionModel *model) |
| void | setSelectionModel (QItemSelectionModel *selectionModel) |
Private Member Functions | |
| void | initAddInstrumentMenu () |
| Constructs menu to add instruments of various types. More... | |
| QMap< QString, int > | mapOfNames () |
| void | setAllActionsEnabled (bool value) |
| QString | suggestInstrumentName (const QString ¤tName) |
| void | updateSelection () |
Private Attributes | |
| QMenu * | m_addInstrumentMenu |
| QAction * | m_cloneInstrumentAction |
| SessionModel * | m_model |
| QAction * | m_removeInstrumentAction |
| QItemSelectionModel * | m_selectionModel |
Collection of actions to add/remove/clone instrument.
Definition at line 29 of file InstrumentViewActions.h.
|
explicit |
Definition at line 29 of file InstrumentViewActions.cpp.
References initAddInstrumentMenu(), m_cloneInstrumentAction, m_removeInstrumentAction, onCloneInstrument(), and onRemoveInstrument().
| InstrumentViewActions::~InstrumentViewActions | ( | ) |
Definition at line 51 of file InstrumentViewActions.cpp.
References m_addInstrumentMenu.
|
private |
Constructs menu to add instruments of various types.
The type of instrument is encoded in QAction internal data.
Definition at line 187 of file InstrumentViewActions.cpp.
References InstrumentItem::defaultName(), SessionModel::insertItem(), m_addInstrumentMenu, m_model, SessionItem::setItemName(), suggestInstrumentName(), and updateSelection().
Referenced by InstrumentViewActions().
| QMenu * InstrumentViewActions::instrumentMenu | ( | ) |
Returns menu to create one of available instrument types.
Definition at line 68 of file InstrumentViewActions.cpp.
References m_addInstrumentMenu.
|
private |
Definition at line 167 of file InstrumentViewActions.cpp.
References m_model, RealSpace::Particles::name(), and ModelUtils::topItemNames().
Referenced by suggestInstrumentName().
|
slot |
Clones currently selected instrument.
Definition at line 87 of file InstrumentViewActions.cpp.
References SessionItem::children(), SessionModel::copyItem(), PointwiseAxisItem::init(), SessionModel::insertNewItem(), SessionModel::itemForIndex(), SessionItem::itemName(), m_model, m_selectionModel, SessionItem::modelType(), suggestInstrumentName(), and SessionItem::tagFromItem().
Referenced by InstrumentViewActions(), and InstrumentViewToolBar::InstrumentViewToolBar().
|
slot |
Definition at line 123 of file InstrumentViewActions.cpp.
References m_addInstrumentMenu, m_cloneInstrumentAction, m_removeInstrumentAction, and setAllActionsEnabled().
Referenced by InstrumentView::InstrumentView().
|
slot |
Removes currently selected instrument.
Definition at line 75 of file InstrumentViewActions.cpp.
References m_model, m_selectionModel, SessionModel::removeRows(), and updateSelection().
Referenced by InstrumentViewActions(), and InstrumentViewToolBar::InstrumentViewToolBar().
|
private |
Definition at line 137 of file InstrumentViewActions.cpp.
References m_cloneInstrumentAction, and m_removeInstrumentAction.
Referenced by onContextMenuRequest().
| void InstrumentViewActions::setModel | ( | SessionModel * | model | ) |
Definition at line 56 of file InstrumentViewActions.cpp.
References m_model.
Referenced by InstrumentView::InstrumentView().
| void InstrumentViewActions::setSelectionModel | ( | QItemSelectionModel * | selectionModel | ) |
Definition at line 61 of file InstrumentViewActions.cpp.
References m_selectionModel.
Referenced by InstrumentView::InstrumentView().
|
private |
Definition at line 153 of file InstrumentViewActions.cpp.
References mapOfNames().
Referenced by initAddInstrumentMenu(), and onCloneInstrument().
|
private |
Definition at line 143 of file InstrumentViewActions.cpp.
References SessionModel::index(), m_model, m_selectionModel, and SessionModel::rowCount().
Referenced by initAddInstrumentMenu(), and onRemoveInstrument().
|
private |
Definition at line 53 of file InstrumentViewActions.h.
Referenced by ~InstrumentViewActions(), initAddInstrumentMenu(), instrumentMenu(), and onContextMenuRequest().
|
private |
Definition at line 55 of file InstrumentViewActions.h.
Referenced by InstrumentViewActions(), onContextMenuRequest(), and setAllActionsEnabled().
|
private |
Definition at line 56 of file InstrumentViewActions.h.
Referenced by initAddInstrumentMenu(), mapOfNames(), onCloneInstrument(), onRemoveInstrument(), setModel(), and updateSelection().
|
private |
Definition at line 54 of file InstrumentViewActions.h.
Referenced by InstrumentViewActions(), onContextMenuRequest(), and setAllActionsEnabled().
|
private |
Definition at line 57 of file InstrumentViewActions.h.
Referenced by onCloneInstrument(), onRemoveInstrument(), setSelectionModel(), and updateSelection().