From 87efdd8c7f997e16ff5a35a44dce9b967d23f09b Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Tue, 5 Dec 2017 13:45:13 +0100 Subject: Android: Reserve space for the QVarLengthArray, so we can use append MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the QVarLengthArray was initialized with a size then append would add to the end of that. Therefore we need to use reserve to get the desired effect. Task-number: QTBUG-64905 Change-Id: Ia1ebeb26cd31bc5e92bd7f81079506a266b845bf Reviewed-by: Jan Arve Sæther --- src/plugins/platforms/android/androidjniaccessibility.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/plugins/platforms/android') diff --git a/src/plugins/platforms/android/androidjniaccessibility.cpp b/src/plugins/platforms/android/androidjniaccessibility.cpp index a3bc58bb89..309e41bfd6 100644 --- a/src/plugins/platforms/android/androidjniaccessibility.cpp +++ b/src/plugins/platforms/android/androidjniaccessibility.cpp @@ -106,7 +106,8 @@ namespace QtAndroidAccessibility QAccessibleInterface *iface = interfaceFromId(objectId); if (iface && iface->isValid()) { const int childCount = iface->childCount(); - QVarLengthArray ifaceIdArray(childCount); + QVarLengthArray ifaceIdArray; + ifaceIdArray.reserve(childCount); for (int i = 0; i < childCount; ++i) { QAccessibleInterface *child = iface->child(i); if (child && child->isValid()) -- cgit v1.2.3 From 280b8b79c0f8a75bf580c76cf61b43061b842aaa Mon Sep 17 00:00:00 2001 From: BogDan Vatra Date: Tue, 28 Nov 2017 14:56:02 +0200 Subject: Allow the users to disable the text handles The user can set QT_QPA_NO_TEXT_HANDLES to 1 to disable the text handles. Change-Id: I974af4d79c86259288035fe20b6a9d0c6d047af8 Reviewed-by: J-P Nurmi --- src/plugins/platforms/android/qandroidinputcontext.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/plugins/platforms/android') diff --git a/src/plugins/platforms/android/qandroidinputcontext.cpp b/src/plugins/platforms/android/qandroidinputcontext.cpp index 7fa809f3f8..ccc7f06b6b 100644 --- a/src/plugins/platforms/android/qandroidinputcontext.cpp +++ b/src/plugins/platforms/android/qandroidinputcontext.cpp @@ -526,6 +526,10 @@ void QAndroidInputContext::updateCursorPosition() void QAndroidInputContext::updateSelectionHandles() { + static bool noHandles = qEnvironmentVariableIntValue("QT_QPA_NO_TEXT_HANDLES"); + if (noHandles) + return; + auto im = qGuiApp->inputMethod(); if (!m_focusObject || (m_cursorHandleShown == CursorHandleNotShown)) { // Hide the handles -- cgit v1.2.3 From 034e92b0f4f49432e170184fb84e29c315d3f279 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Thu, 14 Dec 2017 13:15:05 +0100 Subject: Android: Set correct input hints when queried through getCursorCapsMode getCursorCapsMode() now matches the Java implementation in QtActivityDelegate.showSoftwareKeyboard() which is given to the Android keyboard on InputConnection creation. The reason we only saw this bug with some Android keyboards was that many keyboards never call getCursorCapsMode and just rely on the initial hints. Task-number: QTBUG-51865 Change-Id: I2aae024d9c77ea14e087e3f51a413d15a684179c Reviewed-by: Paul Olav Tvete Reviewed-by: Christian Stromme --- src/plugins/platforms/android/qandroidinputcontext.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/plugins/platforms/android') diff --git a/src/plugins/platforms/android/qandroidinputcontext.cpp b/src/plugins/platforms/android/qandroidinputcontext.cpp index ccc7f06b6b..fe4c5be4cb 100644 --- a/src/plugins/platforms/android/qandroidinputcontext.cpp +++ b/src/plugins/platforms/android/qandroidinputcontext.cpp @@ -847,11 +847,11 @@ jint QAndroidInputContext::getCursorCapsMode(jint /*reqModes*/) const uint qtInputMethodHints = query->value(Qt::ImHints).toUInt(); - if (qtInputMethodHints & Qt::ImhPreferUppercase) - res = CAP_MODE_SENTENCES; + if (!(qtInputMethodHints & Qt::ImhLowercaseOnly) && !(qtInputMethodHints & Qt::ImhNoAutoUppercase)) + res |= CAP_MODE_SENTENCES; if (qtInputMethodHints & Qt::ImhUppercaseOnly) - res = CAP_MODE_CHARACTERS; + res |= CAP_MODE_CHARACTERS; return res; } -- cgit v1.2.3