Commit f5da5052 authored by Eskil Abrahamsen-Blomfeldt's avatar Eskil Abrahamsen-Blomfeldt
Browse files

Fix running testscene.qml on Qt 6

This is just a quick band-aid. The VncItem isn't registered for
1.0 in Qt 6, so my update to support Qt 5 broke it. So we have
separate tests until this can be resolved. There might be
something wrong with how we register the type, since it looks
like we need different import versions on Qt 5 and Qt 6.
parent 4cf20f42
import QtQuick 2.15
import QtQuick.Window 2.15
import QtQuick.Controls 2.14
import QtQuickVnc 1.0
Window {
width: 1680
height: 1050
visible: true
property bool rotateRect: true
property bool animateEverything: false
VncItem {
id: grabber
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.left:parent.left
anchors.right: parent.horizontalCenter
// Test coordinate xform
anchors.margins: 50
Rectangle {
id: sourceRect
color: "#ccffcc"
anchors.fill: parent
Rectangle {
anchors.top: parent.top
anchors.right: parent.right
width: 200
height: 100
color: "cyan"
Text {
anchors.centerIn: parent
text: "Active\nconnection"
font.bold: true
font.pixelSize: 24
color: "red"
}
visible: grabber.connectionActive
}
Rectangle {
anchors.centerIn: parent
width: 100
height: 100
color: "red"
NumberAnimation on rotation {
from: 0
to: 90
loops: -1
running: rotateRect
}
}
Rectangle {
id: mouseIndicator
width: 30
height: 30
radius: 15
color: "blue"
}
MouseArea {
anchors.fill: parent
onPositionChanged: (mouse) => {
mouseIndicator.x = mouse.x - 15
mouseIndicator.y = mouse.y - 15
}
onPressed: (mouse) => {
mouseIndicator.color = "orange"
mouseIndicator.x = mouse.x - 15
mouseIndicator.y = mouse.y - 15
console.log("mouse", mouse.x, mouse.y)
}
onReleased: (mouse) => mouseIndicator.color = "blue"
}
Rectangle {
width: 200
height: 50
color: "white"
x: 10
y: 10
TextInput {
anchors.fill: parent
text: "Input..."
selectByMouse: true
}
}
Rectangle {
width: 200
height: 50
color: "white"
x: 10
y: 100
TextField {
anchors.fill: parent
text: "Other input..."
selectByMouse: true
}
}
Rectangle {
id: mouseHandlerArea
color: "#ccccff"
x: 50
y: 150
width: 200
height: 200
Rectangle {
id: mouseIndicator2
width: 20
height: 20
radius: 10
x: ph.point.position.x - radius
y: ph.point.position.y - radius
color: ph.active? "maroon" : "teal"
}
PointHandler {
id: ph
}
}
Rectangle {
id: otherMouseArea
color: "#ffcccc"
x: 50
y: 400
width: 200
height: 200
Rectangle {
id: mouseIndicator3
width: 20
height: 20
radius: 10
color: "lightblue"
}
MouseArea {
hoverEnabled: true
anchors.fill: parent
onEntered: otherMouseArea.color = "#ffaaaa";
onExited: otherMouseArea.color = "#ffcccc";
onPositionChanged: (mouse) => {
mouseIndicator3.x = mouse.x - 10
mouseIndicator3.y = mouse.y - 10
}
onPressed: (mouse) => {
mouseIndicator3.color = "lightgreen"
mouseIndicator3.x = mouse.x - 10
mouseIndicator3.y = mouse.y - 10
console.log("mouse", mouse.x, mouse.y)
}
onReleased: (mouse) => mouseIndicator3.color = "lightblue"
}
}
Rectangle {
id: overlay
visible: animateEverything
anchors.fill: parent
opacity: 0.5
ColorAnimation on color {
from: "#00ff77"
to: "#ff77ff"
duration: 1000
loops: -1
running: animateEverything
}
}
} // sourceRect
}
}
import QtQuick 2.15
import QtQuick.Window 2.15
import QtQuick.Controls 2.14
import QtQuickVnc 1.0
import QtQuick
import QtQuick.Window
import QtQuick.Controls
import QtQuickVnc
Window {
width: 1680
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment