aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJarkko Koivikko <jarkko.koivikko@code-q.fi>2016-11-12 14:38:17 +0200
committerJarkko Koivikko <jarkko.koivikko@code-q.fi>2016-12-19 18:57:59 +0000
commit04a3e74fd2a568db62c7d5eeaab497d02eb73759 (patch)
tree30e3e5e4a3aa07244d98165d826a625260a58f2b
parentb87766345e7089670629b1c75e9c350846849dac (diff)
Optimized QML related to shift state handling
Remove unnecessary QML bindings to optimize performance. Task-number: QTBUG-57082 Change-Id: Ibda52c5ddcc564a7b92dbd7831afd885c344718d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
-rw-r--r--src/virtualkeyboard/content/components/AlternativeKeys.qml5
-rw-r--r--src/virtualkeyboard/content/components/BaseKey.qml3
-rw-r--r--src/virtualkeyboard/content/components/CharacterPreviewBubble.qml3
-rw-r--r--src/virtualkeyboard/content/components/Keyboard.qml3
4 files changed, 7 insertions, 7 deletions
diff --git a/src/virtualkeyboard/content/components/AlternativeKeys.qml b/src/virtualkeyboard/content/components/AlternativeKeys.qml
index 8801099c..48b8643f 100644
--- a/src/virtualkeyboard/content/components/AlternativeKeys.qml
+++ b/src/virtualkeyboard/content/components/AlternativeKeys.qml
@@ -36,7 +36,6 @@ Item {
property alias listView: listView
property int keyCode
property point origin
- property bool uppercased: keyboard.uppercased
signal clicked
z: 1
@@ -86,7 +85,7 @@ Item {
if (active && listView.currentIndex >= 0 && listView.currentIndex < listView.model.count) {
var activeKey = listView.model.get(listView.currentIndex)
InputContext.inputEngine.virtualKeyClick(keyCode, activeKey.text,
- uppercased ? Qt.ShiftModifier : 0)
+ InputContext.shift ? Qt.ShiftModifier : 0)
}
}
@@ -95,7 +94,7 @@ Item {
var alternativeKeys = key.effectiveAlternativeKeys
if (alternativeKeys.length > 0) {
for (var i = 0; i < alternativeKeys.length; i++) {
- listModel.append({ "text": uppercased ? alternativeKeys[i].toUpperCase() : alternativeKeys[i] })
+ listModel.append({ "text": InputContext.shift ? alternativeKeys[i].toUpperCase() : alternativeKeys[i] })
}
listView.width = keyboard.style.alternateKeysListItemWidth * listModel.count
listView.forceLayout()
diff --git a/src/virtualkeyboard/content/components/BaseKey.qml b/src/virtualkeyboard/content/components/BaseKey.qml
index 07989e01..578fcd21 100644
--- a/src/virtualkeyboard/content/components/BaseKey.qml
+++ b/src/virtualkeyboard/content/components/BaseKey.qml
@@ -29,6 +29,7 @@
import QtQuick 2.0
import QtQuick.Layouts 1.0
+import QtQuick.VirtualKeyboard 2.1
/*!
\qmltype BaseKey
@@ -203,7 +204,7 @@ Item {
By default, this property reflects the uppercase status of the keyboard.
*/
- property bool uppercased: keyboard.uppercased && !noModifier
+ property bool uppercased: InputContext.shift && !noModifier
/*! Sets the key panel delegate for the key.
diff --git a/src/virtualkeyboard/content/components/CharacterPreviewBubble.qml b/src/virtualkeyboard/content/components/CharacterPreviewBubble.qml
index 3a7490aa..b2f42c05 100644
--- a/src/virtualkeyboard/content/components/CharacterPreviewBubble.qml
+++ b/src/virtualkeyboard/content/components/CharacterPreviewBubble.qml
@@ -28,6 +28,7 @@
****************************************************************************/
import QtQuick 2.0
+import QtQuick.VirtualKeyboard 2.1
Item {
property bool active
@@ -44,7 +45,7 @@ Item {
onActiveKeyChanged: {
if (activeKey && characterPreview.item !== null) {
- characterPreview.item.text = keyboard.uppercased ? activeKey.text.toUpperCase() : activeKey.text
+ characterPreview.item.text = InputContext.shift ? activeKey.text.toUpperCase() : activeKey.text
width = activeKey.width
height = activeKey.height
var position = keyboard.mapFromItem(activeKey, 0, 0)
diff --git a/src/virtualkeyboard/content/components/Keyboard.qml b/src/virtualkeyboard/content/components/Keyboard.qml
index 6956898f..f948f303 100644
--- a/src/virtualkeyboard/content/components/Keyboard.qml
+++ b/src/virtualkeyboard/content/components/Keyboard.qml
@@ -59,7 +59,6 @@ Item {
return "main"
}
property bool active: Qt.inputMethod.visible
- property bool uppercased: InputContext.shift
property bool handwritingMode
property bool fullScreenHandwritingMode
property bool symbolMode
@@ -635,7 +634,7 @@ Item {
function click(key) {
if (key && key.enabled) {
if (!key.noKeyEvent)
- InputContext.inputEngine.virtualKeyClick(key.key, keyboard.uppercased ? key.text.toUpperCase() : key.text, keyboard.uppercased ? Qt.ShiftModifier : 0)
+ InputContext.inputEngine.virtualKeyClick(key.key, InputContext.shift ? key.text.toUpperCase() : key.text, InputContext.shift ? Qt.ShiftModifier : 0)
key.clicked()
}
}