def config_shortcut(action, context, name, parent):
 keystr = get_shortcut(context, name)
 qsc = QShortcut(QKeySequence(keystr), parent, action)
 qsc.setContext(Qt.WidgetWithChildrenShortcut)
 sc = Shortcut(data=(qsc, context, name))
 return sc

def config_shortcut ( action , context , name , parent ) : keystr = get_shortcut ( context , name ) qsc = QShortcut ( QKeySequence ( keystr ) , parent , action ) qsc . setContext ( Qt . WidgetWithChildrenShortcut ) sc = Shortcut ( data = ( qsc , context , name ) ) return sc
create a shortcut namedtuple for a widget the data contained in this tuple will be registered in our shortcuts preferences page .