2019-02-15 12:07:29 +01:00
|
|
|
import QtQuick 2.12
|
2018-04-18 18:39:25 +02:00
|
|
|
import QtQuick.Controls 2.3
|
2018-03-08 22:03:05 +01:00
|
|
|
|
2019-03-27 18:38:36 +01:00
|
|
|
import net.aimber.screenplaysdk 1.0
|
|
|
|
|
2018-10-26 19:28:40 +02:00
|
|
|
Item {
|
2018-03-08 22:03:05 +01:00
|
|
|
id: mainWindow
|
|
|
|
visible: true
|
2018-10-26 19:28:40 +02:00
|
|
|
anchors.fill: parent
|
|
|
|
|
|
|
|
Rectangle {
|
2018-11-24 14:28:02 +01:00
|
|
|
id: bgColor
|
2018-10-26 19:28:40 +02:00
|
|
|
anchors.fill: parent
|
|
|
|
color: "white"
|
|
|
|
//color: "#1A1F22"
|
|
|
|
opacity: .15
|
|
|
|
}
|
|
|
|
|
|
|
|
Image {
|
|
|
|
id: bg
|
|
|
|
source: "qrc:/assets/image/noisy-texture-3.png"
|
|
|
|
anchors.fill: parent
|
|
|
|
opacity: .05
|
|
|
|
fillMode: Image.Tile
|
|
|
|
}
|
2019-03-27 18:38:36 +01:00
|
|
|
Loader {
|
|
|
|
id: loader
|
|
|
|
anchors.fill: parent
|
|
|
|
asynchronous: true
|
|
|
|
source: {
|
|
|
|
Qt.resolvedUrl(window.sourcePath)
|
|
|
|
}
|
|
|
|
|
|
|
|
onStatusChanged: {
|
|
|
|
if (loader.status === Loader.Ready) {
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-10-26 19:28:40 +02:00
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
id: mouseArea
|
|
|
|
anchors.fill: parent
|
|
|
|
|
|
|
|
onPressed: {
|
2019-03-27 18:38:36 +01:00
|
|
|
window.setClickPos(Qt.point(mouse.x, mouse.y))
|
2018-10-26 19:28:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
onPositionChanged: {
|
2019-03-27 18:38:36 +01:00
|
|
|
window.setPos(mouse.x, mouse.y)
|
2018-10-26 19:28:40 +02:00
|
|
|
}
|
2019-03-27 18:38:36 +01:00
|
|
|
onClicked: {
|
|
|
|
|
|
|
|
if (mouse.button === Qt.RightButton) {
|
|
|
|
contextMenu.popup()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Menu {
|
|
|
|
id: contextMenu
|
|
|
|
|
|
|
|
MenuItem {
|
|
|
|
text: qsTr("Close Widget")
|
|
|
|
onClicked: {
|
|
|
|
Qt.quit()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-03-21 18:56:58 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
Connections {
|
2019-03-27 18:38:36 +01:00
|
|
|
target: window
|
2018-03-21 18:56:58 +01:00
|
|
|
|
2018-11-24 14:28:02 +01:00
|
|
|
|
|
|
|
onQmlSceneValueReceived: {
|
2019-02-15 12:07:29 +01:00
|
|
|
var obj2 = 'import QtQuick 2.12; Item {Component.onCompleted: loader.item.'
|
2018-11-24 14:28:02 +01:00
|
|
|
+ key + ' = ' + value + '; }'
|
|
|
|
var newObject = Qt.createQmlObject(obj2.toString(), root, "err")
|
|
|
|
newObject.destroy(10000)
|
|
|
|
}
|
2018-03-21 18:56:58 +01:00
|
|
|
}
|
|
|
|
|
2018-03-23 14:49:52 +01:00
|
|
|
|
2018-03-08 22:03:05 +01:00
|
|
|
}
|