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

QKeySequence::fromString(s, NativeText) does not work correctly

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P4: Low
    • None
    • 4.8.6, 5.4.0, 5.4.1
    • GUI: Look'n'Feel
    • None
    • Tested on Win7

    Description

      The conversion QKeySequence -> native String -> QKeySequence does not
      work propertly for arrow keys with Japanese Translation. The second QKeySequence does not match the first one. Additionally, it is not possible to recover the PortableText from the resulting QKeySequence (instead it returns the native text).

      This bug is related to the fact that the arrow keys (e.g. "Left") are translated to unicode arrows in the japanese translation.

      example
      QString portableKey = "Left";
      QKeySequence::fromString(portableKey);
      QString nativeKey = portableSeq.toString(QKeySequence::NativeText);  // is a uncode Left arrow (ok so far)
      QKeySequence nativeSeq = QKeySequence::fromString(nativeKey, QKeySequence::NativeText);
      nativeSeq.matches(portableSeq));  // returns 0(NoMatch), expected 2(ExactMatch)
      portableSeq.toString(QKeySequence::PortableText);  // returns "Left" (ok)
      nativeSeq.toString(QKeySequence::PortableText);  // returns the unicode arrow, expected: "Left"
      

      The attachment contains a MWE project showing the bug (possibly you need to adapt the path to the translation file).

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            frederik Frederik Gladhorn
            thoffmann Tim Hoffmann
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes