making rotated screen work
This commit is contained in:
@@ -2,29 +2,44 @@ import QtQuick
|
|||||||
import QtQuick.VirtualKeyboard
|
import QtQuick.VirtualKeyboard
|
||||||
|
|
||||||
Window {
|
Window {
|
||||||
id: window
|
id: root
|
||||||
width: 640
|
|
||||||
height: 480
|
|
||||||
visible: true
|
visible: true
|
||||||
title: qsTr("Hello World")
|
|
||||||
|
|
||||||
Text {
|
// Container element for rotating
|
||||||
text: "Yo yo what's up"
|
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 {
|
InputPanel {
|
||||||
id: inputPanel
|
id: inputPanel
|
||||||
z: 99
|
z: 99
|
||||||
x: 0
|
x: 0
|
||||||
y: window.height
|
y: root.height
|
||||||
width: window.width
|
width: root.width
|
||||||
|
|
||||||
states: State {
|
states: State {
|
||||||
name: "visible"
|
name: "visible"
|
||||||
when: inputPanel.active
|
when: inputPanel.active
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
target: inputPanel
|
target: inputPanel
|
||||||
y: window.height - inputPanel.height
|
y: root.height - inputPanel.height
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
transitions: Transition {
|
transitions: Transition {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#include <QGuiApplication>
|
#include <QGuiApplication>
|
||||||
#include <QQmlApplicationEngine>
|
#include <QQmlApplicationEngine>
|
||||||
|
#include <QCursor>
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
@@ -7,6 +8,9 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
QGuiApplication app(argc, argv);
|
QGuiApplication app(argc, argv);
|
||||||
|
|
||||||
|
const QCursor cursor(Qt::BlankCursor);
|
||||||
|
app.setOverrideCursor(cursor);
|
||||||
|
|
||||||
QQmlApplicationEngine engine;
|
QQmlApplicationEngine engine;
|
||||||
const QUrl url(u"qrc:/testqtonrpi/Main.qml"_qs);
|
const QUrl url(u"qrc:/testqtonrpi/Main.qml"_qs);
|
||||||
QObject::connect(
|
QObject::connect(
|
||||||
|
|||||||
Reference in New Issue
Block a user