From 0d9da9bb70b8cee7dbbe1ecf3161fef3af04e8eb Mon Sep 17 00:00:00 2001 From: talksik Date: Mon, 12 Feb 2024 09:01:47 -0800 Subject: [PATCH] making rotated screen work --- Main.qml | 33 ++++++++++++++++++++++++--------- main.cpp | 4 ++++ 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/Main.qml b/Main.qml index e10783c..3661ff7 100644 --- a/Main.qml +++ b/Main.qml @@ -2,29 +2,44 @@ import QtQuick import QtQuick.VirtualKeyboard Window { - id: window - width: 640 - height: 480 + id: root visible: true - title: qsTr("Hello World") - Text { - text: "Yo yo what's up" + // Container element for rotating + Rectangle { + id: main + // Swap the width and height of the root item + width: root.height + height: root.width + anchors.centerIn: parent + // Rotate 90 degrees clockwise around transformOrigin + rotation: 90 + // The rotated content + Text { + text: qsTr("Hello World") + anchors.centerIn: parent + } + MouseArea { + anchors.fill: parent + onClicked: { + Qt.quit(); + } + } } InputPanel { id: inputPanel z: 99 x: 0 - y: window.height - width: window.width + y: root.height + width: root.width states: State { name: "visible" when: inputPanel.active PropertyChanges { target: inputPanel - y: window.height - inputPanel.height + y: root.height - inputPanel.height } } transitions: Transition { diff --git a/main.cpp b/main.cpp index 43b814b..206e8e9 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,6 @@ #include #include +#include int main(int argc, char *argv[]) { @@ -7,6 +8,9 @@ int main(int argc, char *argv[]) QGuiApplication app(argc, argv); + const QCursor cursor(Qt::BlankCursor); + app.setOverrideCursor(cursor); + QQmlApplicationEngine engine; const QUrl url(u"qrc:/testqtonrpi/Main.qml"_qs); QObject::connect(