slot function in QML

This commit is contained in:
Faye Li 2017-01-03 11:15:28 -08:00
parent 656ddfe287
commit 7e1b06efdc

View file

@ -5,11 +5,16 @@ Item {
id: tablet
objectName: "tablet"
property double miclevel: 0.8
property double micLevel: 0.8
width: parent.width
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
function findButtonIndex(uuid) {
if (!uuid) {
@ -101,7 +106,7 @@ Item {
}
Rectangle {
id: audioBarMask
width: parent.width * tablet.miclevel
width: parent.width * tablet.micLevel
color: "#333333"
radius: 5
anchors.bottom: parent.bottom
@ -205,7 +210,7 @@ Item {
PropertyChanges {
target: tablet
miclevel: 0
micLevel: 0
}
}
]