From d98f17d4348ebf52bef7a02c3134d67bbee0a55d Mon Sep 17 00:00:00 2001 From: Gatis Paeglis Date: Wed, 31 Jan 2018 11:33:43 +0100 Subject: [PATCH] doc: improve QPlatformIntegration::possibleKeys() documentation - There is no need to mention qkeymapper, which is an internal implementation detail. - Describe the encoding of int. - Add a note that calling possibleKeys() outside key event handler context is not valid. Change-Id: Ife9b7d1496f04b5a433ed2d56f29c4f01f174441 Reviewed-by: Shawn Rutledge --- src/gui/kernel/qplatformintegration.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/gui/kernel/qplatformintegration.cpp b/src/gui/kernel/qplatformintegration.cpp index 448d670209..866ce08a28 100644 --- a/src/gui/kernel/qplatformintegration.cpp +++ b/src/gui/kernel/qplatformintegration.cpp @@ -446,12 +446,13 @@ Qt::KeyboardModifiers QPlatformIntegration::queryKeyboardModifiers() const /*! Should be used to obtain a list of possible shortcuts for the given key - event. As that needs system functionality it cannot be done in qkeymapper. + event. Shortcuts should be encoded as int(Qt::Key + Qt::KeyboardModifiers). - One example for more than 1 possibility is the key combination of Shift+5. + One example for more than one possibility is the key combination of Shift+5. That one might trigger a shortcut which is set as "Shift+5" as well as one - using %. These combinations depend on the currently set keyboard layout - which cannot be obtained by Qt functionality. + using %. These combinations depend on the currently set keyboard layout. + + \note This function should be called only from key event handlers. */ QList QPlatformIntegration::possibleKeys(const QKeyEvent *) const {