# HG changeset patch # User sl # Date 1401651269 -7200 # Node ID 783a937d3eb3b55d91c896aa676b5eaf65832399 # Parent 1f607fa8542ff0a499bd1b4c1f8b280966e342f7 Code cleaning and comments in our test tab. diff -r 1f607fa8542f -r 783a937d3eb3 TestsTab.qml --- a/TestsTab.qml Sun Jun 01 21:15:33 2014 +0200 +++ b/TestsTab.qml Sun Jun 01 21:34:29 2014 +0200 @@ -16,11 +16,11 @@ //This window is our VFD frame Window { - //parent: appWindow - id: splash + id: frameWindow color: "transparent" - title: "Splash Window" + title: "VFD Window" modality: Qt.NonModal + //Splash screen type do not have any border which is what we want flags: Qt.SplashScreen //24 FPS //property int timeoutInterval: 41 @@ -29,8 +29,8 @@ signal timeout //! [splash-properties] //! [screen-properties] - //x: (Screen.width - rectangleScreen.width) / 2 - //y: (Screen.height - rectangleScreen.height) / 2 + //Here comes some trick to keep our display frame within our app. + //This make sure this window follows our app window. x: appWindow.x+appWindow.width-256-13 y: appWindow.y+appWindow.height-64-30 @@ -110,19 +110,19 @@ //! [timer] Timer { id: timer - interval: splash.timeoutInterval; running: true; repeat: true + interval: frameWindow.timeoutInterval; running: true; repeat: true property bool doFill: true onTriggered: { //visible = false var current = new Date(); - var milliseconds = (current.getTime() - splash.startTime.getTime()); + var milliseconds = (current.getTime() - frameWindow.startTime.getTime()); - splash.frameCounter++; - labelFrameCount.text=splash.frameCounter; + frameWindow.frameCounter++; + labelFrameCount.text=frameWindow.frameCounter; labelTime.text=milliseconds/1000; - labelTimePerFrame.text=(milliseconds/splash.frameCounter).toFixed(3); - labelFps.text=(1000/(milliseconds/splash.frameCounter)).toFixed(0); + labelTimePerFrame.text=(milliseconds/frameWindow.frameCounter).toFixed(3); + labelFps.text=(1000/(milliseconds/frameWindow.frameCounter)).toFixed(0); if (checkBoxDoClear.checked) { @@ -143,18 +143,18 @@ display.clear(); } - if (splash.frameCounter%2) + if (frameWindow.frameCounter%2) { doFill=!doFill; } } else if (checkBoxOnePixelOnly.checked) { - display.setPixel(0,0,splash.frameCounter%2); + display.setPixel(0,0,frameWindow.frameCounter%2); } else { - display.renderWindow(splash); + display.renderWindow(frameWindow); } if (!checkBoxNoSwapBuffers.checked) @@ -164,9 +164,8 @@ } - - - splash.timeout(); + //Signal our timeout + frameWindow.timeout(); } } //! [timer] @@ -184,7 +183,7 @@ Button { text: qsTr("Render Window") onClicked: { - display.renderWindow(splash); + display.renderWindow(frameWindow); display.swapBuffers(); } } @@ -192,8 +191,8 @@ Button { text: qsTr("Reset stats") onClicked: { - splash.startTime = new Date(); - splash.frameCounter = 0; + frameWindow.startTime = new Date(); + frameWindow.frameCounter = 0; } }