-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.qml
executable file
·62 lines (53 loc) · 1.36 KB
/
main.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import QtQuick 2.11
import QtQuick.Window 2.11
import QtQuick.Controls 2.4
import QtQuick.Layouts 1.3
Window {
title: qsTr("OSC")
width: 720
height: 480
visible: true
property string lastMessageReceived: ""
function handleMessageReceived(oscPath, oscArguments) {
console.log("QML-Received OSC: " + oscPath + " " + oscArguments);
lastMessageReceived = oscPath + " " + oscArguments;
}
Connections {
target: oscReceiver
onMessageReceived: {
handleMessageReceived(oscAddress, message);
}
}
ColumnLayout {
RowLayout {
SpinBox {
id: someInt
value: 2
}
Slider {
id: someDouble
value: 3.14159
from: 0.0
to: 5.0
}
TextField {
id: someText
text: "hello"
}
}
Button {
text: "Send OSC"
onClicked: {
oscSender.send("/hello", [someInt.value, someDouble.value, someText.text]);
}
}
RowLayout {
Label {
text: "Received:"
}
Label {
text: lastMessageReceived
}
}
}
}