BornAgain
1.19.79
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). 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.
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. Triggered from MaskGraphicsScene of MaskEditorInfoPanel (QListView) 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. 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.) 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 |
MaskEditorActions::MaskEditorActions | ( | QWidget * | parent | ) |
Definition at line 23 of file MaskEditorActions.cpp.
References ActionFactory::createTogglePropertiesPanelAction(), 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 86 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 140 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 202 of file MaskEditorActions.cpp.
References 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 170 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 180 of file MaskEditorActions.cpp.
References SessionModel::itemForIndex(), m_maskModel, m_selectionModel, SessionItem::numberOfChildren(), and SessionItem::parentItem().
Referenced by initItemContextMenu().
|
privateslot |
Definition at line 129 of file MaskEditorActions.cpp.
References MaskEditorFlags::BRING_TO_FRONT, and changeMaskStackingOrder().
Referenced by MaskEditorActions().
|
slot |
Definition at line 106 of file MaskEditorActions.cpp.
References 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 98 of file MaskEditorActions.cpp.
References initItemContextMenu(), and setAllActionsEnabled().
Referenced by MaskEditor::setup_connections().
|
privateslot |
Definition at line 134 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 119 of file MaskEditorActions.cpp.
References SessionModel::itemForIndex(), m_maskModel, and m_selectionModel.
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 81 of file MaskEditorActions.cpp.
References m_sendToBackAction.
Referenced by MaskEditorToolbar::setup_maskmodify_group().
|
private |
Definition at line 192 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 70 of file MaskEditorActions.cpp.
References m_maskModel, and m_rootIndex.
Referenced by MaskEditor::setMaskContext().
void MaskEditorActions::setSelectionModel | ( | QItemSelectionModel * | selectionModel | ) |
Definition at line 76 of file MaskEditorActions.cpp.
References m_selectionModel.
Referenced by MaskEditor::setMaskContext().
QList< QAction * > MaskEditorActions::topToolbarActions | ( | ) |
Definition at line 91 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().