Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-31416

QKeySequence::toString(NativeText) returns empty string for Qt::KeypadModifier

    XMLWordPrintable

Details

    • 9a7bc0fc1b8d5a8e0ecec05bc91f8018e995006d

    Description

      App to test:

      #include <QApplication>
      #include <QMessageBox>
      int main(int argc, char *argv[])
      {
        QApplication a(argc, argv);
        QMessageBox::information( 0, "",
          QKeySequence(Qt::KeypadModifier).toString(QKeySequence::NativeText) );
        return a.exec();
      }
      

      Suggested fix to src/gui/kernel/qkeysequence.cpp

      Lines below should be outside the else branch. In other words it should be handled also for NativeText:

      if ((key & Qt::KeypadModifier) == Qt::KeypadModifier)
        addKey(s, nativeText ? QCoreApplication::translate("QShortcut", "Numpad") : QString::fromLatin1("Numpad"), format);
      

      Issue is related to QTBUG-4022

      Attachments

        Activity

          People

            mitch_curtis Mitch Curtis
            qtcomsupport Qt Support
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: