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.

Change-Id: I42dbb353bc56354f37b8fc22170f8e588eb97176
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit f06dd091696fed5b47a1bb071a8d5c28abb5c8a2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Jan Arve Sæther 2025-01-29 09:54:20 +01:00 committed by Qt Cherry-pick Bot
parent e593626788
commit df1786d777

View File

@ -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