MCPcopy Create free account
hub / github.com/SpartanJ/eepp / tryBeginEditing

Method tryBeginEditing

src/eepp/ui/abstract/uiabstracttableview.cpp:963–976  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

961}
962
963bool UIAbstractTableView::tryBeginEditing( KeyBindings::Shortcut fromShortcut ) {
964 if ( isEditable() && getSelection().first().isValid() && getModel() &&
965 getModel()->isEditable( getSelection().first() ) &&
966 ( mEditTriggers & EditTrigger::EditKeyPressed ) && !mEditShortcuts.empty() ) {
967 fromShortcut = KeyBindings::sanitizeShortcut( fromShortcut );
968 for ( const auto& shortcut : mEditShortcuts ) {
969 if ( shortcut == fromShortcut ) {
970 beginEditing( getSelection().first(), getCellFromIndex( getSelection().first() ) );
971 return true;
972 }
973 }
974 }
975 return false;
976}
977
978Uint32 UIAbstractTableView::onKeyDown( const KeyEvent& event ) {
979 if ( tryBeginEditing( KeyBindings::Shortcut{ event.getKeyCode(), event.getMod() } ) )

Callers

nothing calls this directly

Calls 6

isEditableFunction · 0.85
getSelectionFunction · 0.85
getModelFunction · 0.85
isValidMethod · 0.45
isEditableMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected