Skip to content

Treat key sequence string as PortableText when parsing

Nicolas Fella requested to merge work/portabletext into master

QKeySequence knows two ways to deal with textual representations of keys: NativeText and PortableText

NativeText allows for translations, e.g Strg+C instead of Ctrl+C in German

stringFromKeys always writes as portable text

keysFromString reads them as native text though

This leads to the same result as using portable text, but it is less efficient since it needs to compare translated variants of the sequence

We know we always read portable text, so we can save some work

QKeySequence(foo) defaults to NativeText, but QKeySequence::fromString(foo) defaults to portable text. Therefore use the latter

Edited by Nicolas Fella

Merge request reports