sl@0: import QtQuick 2.2 sl@0: import QtQuick.Controls 1.2 sl@15: import QtQuick.Window 2.1 sl@15: import MiniDisplay 1.0 sl@15: import QtQuick.Layouts 1.1 sl@15: sl@0: sl@0: Item { sl@15: //width: 100 sl@15: //height: 62 sl@0: //SystemPalette { id: palette } sl@0: clip: true sl@15: //anchors.fill:parent sl@0: sl@15: sl@15: sl@15: Window { sl@15: //parent: appWindow sl@15: id: splash sl@15: color: "transparent" sl@15: title: "Splash Window" sl@15: modality: Qt.NonModal sl@15: flags: Qt.SplashScreen sl@15: property int timeoutInterval: 41 sl@15: signal timeout sl@15: //! [splash-properties] sl@15: //! [screen-properties] sl@15: x: (Screen.width - rectangleScreen.width) / 2 sl@15: y: (Screen.height - rectangleScreen.height) / 2 sl@15: //! [screen-properties] sl@15: width: rectangleScreen.width sl@15: height: rectangleScreen.height sl@15: property int frameCounter:0; sl@15: property var startTime:new Date(); sl@15: sl@15: Rectangle { sl@15: id: rectangleScreen sl@15: anchors.centerIn: parent sl@15: width: 256 sl@15: height: 64 sl@15: color: "white" sl@15: border.width:1 sl@15: border.color: "black" sl@15: smooth: false sl@15: } sl@15: sl@15: ColumnLayout { sl@15: anchors.fill:parent sl@15: anchors.margins: 6 sl@15: spacing: 4 sl@15: sl@15: Label { sl@15: id: labelFrameCount sl@15: //anchors.centerIn: parent sl@15: text: "Frame Count" sl@15: antialiasing: false sl@15: } sl@15: sl@15: Label { sl@15: id: labelTime sl@15: //anchors.centerIn: parent sl@15: text: "Time" sl@15: antialiasing: false sl@15: } sl@15: sl@15: } sl@15: sl@15: sl@15: sl@15: sl@15: sl@15: //! [timer] sl@15: Timer { sl@15: interval: splash.timeoutInterval; running: true; repeat: true sl@15: onTriggered: { sl@15: //visible = false sl@15: sl@15: var current = new Date(); sl@15: var seconds = (current.getTime() - splash.startTime.getTime())/1000; sl@15: sl@15: splash.frameCounter++; sl@15: labelFrameCount.text=splash.frameCounter; sl@15: labelTime.text=seconds; sl@15: display.renderWindow(splash); sl@15: display.swapBuffers(); sl@15: splash.timeout() sl@15: } sl@15: } sl@15: //! [timer] sl@15: Component.onCompleted: { sl@15: visible = true sl@15: } sl@15: sl@15: } sl@15: sl@15: Column { sl@15: anchors.fill: parent sl@15: anchors.margins: 8 sl@15: spacing: 8 sl@15: sl@15: Button { sl@15: text: qsTr("Render Window") sl@15: onClicked: { sl@15: display.renderWindow(splash); sl@15: display.swapBuffers(); sl@15: } sl@15: } sl@15: } sl@0: }