Advertisement
Guest User

Untitled

a guest
Mar 7th, 2017
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
QML 1.11 KB | None | 0 0
  1. import QtQuick 2.0
  2. import QtGraphicalEffects 1.0
  3.  
  4. Item {
  5.     width: 280
  6.     height: 280
  7.  
  8.     Rectangle {
  9.         anchors.fill: parent
  10.         color: "black"
  11.     }
  12.  
  13.     Text {
  14.         id: clock
  15.         anchors.centerIn: parent
  16.         color: "red"
  17.  
  18.         Timer {
  19.             repeat: true
  20.             interval: 1000
  21.             running: true
  22.             property int count: 0
  23.             onTriggered: {
  24.                 count = count +1
  25. //                clock.width = count*2
  26.                 parent.text = count
  27.             }
  28.         }
  29.         layer.enabled: true
  30.         layer.effect: ShaderEffect {
  31.             fragmentShader: "
  32.                uniform lowp sampler2D source; // this item
  33.                uniform lowp float qt_Opacity; // inherited opacity of this item
  34.                varying highp vec2 qt_TexCoord0;
  35.                void main() {
  36.                    lowp vec4 p = texture2D(source, qt_TexCoord0);
  37.                    lowp float g = dot(p.xyz, vec3(0.344, 0.5, 0.156));
  38.                    gl_FragColor = vec4(g, g, g, p.a) * qt_Opacity;
  39.                }"
  40.         }
  41.     }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement