What is styleData in Dashboard example?
-
hi, everyone. I am new to QML, and learn QML through its example.
When I look through the Dashboard example, I find there is a variate named StyleData which I can not find its declaration.//dashboard.qml line 140 style: IconGaugeStyle { id: tempGaugeStyle icon: "qrc:/images/temperature-icon.png" maxWarningColor: Qt.rgba(0.5, 0, 0, 1) tickmarkLabel: Text { color: "white" visible: styleData.value === 0 || styleData.value === 1 font.pixelSize: tempGaugeStyle.toPixels(0.225) text: styleData.value === 0 ? "C" : (styleData.value === 1 ? "H" : "") } ...... }When i change the code into the follwo, it doesn`t work well .
text: test1(styleData.value) function test1(datas){ if(datas===0) return "E" else if(datas===0.25) return "M" else if(datas===1) return "F" }the gauge will not show these letters.
So, I want to ask what is the styleData and What should I do to use it. -
hi, everyone. I am new to QML, and learn QML through its example.
When I look through the Dashboard example, I find there is a variate named StyleData which I can not find its declaration.//dashboard.qml line 140 style: IconGaugeStyle { id: tempGaugeStyle icon: "qrc:/images/temperature-icon.png" maxWarningColor: Qt.rgba(0.5, 0, 0, 1) tickmarkLabel: Text { color: "white" visible: styleData.value === 0 || styleData.value === 1 font.pixelSize: tempGaugeStyle.toPixels(0.225) text: styleData.value === 0 ? "C" : (styleData.value === 1 ? "H" : "") } ...... }When i change the code into the follwo, it doesn`t work well .
text: test1(styleData.value) function test1(datas){ if(datas===0) return "E" else if(datas===0.25) return "M" else if(datas===1) return "F" }the gauge will not show these letters.
So, I want to ask what is the styleData and What should I do to use it. -
H HolyHigh has marked this topic as solved on