///
/// Adds a shortcut to Qt's shortcut system that watches for the given
/// *key* sequence in the given *context.* If the *context* is
/// Qt::ApplicationShortcut, the shortcut applies to the application as a
/// whole. Otherwise, it is either local to this widget, Qt::WidgetShortcut,
/// or to the window itself, Qt::WindowShortcut.
///
/// If the same *key* sequence has been grabbed by several widgets,
/// when the *key* sequence occurs a QEvent::Shortcut event is sent
/// to all the widgets to which it applies in a non-deterministic
/// order, but with the ``ambiguous'' flag set to true.
///
/// **Warning**: You should not normally need to use this function;
/// instead create [QAction](QAction)
/// s with the shortcut key sequences you
/// require (if you also want equivalent menu options and toolbar
/// buttons), or create [QShortcut](QShortcut)
/// s if you just need key sequences.
/// Both QAction and QShortcut handle all the event filtering for you,
/// and provide signals which are triggered when the user triggers the
/// key sequence, so are much easier to use than this low-level
/// function.
///
/// **See also:** [`release_shortcut()`]
/// [`set_shortcut_enabled()`]


If the same *key* sequence has been grabbed by several widgets,
when the *key* sequence occurs a QEvent::Shortcut event is sent
to all the widgets to which it applies in a non-deterministic
order, but with the ``ambiguous'' flag set to true.

Warning**: You should not normally need to use this function;
instead create [QAction](QAction)
s with the shortcut key sequences you
require (if you also want equivalent menu options and toolbar
buttons), or create [QShortcut](QShortcut)
s if you just need key sequences.
Both QAction and QShortcut handle all the event filtering for you,
and provide signals which are triggered when the user triggers the
key sequence, so are much easier to use than this low-level
function.


If the same * key * sequence has been grabbed by several widgets when the * key * sequence occurs a QEvent :: Shortcut event is sent to all the widgets to which it applies in a non - deterministic order but with the ` ` ambiguous ' ' flag set to true . Warning ** : You should not normally need to use this function ; instead create [ QAction ] ( QAction ) s with the shortcut key sequences you require ( if you also want equivalent menu options and toolbar buttons ) or create [ QShortcut ] ( QShortcut ) s if you just need key sequences . Both QAction and QShortcut handle all the event filtering for you and provide signals which are triggered when the user triggers the key sequence so are much easier to use than this low - level function .
pub fn grab_shortcut<K: KeySequenceTrait<'a>>(&self, key: &K, context: ShortcutContext) -> i32 {
        let (obj_key_1, _funcs) = key.get_key_sequence_obj_funcs();
        let enum_context_2 = context as u32;
        let (obj_data, funcs) = self.get_widget_obj_funcs();
        unsafe {
            let ret_val = ((*funcs).grab_shortcut)(obj_data, obj_key_1, enum_context_2);
            ret_val
        }
    }
pub fn grab_shortcut < K : KeySequenceTrait < ' a > > ( & self , key : & K , context : ShortcutContext ) -> i32 { let ( obj_key_1 , _funcs ) = key . get_key_sequence_obj_funcs ( ) ; let enum_context_2 = context as u32 ; let ( obj_data , funcs ) = self . get_widget_obj_funcs ( ) ; unsafe { let ret_val = ( ( * funcs ) . grab_shortcut ) ( obj_data , obj_key_1 , enum_context_2 ) ; ret_val } }
Adds a shortcut to Qt's shortcut system that watches for the given
key* sequence in the given *context.
Adds a shortcut to Qt ' s shortcut system that watches for the given key * sequence in the given * context .
&self
key
&K
context
ShortcutContext