Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import QtQuick 2.0
- import QtGraphicalEffects 1.0
- Rectangle {
- width: 280
- height: 280
- color: "black"
- Text {
- id: faultyItem
- anchors.centerIn: parent
- color: "red"
- layer.enabled: true
- layer.effect: ShaderEffect {
- fragmentShader: "
- uniform lowp sampler2D source; // this item
- uniform lowp float qt_Opacity; // inherited opacity of this item
- varying highp vec2 qt_TexCoord0;
- void main() {
- lowp vec4 p = texture2D(source, qt_TexCoord0);
- lowp float g = dot(p.xyz, vec3(0.344, 0.5, 0.156));
- gl_FragColor = vec4(g, g, g, p.a) * qt_Opacity;
- }"
- }
- }
- Timer {
- repeat: true
- interval: 1000
- running: true
- property int count: 0
- onTriggered: {
- count = count +1
- faultyItem.text = count
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement