![]() ![]() Similarly, the toString() function produces human-readable strings for use in menus. QKeySequence objects can be cast to a QString to obtain a human-readable translated version of the sequence. When creating key sequences for non-standard shortcuts, you should use human-readable strings in preference to hard-coded integer values. It is preferable to use standard shortcuts where possible. See the Keyboard Layout Issues section below for more details. However, for other keys, the use of Shift as an unspecified extra modifier key can lead to confusion for users of an application whose keyboards have different layouts to those used by the developers. In the above examples, the user does not need to hold down the Shift key to activate a shortcut specified with "Ctrl+P". Note that, for letters, the case used in the specification string does not matter. QKeySequence(Qt::CTRL + Qt::Key_P) // deprecated Each key code consists of a single Qt::Key value and zero or more modifiers, such as Qt::ShiftModifier, Qt::ControlModifier, Qt::AltModifier and Qt::MetaModifier.įor example, Ctrl P might be a sequence used as a shortcut for printing a document, and can be specified in any of the following ways: For hard-coded shortcuts, integer key codes can be specified with a combination of values defined by the Qt::Key and Qt::KeyboardModifier enum values.Translations are made in the " QShortcut" context. For custom shortcuts, human-readable strings such as "Ctrl+X" can be used, and these can be translated into the appropriate shortcuts for users of different languages.For standard shortcuts, a standard key can be used to request the platform-specific key sequence associated with each shortcut.Key sequences can be constructed for use as keyboard shortcuts in three different ways: Key sequences are used with QAction objects to specify which keyboard shortcuts can be used to trigger actions. In its most common form, a key sequence describes a combination of keys that must be used together to perform some action. Operator>=(const QKeySequence & other) const Operator(const QKeySequence & other) const Operator!=(const QKeySequence & other) const ToString(QKeySequence::SequenceFormat format = PortableText) const QKeySequence(const QKeySequence & keysequence) QKeySequence(QKeySequence::StandardKey key) ![]() QKeySequence(QKe圜ombination k1, QKe圜ombination k2 = QKe圜ombination::fromCombined(0), QKe圜ombination k3 = QKe圜ombination::fromCombined(0), QKe圜ombination k4 = QKe圜ombination::fromCombined(0)) QKeySequence(int k1, int k2 = 0, int k3 = 0, int k4 = 0) QKeySequence(const QString & key, QKeySequence::SequenceFormat format = NativeText) ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |