Putting our marquee control on our display.
2 import QtQuick.Controls 1.2
3 import QtQuick.Window 2.1
5 import QtQuick.Layouts 1.1
12 //SystemPalette { id: palette }
17 //This window is our VFD frame
23 //Splash screen type do not have any border which is what we want
24 flags: Qt.SplashScreen
26 //property int timeoutInterval: 41
28 property int timeoutInterval: 33
30 //! [splash-properties]
31 //! [screen-properties]
32 //Here comes some trick to keep our display frame within our app.
33 //This make sure this window follows our app window.
34 x: appWindow.x+appWindow.width-256-13
35 y: appWindow.y+appWindow.height-64-30
37 //! [screen-properties]
38 width: rectangleScreen.width
39 height: rectangleScreen.height
40 property int frameCounter:0;
41 property var startTime:new Date();
45 anchors.centerIn: parent
57 anchors.verticalCenter: parent.verticalCenter
58 anchors.horizontalCenter: parent.horizontalCenter
59 text: "start ------ abcdefghijklmnopqrtaksdjfkdfjklsdjflksdjfklsjadfkljsad;flasjdlfjasdfjldsdfljf---- end"
60 //text: "start ------ end"
81 text: "Time/Frame (ms):"
103 id: labelTimePerFrame
123 interval: frameWindow.timeoutInterval; running: true; repeat: true
124 property bool doFill: true
128 var current = new Date();
129 var milliseconds = (current.getTime() - frameWindow.startTime.getTime());
131 frameWindow.frameCounter++;
132 labelFrameCount.text=frameWindow.frameCounter;
133 labelTime.text=milliseconds/1000;
134 labelTimePerFrame.text=(milliseconds/frameWindow.frameCounter).toFixed(3);
135 labelFps.text=(1000/(milliseconds/frameWindow.frameCounter)).toFixed(0);
137 if (checkBoxDoClear.checked)
142 if (checkBoxRenderToDisplay.checked)
144 if (checkBoxFillAndClearOnly.checked)
146 //Trying to make it a worse case scenario for our frame diff algo
156 if (frameWindow.frameCounter%2)
161 else if (checkBoxOnePixelOnly.checked)
163 display.setPixel(0,0,frameWindow.frameCounter%2);
167 display.renderWindow(frameWindow);
170 if (!checkBoxNoSwapBuffers.checked)
172 display.swapBuffers();
178 frameWindow.timeout();
182 Component.onCompleted: {
194 text: qsTr("Render Window")
196 display.renderWindow(frameWindow);
197 display.swapBuffers();
202 text: qsTr("Reset stats")
204 frameWindow.startTime = new Date();
205 frameWindow.frameCounter = 0;
210 text: qsTr("Run timer")
213 (checked?timer.start():timer.stop())
219 text: qsTr("Do clear")
224 id: checkBoxRenderToDisplay
225 text: qsTr("Render to display")
230 id: checkBoxFillAndClearOnly
231 text: qsTr("Only fill and clear")
236 id: checkBoxNoSwapBuffers
237 text: qsTr("No swap buffers")
242 id: checkBoxOnePixelOnly
243 text: qsTr("One pixel only")
248 text: qsTr("Off-Screen")
250 onCheckedChanged: {display.offScreenMode = checked;}
254 text: qsTr("Frame differencing")
256 onCheckedChanged: {display.frameDifferencing = checked;}
262 border.color: "black"
264 anchors.horizontalCenter: parent.horizontalCenter
266 height: text.height + 10
272 anchors.verticalCenter: parent.verticalCenter
273 anchors.horizontalCenter: parent.horizontalCenter
274 text: "start ------ abcdefghijklmnopqrtaksdjfkdfjklsdjflksdjfklsjadfkljsad;flasjdlfjasdfjldsdfljf---- end"
275 //text: "start ------ end"