![]() The normal context is WindowShortcut, which allows the shortcut to trigger if the parent (the widget containing the shortcut) is a subwidget of the active top-level window.īy default, this property is set to WindowShortcut. This property holds the context in which the shortcut is valid.Ī shortcut’s context decides in which circumstances a shortcut is allowed to be triggered. If true, the shortcut will auto repeat when the keyboard shortcut combination is held down, provided that keyboard auto repeat is enabled on the system. This property holds whether the shortcut can auto repeat. Depending on the ambiguity of the event, the shortcut will call the member function, or the ambiguousMember function, if the key press was in the shortcut’s context. The shortcut operates on its parent, listening for QShortcutEvent s that match the key sequence. ![]() Since no shortcut key sequence is specified, the shortcut will not emit any signals. The shortcut operates on its parent, listening for QShortcutEvent s that match the standardKey. (key, parent]]) ParametersĬonstructs a QShortcut object for the parent, which should be a QWindow or a QWidget. The simplest way to create a shortcut for a particular widget is to construct the shortcut with a key sequence. Alternatively, shortcuts may be associated with other types of actions in the QAction class. However, because mnemonic shortcuts do not fit in with Aqua’s guidelines, Qt will not show the shortcut character underlined.įor applications that use menus, it may be more convenient to use the convenience functions provided in the QMenu class to assign keyboard shortcuts to menu items as they are created. Call qt_set_sequence_auto_mnemonic() to enable them. On Mac, shortcuts are disabled by default. On Windows, shortcuts are normally not displayed until the user presses the Alt key, but this is a setting the user can change. On X11 the ampersand will not be shown and the character will be underlined. The widget might consume and perform an action on a given shortcut. ![]() “E&xit” will create the shortcut Alt+X (use ‘&’ to display an actual ampersand). ![]() This will automatically create a mnemonic (a shortcut) for that character, e.g. In widget applications, certain widgets can use ‘&’ in front of a character. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |