aboutsummaryrefslogtreecommitdiffstats
path: root/examples/virtualkeyboard/basic/basic-b2qt.qml
diff options
context:
space:
mode:
Diffstat (limited to 'examples/virtualkeyboard/basic/basic-b2qt.qml')
-rw-r--r--examples/virtualkeyboard/basic/basic-b2qt.qml61
1 files changed, 16 insertions, 45 deletions
diff --git a/examples/virtualkeyboard/basic/basic-b2qt.qml b/examples/virtualkeyboard/basic/basic-b2qt.qml
index 107e7a0c..d23c7464 100644
--- a/examples/virtualkeyboard/basic/basic-b2qt.qml
+++ b/examples/virtualkeyboard/basic/basic-b2qt.qml
@@ -1,38 +1,12 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
// Deliberately imported after QtQuick to avoid missing restoreMode property in Binding. Fix in Qt 6.
-import QtQml 2.14
-import QtQuick.Window 2.2
-import QtQuick.VirtualKeyboard 2.2
-import QtQuick.VirtualKeyboard.Settings 2.2
+import QtQml
+import QtQuick.Window
+import QtQuick.VirtualKeyboard
+import QtQuick.VirtualKeyboard.Settings
import "content"
Item {
@@ -41,15 +15,15 @@ Item {
Item {
id: appContainer
- width: Screen.orientation === Qt.LandscapeOrientation ? parent.width : parent.height
- height: Screen.orientation === Qt.LandscapeOrientation ? parent.height : parent.width
+ width: inLandscapeOrientation ? parent.width : parent.height
+ height: inLandscapeOrientation ? parent.height : parent.width
anchors.centerIn: parent
Basic {
id: virtualKeyboard
anchors.left: parent.left
anchors.top: parent.top
anchors.right: parent.right
- anchors.bottom: parent.bottom
+ anchors.bottom: inputPanel.top
handwritingInputPanelActive: handwritingInputPanel.available && handwritingInputPanel.active
}
@@ -109,12 +83,10 @@ Item {
id: inputPanel
z: 89
y: yPositionWhenHidden
- x: Screen.orientation === Qt.LandscapeOrientation ? 0 : (parent.width-parent.height) / 2
- width: Screen.orientation === Qt.LandscapeOrientation ? parent.width : parent.height
-
- keyboard.shadowInputControl.height: (Screen.orientation === Qt.LandscapeOrientation ? parent.height : parent.width) - keyboard.height
+ x: 0
+ width: parent.width
- property real yPositionWhenHidden: Screen.orientation === Qt.LandscapeOrientation ? parent.height : parent.width + (parent.height-parent.width) / 2
+ property real yPositionWhenHidden: parent.height
states: State {
name: "visible"
@@ -162,9 +134,8 @@ Item {
}
- property bool inLandscapeOrientation: Screen.orientation === Qt.LandscapeOrientation
-
- Screen.orientationUpdateMask: Qt.LandscapeOrientation | Qt.PortraitOrientation
+ property bool inLandscapeOrientation: Screen.primaryOrientation === Qt.LandscapeOrientation ||
+ Screen.primaryOrientation === Qt.InvertedLandscapeOrientation
Binding {
target: appContainer.Window.window !== null ? appContainer.Window.window.contentItem : null