summaryrefslogtreecommitdiffstats
path: root/examples/wayland/pure-qml/qml
diff options
context:
space:
mode:
authorJan Arne Petersen <jan.petersen@kdab.com>2015-12-30 00:08:17 +0100
committerGiulio Camuffo <giulio.camuffo@kdab.com>2016-04-18 11:39:14 +0000
commit5444ea50bb2b1b894d5b3c33676f9ef207fdcd1a (patch)
tree72ca3e6b3f6530ffe16795a96a717b5666cd5284 /examples/wayland/pure-qml/qml
parent68f40f95972b857433df424cc16809eebfd77b8f (diff)
Fix text-input support for new API
Update text input support to upstream text-input protocol v2 from wayland-protocols. Remove support for input-method protocol for now. Map text-input protocol on compositor side to the Qt input method API, this allows to use any qt platform input method on compositor side (especially qtvirtualkeyboard). Add support for qtvirtualkeyboard to pure-qml example. Implement all missing functions of the text-input protocol. Change-Id: I597451ff65454a63dff86026b6a8d1ffbe07ce02 Done-with: Zeno Endemann <zeno.endemann@kdab.com> Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
Diffstat (limited to 'examples/wayland/pure-qml/qml')
-rw-r--r--examples/wayland/pure-qml/qml/Keyboard.qml51
-rw-r--r--examples/wayland/pure-qml/qml/Screen.qml4
-rw-r--r--examples/wayland/pure-qml/qml/main.qml5
3 files changed, 60 insertions, 0 deletions
diff --git a/examples/wayland/pure-qml/qml/Keyboard.qml b/examples/wayland/pure-qml/qml/Keyboard.qml
new file mode 100644
index 000000000..37bece9e2
--- /dev/null
+++ b/examples/wayland/pure-qml/qml/Keyboard.qml
@@ -0,0 +1,51 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.5
+import QtQuick.Enterprise.VirtualKeyboard 2.0
+
+InputPanel {
+ id: inputPanel
+ visible: active
+ y: active ? parent.height - inputPanel.height : parent.height
+ anchors.left: parent.left
+ anchors.right: parent.right
+}
+
diff --git a/examples/wayland/pure-qml/qml/Screen.qml b/examples/wayland/pure-qml/qml/Screen.qml
index c5df10e5f..0d6c93adc 100644
--- a/examples/wayland/pure-qml/qml/Screen.qml
+++ b/examples/wayland/pure-qml/qml/Screen.qml
@@ -66,6 +66,10 @@ WaylandOutput {
source: "qrc:/images/background.jpg"
smooth: true
}
+ Loader {
+ anchors.fill: parent
+ source: "Keyboard.qml"
+ }
WaylandCursorItem {
id: cursor
inputEventsEnabled: false
diff --git a/examples/wayland/pure-qml/qml/main.qml b/examples/wayland/pure-qml/qml/main.qml
index a8a3985de..bc9f29f39 100644
--- a/examples/wayland/pure-qml/qml/main.qml
+++ b/examples/wayland/pure-qml/qml/main.qml
@@ -73,6 +73,11 @@ WaylandCompositor {
Component.onCompleted: {
initialize();
}
+ },
+ TextInputManager {
+ Component.onCompleted: {
+ initialize();
+ }
}
]