aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJarkko Koivikko <jarkko.koivikko@code-q.fi>2021-10-08 08:22:12 +0300
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-10-18 16:57:18 +0000
commitd897a740a81135ca11ef63ab71f7356b46495eb4 (patch)
treebb5ec1ba99fe9f18a43435a21124f15200be02bc
parentb45ad13d0d78929fa058ea2120434fba006fbda8 (diff)
cerence-hwr: Fix compilation with the latest Cerence SDK (v9)
[ChangeLog][Cerence] Added support for the latest Cerence SDK (9.x). Change-Id: I5f90aa06d552a984822e49df56e7c68f8d9c993d Reviewed-by: Jarkko Koivikko <jarkko.koivikko@code-q.fi> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit a9da98162a60c65cc54716c6dacf01dbe96f3571) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/plugins/cerence/cerence-hwr/plugin/t9writeinputmethod.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/plugins/cerence/cerence-hwr/plugin/t9writeinputmethod.cpp b/src/plugins/cerence/cerence-hwr/plugin/t9writeinputmethod.cpp
index 10f2c0dc..d9cbdf11 100644
--- a/src/plugins/cerence/cerence-hwr/plugin/t9writeinputmethod.cpp
+++ b/src/plugins/cerence/cerence-hwr/plugin/t9writeinputmethod.cpp
@@ -800,8 +800,12 @@ public:
#ifdef DECUMA_USE_MULTI_THREAD
// Note: This feature requires T9 Write v8.0.0 or later,
// and feature enabled in the SDK.
+#if CERENCEHANDWRITINGAPIMAJORVERNUM > 28
+ sessionSettings.bUseThreads = 1;
+#else
sessionSettings.nMaxThreads = qMax(QThread::idealThreadCount(), 0);
#endif
+#endif
qCDebug(lcT9Write) << " -> language categories:" << languageCategories;
qCDebug(lcT9Write) << " -> symbol categories:" << symbolCategories;
@@ -1336,9 +1340,7 @@ public:
const int dpi = traceCaptureDeviceInfo.value(QLatin1String("dpi"), 96).toInt();
static const int INSTANT_GESTURE_WIDTH_THRESHOLD_MM = 25;
- static const int INSTANT_GESTURE_HEIGHT_THRESHOLD_MM = 25;
- instantGestureSettings.widthThreshold = static_cast<DECUMA_UINT32>(INSTANT_GESTURE_WIDTH_THRESHOLD_MM / 25.4 * dpi);
- instantGestureSettings.heightThreshold = static_cast<DECUMA_UINT32>(INSTANT_GESTURE_HEIGHT_THRESHOLD_MM / 25.4 * dpi);
+ gestureWidthThreshold = static_cast<DECUMA_UINT32>(INSTANT_GESTURE_WIDTH_THRESHOLD_MM / 25.4 * dpi);
gestureRecognizer.setDpi(dpi);
@@ -1954,7 +1956,7 @@ public:
static const int SWIPE_ANGLE_THRESHOLD = 15; // degrees +-
qreal swipeLength = gesture[QLatin1String("length")].toReal();
- if (swipeLength >= instantGestureSettings.widthThreshold) {
+ if (swipeLength >= gestureWidthThreshold) {
Q_Q(T9WriteInputMethod);
QVirtualKeyboardInputContext *ic = q->inputContext();
@@ -2314,7 +2316,7 @@ public:
T9WriteInputMethod::EngineMode engineMode;
QByteArray currentContext;
DECUMA_SESSION_SETTINGS sessionSettings;
- DECUMA_INSTANT_GESTURE_SETTINGS instantGestureSettings;
+ DECUMA_UINT32 gestureWidthThreshold;
QStringList defaultHwrDbPaths;
QFile hwrDbFile;
QList<DECUMA_UINT32> languageCategories;