Thank you for the hint but I already tried that. As you can see above the visibility is already set to false. There is another shader in the code and I added an active property here as well that should control the visibility:
ShaderEffect {
id: effectItem
width: screenWidth * root.ledWidth
height: screenHeight * root.ledHeight
anchors.centerIn: parent
smooth: false
visible: root.active
property real screenWidth: Math.floor(root.width / root.ledWidth)
property real screenHeight: Math.floor(root.height / root.ledHeight)
property var source: effectSource
property var sledOn: Image { source: "qrc:/images/led_on2.png"; sourceSize.width: root.ledWidth; sourceSize.height: root.ledHeight; visible: false }
property var sledOff: Image { source: "qrc:/images/led_off2.png"; sourceSize.width: root.ledWidth; sourceSize.height: root.ledHeight; visible: false }
property point screenSize: Qt.point(screenWidth, screenHeight)
property alias ledColor: root.ledColor
property real useSourceColors: root.useSourceColors ? 1.0 : 0.0
property alias threshold: root.threshold
fragmentShader: "
varying highp vec2 qt_TexCoord0;
uniform lowp float qt_Opacity;
uniform sampler2D source;
uniform sampler2D sledOn;
uniform sampler2D sledOff;
uniform highp vec2 screenSize;
uniform highp vec4 ledColor;
uniform lowp float useSourceColors;
uniform lowp float threshold;
void main() {
highp vec2 cpos = (floor(qt_TexCoord0 * screenSize) + 0.5) / screenSize;
highp vec4 tex = texture2D(source, cpos);
highp vec2 lpos = fract(qt_TexCoord0 * screenSize);
lowp float isOn = step(threshold, tex.r);
highp vec4 pix = mix(texture2D(sledOff, lpos), texture2D(sledOn, lpos), isOn);
highp vec4 color = mix(ledColor, tex, isOn * useSourceColors);
gl_FragColor = pix * color * qt_Opacity;
}"
}
ShaderEffect {
id: effectItem
width: screenWidth * root.ledWidth
height: screenHeight * root.ledHeight
anchors.centerIn: parent
smooth: false
visible: root.active
property real screenWidth: Math.floor(root.width / root.ledWidth)
property real screenHeight: Math.floor(root.height / root.ledHeight)
property var source: effectSource
property var sledOn: Image { source: "qrc:/images/led_on2.png"; sourceSize.width: root.ledWidth; sourceSize.height: root.ledHeight; visible: false }
property var sledOff: Image { source: "qrc:/images/led_off2.png"; sourceSize.width: root.ledWidth; sourceSize.height: root.ledHeight; visible: false }
property point screenSize: Qt.point(screenWidth, screenHeight)
property alias ledColor: root.ledColor
property real useSourceColors: root.useSourceColors ? 1.0 : 0.0
property alias threshold: root.threshold
fragmentShader: "
varying highp vec2 qt_TexCoord0;
uniform lowp float qt_Opacity;
uniform sampler2D source;
uniform sampler2D sledOn;
uniform sampler2D sledOff;
uniform highp vec2 screenSize;
uniform highp vec4 ledColor;
uniform lowp float useSourceColors;
uniform lowp float threshold;
void main() {
highp vec2 cpos = (floor(qt_TexCoord0 * screenSize) + 0.5) / screenSize;
highp vec4 tex = texture2D(source, cpos);
highp vec2 lpos = fract(qt_TexCoord0 * screenSize);
lowp float isOn = step(threshold, tex.r);
highp vec4 pix = mix(texture2D(sledOff, lpos), texture2D(sledOn, lpos), isOn);
highp vec4 color = mix(ledColor, tex, isOn * useSourceColors);
gl_FragColor = pix * color * qt_Opacity;
}"
}
To copy to clipboard, switch view to plain text mode
But the app is still active and causes several wake-ups when it should be idle. =(
Bookmarks