Details
-
Suggestion
-
Resolution: Out of scope
-
P2: Important
-
4.4.0
-
None
Description
QKeySequence can be set with StandardKey (we have a constructor for it). However, later if we have QKeySequence instance we cannot retrieve a StandardKey from it.
The case is QDesigner. People want to set a StandardKey in designer. We cannot just save its key-combination in ui file because it can be a different combination on every platform. We need to generate a code like:
setShortcut(QKeySequence(QKeySequence::Undo));
In this way every platform will get its own key combination for Undo, and we have one ui file for all platforms.
The suggestion is to provide something like:
StandardKey QKeySequence::standardKey() const;
which would return a standard key which was used while creating a QKeysequence with a standard key. If a KeySequence was created with other constructors return UnknownKey.
Rejected:
This suggestion is rejected because, while it is trivial to add such a getter it is conceptually incorrect. A keysequence can only represent a single key binding, where as a standardKey can have several. It is thus difficult to say that a specific keySequence represents a standardKey. In fact as the constructor for QKeySequence says, it will only use the primary key.
Attachments
Issue Links
- is required for
-
QTBUG-1278 designer and QKeySequence::StandardKey
-
- Reported
-