mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 01:00:44 +02:00
slot function in QML
This commit is contained in:
parent
656ddfe287
commit
7e1b06efdc
1 changed files with 8 additions and 3 deletions
|
@ -5,11 +5,16 @@ Item {
|
||||||
id: tablet
|
id: tablet
|
||||||
objectName: "tablet"
|
objectName: "tablet"
|
||||||
|
|
||||||
property double miclevel: 0.8
|
property double micLevel: 0.8
|
||||||
|
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: parent.height
|
height: parent.height
|
||||||
|
|
||||||
|
// called by C++ code to keep mic level display bar UI updated
|
||||||
|
function setMicLevel(newMicLevel) {
|
||||||
|
tablet.micLevel = newMicLevel;
|
||||||
|
}
|
||||||
|
|
||||||
// used to look up a button by its uuid
|
// used to look up a button by its uuid
|
||||||
function findButtonIndex(uuid) {
|
function findButtonIndex(uuid) {
|
||||||
if (!uuid) {
|
if (!uuid) {
|
||||||
|
@ -101,7 +106,7 @@ Item {
|
||||||
}
|
}
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: audioBarMask
|
id: audioBarMask
|
||||||
width: parent.width * tablet.miclevel
|
width: parent.width * tablet.micLevel
|
||||||
color: "#333333"
|
color: "#333333"
|
||||||
radius: 5
|
radius: 5
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
|
@ -205,7 +210,7 @@ Item {
|
||||||
|
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
target: tablet
|
target: tablet
|
||||||
miclevel: 0
|
micLevel: 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in a new issue