BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Defines actions for MaskEditor which are related to selected MaskItem (toggle mask value, lower/rize mask in the stack, delete mask). More...
Public Slots | |
void | onDeleteMaskAction () |
void | onItemContextMenuRequest (const QPoint &point) |
Constructs MaskItem context menu following the request from MaskGraphicsScene or MaskEditorInfoPanel. More... | |
Signals | |
void | propertyPanelRequest () |
void | resetViewRequest () |
void | savePlotRequest () |
Public Member Functions | |
MaskEditorActions (QWidget *parent) | |
QAction * | bringToFrontAction () |
QAction * | sendToBackAction () |
void | setModel (SessionModel *maskModel, const QModelIndex &rootIndex) |
void | setSelectionModel (QItemSelectionModel *selectionModel) |
QList< QAction * > | topToolBarActions () |
Private Slots | |
void | onBringToFrontAction () |
void | onSendToBackAction () |
void | onToggleMaskValueAction () |
Performs switch of mask value for all selected items (true -> false, false -> true) More... | |
Private Member Functions | |
void | changeMaskStackingOrder (MaskEditorFlags::Stacking value) |
Lower mask one level down or rise one level up in the masks stack. More... | |
void | initItemContextMenu (QMenu &menu) |
Init external context menu with currently defined actions. More... | |
bool | isBringToFrontPossible () const |
Returns true if at least one of MaskItems in the selection can be moved one level up (Naturally, it is always true, if selection contains more than one item. More... | |
bool | isSendToBackPossible () const |
Returns true if at least one of MaskItems in the selection can be moved one level down. More... | |
void | setAllActionsEnabled (bool value) |
Private Attributes | |
QAction * | m_bringToFrontAction |
QAction * | m_deleteMaskAction |
SessionModel * | m_maskModel |
QAction * | m_resetViewAction |
QModelIndex | m_rootIndex |
QAction * | m_savePlotAction |
QItemSelectionModel * | m_selectionModel |
Index in the model corresponding to IntensityDataItem. More... | |
QAction * | m_sendToBackAction |
QAction * | m_toggleMaskValueAction |
QAction * | m_togglePanelAction |
Defines actions for MaskEditor which are related to selected MaskItem (toggle mask value, lower/rize mask in the stack, delete mask).
If more than one MaskItem is selected, action will be applied to the whole selection, if possible.
Definition at line 33 of file MaskEditorActions.h.
MaskEditorActions::MaskEditorActions | ( | QWidget * | parent | ) |
Definition at line 22 of file MaskEditorActions.cpp.
References m_bringToFrontAction, m_deleteMaskAction, m_resetViewAction, m_savePlotAction, m_sendToBackAction, m_toggleMaskValueAction, m_togglePanelAction, onBringToFrontAction(), onDeleteMaskAction(), onSendToBackAction(), onToggleMaskValueAction(), propertyPanelRequest(), resetViewRequest(), and savePlotRequest().
QAction * MaskEditorActions::bringToFrontAction | ( | ) |
Definition at line 88 of file MaskEditorActions.cpp.
References m_bringToFrontAction.
Referenced by MaskEditorToolBar::setup_maskmodify_group().
|
private |
Lower mask one level down or rise one level up in the masks stack.
Definition at line 144 of file MaskEditorActions.cpp.
References MaskEditorFlags::BRING_TO_FRONT, SessionModel::indexOfItem(), SessionModel::itemForIndex(), m_maskModel, m_rootIndex, m_selectionModel, SessionModel::moveItem(), and MaskEditorFlags::SEND_TO_BACK.
Referenced by onBringToFrontAction(), and onSendToBackAction().
|
private |
Init external context menu with currently defined actions.
Triggered from MaskGraphicsScene of MaskEditorInfoPanel (QListView)
Definition at line 206 of file MaskEditorActions.cpp.
References ASSERT, isBringToFrontPossible(), isSendToBackPossible(), m_bringToFrontAction, m_deleteMaskAction, m_maskModel, m_rootIndex, m_selectionModel, m_sendToBackAction, m_toggleMaskValueAction, and setAllActionsEnabled().
Referenced by onItemContextMenuRequest().
|
private |
Returns true if at least one of MaskItems in the selection can be moved one level up (Naturally, it is always true, if selection contains more than one item.
If selection contains only one item, the result will depend on position of item on the stack. Top item can't be moved up. Used to disable corresponding context menu line.)
Definition at line 174 of file MaskEditorActions.cpp.
References m_selectionModel.
Referenced by initItemContextMenu().
|
private |
Returns true if at least one of MaskItems in the selection can be moved one level down.
Definition at line 184 of file MaskEditorActions.cpp.
References SessionModel::itemForIndex(), m_maskModel, m_selectionModel, SessionItem::numberOfChildren(), and SessionItem::parent().
Referenced by initItemContextMenu().
|
privateslot |
Definition at line 133 of file MaskEditorActions.cpp.
References MaskEditorFlags::BRING_TO_FRONT, and changeMaskStackingOrder().
Referenced by MaskEditorActions().
|
slot |
Definition at line 108 of file MaskEditorActions.cpp.
References ASSERT, m_maskModel, m_selectionModel, and SessionModel::removeRows().
Referenced by MaskEditorActions(), and MaskEditor::setup_connections().
|
slot |
Constructs MaskItem context menu following the request from MaskGraphicsScene or MaskEditorInfoPanel.
Definition at line 100 of file MaskEditorActions.cpp.
References initItemContextMenu(), and setAllActionsEnabled().
Referenced by MaskEditor::setup_connections().
|
privateslot |
Definition at line 138 of file MaskEditorActions.cpp.
References changeMaskStackingOrder(), and MaskEditorFlags::SEND_TO_BACK.
Referenced by MaskEditorActions().
|
privateslot |
Performs switch of mask value for all selected items (true -> false, false -> true)
Definition at line 121 of file MaskEditorActions.cpp.
References ASSERT, SessionModel::itemForIndex(), m_maskModel, m_selectionModel, and MaskItem::P_MASK_VALUE.
Referenced by MaskEditorActions().
|
signal |
|
signal |
Referenced by MaskEditorActions(), MaskEditor::setup_connections(), and MaskEditorToolBar::setup_selection_group().
|
signal |
Referenced by MaskEditorActions(), and MaskEditor::setup_connections().
QAction * MaskEditorActions::sendToBackAction | ( | ) |
Definition at line 83 of file MaskEditorActions.cpp.
References m_sendToBackAction.
Referenced by MaskEditorToolBar::setup_maskmodify_group().
|
private |
Definition at line 196 of file MaskEditorActions.cpp.
References m_bringToFrontAction, m_deleteMaskAction, m_sendToBackAction, and m_toggleMaskValueAction.
Referenced by initItemContextMenu(), and onItemContextMenuRequest().
void MaskEditorActions::setModel | ( | SessionModel * | maskModel, |
const QModelIndex & | rootIndex | ||
) |
Definition at line 72 of file MaskEditorActions.cpp.
References m_maskModel, and m_rootIndex.
Referenced by MaskEditor::setMaskContext().
void MaskEditorActions::setSelectionModel | ( | QItemSelectionModel * | selectionModel | ) |
Definition at line 78 of file MaskEditorActions.cpp.
References m_selectionModel.
Referenced by MaskEditor::setMaskContext().
QList< QAction * > MaskEditorActions::topToolBarActions | ( | ) |
Definition at line 93 of file MaskEditorActions.cpp.
References m_resetViewAction, and m_togglePanelAction.
Referenced by MaskEditor::topToolBarActions().
|
private |
Definition at line 68 of file MaskEditorActions.h.
Referenced by MaskEditorActions(), bringToFrontAction(), initItemContextMenu(), and setAllActionsEnabled().
|
private |
Definition at line 70 of file MaskEditorActions.h.
Referenced by MaskEditorActions(), initItemContextMenu(), and setAllActionsEnabled().
|
private |
Definition at line 76 of file MaskEditorActions.h.
Referenced by changeMaskStackingOrder(), initItemContextMenu(), isSendToBackPossible(), onDeleteMaskAction(), onToggleMaskValueAction(), and setModel().
|
private |
Definition at line 72 of file MaskEditorActions.h.
Referenced by MaskEditorActions(), and topToolBarActions().
|
private |
Definition at line 77 of file MaskEditorActions.h.
Referenced by changeMaskStackingOrder(), initItemContextMenu(), and setModel().
|
private |
Definition at line 73 of file MaskEditorActions.h.
Referenced by MaskEditorActions().
|
private |
Index in the model corresponding to IntensityDataItem.
Definition at line 78 of file MaskEditorActions.h.
Referenced by changeMaskStackingOrder(), initItemContextMenu(), isBringToFrontPossible(), isSendToBackPossible(), onDeleteMaskAction(), onToggleMaskValueAction(), and setSelectionModel().
|
private |
Definition at line 69 of file MaskEditorActions.h.
Referenced by MaskEditorActions(), initItemContextMenu(), sendToBackAction(), and setAllActionsEnabled().
|
private |
Definition at line 67 of file MaskEditorActions.h.
Referenced by MaskEditorActions(), initItemContextMenu(), and setAllActionsEnabled().
|
private |
Definition at line 74 of file MaskEditorActions.h.
Referenced by MaskEditorActions(), and topToolBarActions().