TestsTab.qml
changeset 33 cf5eba52cb1d
parent 32 1c2a7f563019
child 34 f2c87f0cfabe
     1.1 --- a/TestsTab.qml	Wed Jun 04 08:12:37 2014 +0200
     1.2 +++ b/TestsTab.qml	Wed Jun 04 18:30:37 2014 +0200
     1.3 @@ -57,8 +57,7 @@
     1.4              pixelsPerSeconds:50
     1.5              anchors.verticalCenter: parent.verticalCenter
     1.6              anchors.horizontalCenter: parent.horizontalCenter
     1.7 -            text: "start ------ abcdefghijklmnopqrtaksdjfkdfjklsdjflksdjfklsjadfkljsad;flasjdlfjasdfjldsdfljf---- end"
     1.8 -            //text: "start ------ end"
     1.9 +            text: "start ---- ABCDEFGHIJKLMNOPQRSTUVWXYZ ---- end"
    1.10              separator: " | "
    1.11          }
    1.12  
    1.13 @@ -116,9 +115,12 @@
    1.14  
    1.15          }
    1.16  
    1.17 -
    1.18 +        //This function is called from C++ afterAnimating.
    1.19 +        //It means it is called in sync with Qt render loop.
    1.20 +        //Qt render loop tries to run at 60 FPS.
    1.21          function doFrame(frameCount)
    1.22          {
    1.23 +            //Skip every second frame otherwise our UI lags.
    1.24              if (frameCount%2!=0)
    1.25              {
    1.26                  return;
    1.27 @@ -181,23 +183,9 @@
    1.28          }
    1.29  
    1.30  
    1.31 -        //! [timer]
    1.32 -        Timer {
    1.33 -            id: timer
    1.34 -            interval: frameWindow.timeoutInterval; running: false; repeat: true
    1.35 -            property bool doFill: true
    1.36 -            onTriggered: {
    1.37 -                //visible = false
    1.38 -                //frameWindow.doFrame();
    1.39 -
    1.40 -                //Signal our timeout
    1.41 -                //frameWindow.timeout();
    1.42 -            }
    1.43 -        }
    1.44 -        //! [timer]
    1.45          Component.onCompleted: {
    1.46              visible = true;
    1.47 -            display.connectWindow(frameWindow,doFrame);
    1.48 +            display.connectRenderLoop(frameWindow,doFrame);
    1.49          }
    1.50  
    1.51      }
    1.52 @@ -273,27 +261,5 @@
    1.53              checked: true
    1.54              onCheckedChanged: {display.frameDifferencing = checked;}
    1.55          }
    1.56 -
    1.57 -        //
    1.58 -        Rectangle {
    1.59 -            border.width: 1
    1.60 -            border.color: "black"
    1.61 -            color: "white"
    1.62 -            anchors.horizontalCenter: parent.horizontalCenter
    1.63 -            width: 250
    1.64 -            height: text.height + 10
    1.65 -            y:100
    1.66 -            MarqueeText {
    1.67 -                id:text
    1.68 -                width: 200
    1.69 -                pixelsPerSeconds:50
    1.70 -                anchors.verticalCenter: parent.verticalCenter
    1.71 -                anchors.horizontalCenter: parent.horizontalCenter
    1.72 -                text: "start ------ abcdefghijklmnopqrtaksdjfkdfjklsdjflksdjfklsjadfkljsad;flasjdlfjasdfjldsdfljf---- end"
    1.73 -                //text: "start ------ end"
    1.74 -                separator: " | "
    1.75 -            }
    1.76 -        }
    1.77 -
    1.78      }
    1.79  }