toggle to show keyboard in the right orientation

This commit is contained in:
talksik
2024-02-12 09:14:50 -08:00
parent 0d9da9bb70
commit 6d52731d1f
+14 -8
View File
@@ -1,5 +1,7 @@
import QtQuick import QtQuick
import QtQuick.VirtualKeyboard import QtQuick.VirtualKeyboard
import QtQuick.Controls
import QtQuick.Layouts
Window { Window {
id: root id: root
@@ -14,15 +16,18 @@ Window {
anchors.centerIn: parent anchors.centerIn: parent
// Rotate 90 degrees clockwise around transformOrigin // Rotate 90 degrees clockwise around transformOrigin
rotation: 90 rotation: 90
// The rotated content
ColumnLayout {
id: column
anchors.centerIn: parent
Text { Text {
text: qsTr("Hello World") text: qsTr("Hello World")
anchors.centerIn: parent
} }
MouseArea { RoundButton {
anchors.fill: parent text: "Show keyboard"
onClicked: { onClicked: {
Qt.quit(); inputPanel.active = !inputPanel.active
} }
} }
} }
@@ -31,15 +36,15 @@ Window {
id: inputPanel id: inputPanel
z: 99 z: 99
x: 0 x: 0
y: root.height y: parent.height
width: root.width width: parent.width
states: State { states: State {
name: "visible" name: "visible"
when: inputPanel.active when: inputPanel.active
PropertyChanges { PropertyChanges {
target: inputPanel target: inputPanel
y: root.height - inputPanel.height y: parent.height - inputPanel.height
} }
} }
transitions: Transition { transitions: Transition {
@@ -56,3 +61,4 @@ Window {
} }
} }
} }
}