diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2021-08-19 16:48:54 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2021-08-21 01:28:26 +0200 |
commit | 6c5f996974483f9ed33d941cd5caefb2e025bffa (patch) | |
tree | 51b9a9ee2dc28ce560fddbdf1921048030914c99 /src/plugins/platforms/cocoa/qnsview_complextext.mm | |
parent | 993d8025dc5bec6430e13a2ef838dc5a398e6d79 (diff) |
macOS: Ensure we provide a preedit format for non-attributed strings
The logic was not taking into account that we were always adding
an QInputMethodEvent::Cursor attribute, so we would never hit the
fallback code.
Pick-to: 6.2
Change-Id: I25bd725025152241a55e3fea60444c20e27db4f9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/plugins/platforms/cocoa/qnsview_complextext.mm')
-rw-r--r-- | src/plugins/platforms/cocoa/qnsview_complextext.mm | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/plugins/platforms/cocoa/qnsview_complextext.mm b/src/plugins/platforms/cocoa/qnsview_complextext.mm index 154eded15c..040f65250a 100644 --- a/src/plugins/platforms/cocoa/qnsview_complextext.mm +++ b/src/plugins/platforms/cocoa/qnsview_complextext.mm @@ -159,9 +159,7 @@ } index = effectiveRange.location + effectiveRange.length; } - } - - if (attrs.isEmpty()) { + } else { QTextCharFormat format; format.setFontUnderline(true); attrs<<QInputMethodEvent::Attribute(QInputMethodEvent::TextFormat, |