diff options
author | Jan Arve Sæther <[email protected]> | 2025-01-29 09:54:20 +0100 |
---|---|---|
committer | Jan Arve Sæther <[email protected]> | 2025-02-07 18:53:32 +0100 |
commit | f06dd091696fed5b47a1bb071a8d5c28abb5c8a2 (patch) | |
tree | f4a7705e400e87b25bc4f90a09b4b92bfbb31e7e /src/gui/kernel/qkeysequence.cpp | |
parent | 407a98d94fb05780f30e77463fb2bd535041a044 (diff) |
doc: QKeySequence cannot be cast to a QString any longer
bf805455d40b4445f61321439d529cd85cb6bc65 deprecated the QString()
operator in Qt5. Later dccf28b7c344822b7459635099ebe3abdf5fd107 and
2eee9e6fcf9b70681c5d9202d1509d176e48fc31 attempted to remove it
entirely, but a reference to it still remained.
This change also removes the detailed documentation for toString() in
the same paragraph, which previously stated that it generates strings
for use in menus. However, this is not always the case due to
toString(QKeySequence::PortableText). The differences between the two
serialization methods are already well-documented in the toString()
documentation.
Pick-to: 6.9
Change-Id: I42dbb353bc56354f37b8fc22170f8e588eb97176
Reviewed-by: Richard Moe Gustavsen <[email protected]>
Diffstat (limited to 'src/gui/kernel/qkeysequence.cpp')
-rw-r--r-- | src/gui/kernel/qkeysequence.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp index 7e78ac5b08d..0ae55764b00 100644 --- a/src/gui/kernel/qkeysequence.cpp +++ b/src/gui/kernel/qkeysequence.cpp @@ -189,11 +189,8 @@ void Q_GUI_EXPORT qt_set_sequence_auto_mnemonic(bool b) { qt_sequence_no_mnemoni When creating key sequences for non-standard shortcuts, you should use human-readable strings in preference to hard-coded integer values. - QKeySequence objects can be cast to a QString to obtain a human-readable - translated version of the sequence. Similarly, the toString() function - produces human-readable strings for use in menus. On Apple platforms, the - appropriate symbols are used to describe keyboard shortcuts using special - keys on the Macintosh keyboard. + QKeySequence object can be serialized to human-readable strings with the + toString() function. An alternative way to specify hard-coded key codes is to use the Unicode code point of the character; for example, 'A' gives the same key sequence |