diff options
author | Lars Knoll <lars.knoll@qt.io> | 2020-05-27 12:17:46 +0200 |
---|---|---|
committer | Karsten Heimrich <karsten.heimrich@qt.io> | 2020-06-15 15:36:13 +0200 |
commit | 29ad4f8c09d09fc0170f0395eef9503b521ec203 (patch) | |
tree | 123e37b7e5fdbd9c12a2d40f6c95392e4a2d849d /src/plugins/platforms/android/qandroidinputcontext.cpp | |
parent | 9b8d4a9e453b23f7b5b70280ee822f7f3a475261 (diff) |
Port platform plugins to QStringView
Task-number: QTBUG-84319
Change-Id: If409ba1c99f30c7ab32c7cc826c7f303ccf18c1d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/plugins/platforms/android/qandroidinputcontext.cpp')
-rw-r--r-- | src/plugins/platforms/android/qandroidinputcontext.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/platforms/android/qandroidinputcontext.cpp b/src/plugins/platforms/android/qandroidinputcontext.cpp index e78c317863..2fb2b24890 100644 --- a/src/plugins/platforms/android/qandroidinputcontext.cpp +++ b/src/plugins/platforms/android/qandroidinputcontext.cpp @@ -1224,7 +1224,7 @@ jint QAndroidInputContext::getCursorCapsMode(jint /*reqModes*/) QString surroundingText = query->value(Qt::ImSurroundingText).toString(); surroundingText.truncate(localPos); if (focusObjectIsComposing()) - surroundingText += m_composingText.leftRef(m_composingCursor - m_composingTextStart); + surroundingText += QStringView{m_composingText}.left(m_composingCursor - m_composingTextStart); // Add a character to see if it is at the end of the sentence or not QTextBoundaryFinder finder(QTextBoundaryFinder::Sentence, surroundingText + QLatin1Char('A')); finder.setPosition(surroundingText.length()); @@ -1330,7 +1330,7 @@ QString QAndroidInputContext::getTextAfterCursor(jint length, jint /*flags*/) if (focusObjectIsComposing()) { // Controls do not report preedit text, so we have to add it const int cursorPosInsidePreedit = m_composingCursor - m_composingTextStart; - text = m_composingText.midRef(cursorPosInsidePreedit) + text; + text = QStringView{m_composingText}.mid(cursorPosInsidePreedit) + text; } else { // We must not return selected text if there is any QSharedPointer<QInputMethodQueryEvent> query = @@ -1370,7 +1370,7 @@ QString QAndroidInputContext::getTextBeforeCursor(jint length, jint /*flags*/) if (focusObjectIsComposing()) { // Controls do not report preedit text, so we have to add it const int cursorPosInsidePreedit = m_composingCursor - m_composingTextStart; - text += m_composingText.leftRef(cursorPosInsidePreedit); + text += QStringView{m_composingText}.left(cursorPosInsidePreedit); } else { // We must not return selected text if there is any QSharedPointer<QInputMethodQueryEvent> query = @@ -1529,7 +1529,7 @@ jboolean QAndroidInputContext::setComposingRegion(jint start, jint end) const int additionalSuffixLen = after.length() - (text.length() - cursorPos); if (additionalSuffixLen > 0) - text += after.rightRef(additionalSuffixLen); + text += QStringView{after}.right(additionalSuffixLen); } if (start < textOffset) { |