From 7dd81686e8e9ee86624c5bcca10688cfb360dcb8 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Mon, 22 Apr 2013 12:11:37 +0200 Subject: Fix QKeySequence::toString() returning gibberish for Qt::KeypadModifier This is the patch from the bug report with a few alterations to get it to compile, and also with the GroupSwitchModifier code removed, as this patch just focuses on Qt::KeypadModifier. The problem was determined to be in QKeySequencePrivate::encodeString, which doesn't handle the Qt::KeypadModifier flag. Task-number: QTBUG-4022 Change-Id: Ic981eb8b5cd88c7b36892d3019b8175db4b7b6f2 Reviewed-by: David Faure (KDE) --- src/corelib/global/qnamespace.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/corelib') diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index f130288a24..95d9baafd5 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -138,6 +138,10 @@ public: Q_DECLARE_FLAGS(KeyboardModifiers, KeyboardModifier) //shorter names for shortcuts + // The use of all-caps identifiers has the potential for clashing with + // user-defined or third-party macros. More so when the identifiers are not + // "namespace"-prefixed. This is considered bad practice and is why + // KeypadModifier was not added to the Modifier enum. enum Modifier { META = Qt::MetaModifier, SHIFT = Qt::ShiftModifier, -- cgit v1.2.3