57 lines
1.1 KiB
QML
57 lines
1.1 KiB
QML
import QtQuick 2.12
|
|
import QtQuick.Window 2.12
|
|
import QtQuick.Controls 2.3
|
|
import be.mindgoo.tools 0.1
|
|
|
|
Window {
|
|
id: rootwin
|
|
width: 1920
|
|
height: 1080
|
|
visible: true
|
|
|
|
property var elements: 0
|
|
|
|
FrequencyMonitor {
|
|
id: monitor
|
|
refreshPeriod: 500
|
|
}
|
|
|
|
function doSomething(){
|
|
rootwin.elements++
|
|
var component = Qt.createComponent("Rect.qml");
|
|
var rect = component.createObject(rootwin,{"x":0,"y":0});
|
|
if(rect !== null ) {
|
|
rect.name = "Test";
|
|
rect.x = Math.floor(Math.random() * 100 );
|
|
rect.y = Math.floor(Math.random() * 100 );
|
|
}
|
|
}
|
|
Button{
|
|
id: doBtn
|
|
text: "do"
|
|
x: 20
|
|
y: 1000
|
|
onClicked: rootwin.doSomething()
|
|
}
|
|
|
|
Text {
|
|
id: fpsCounter
|
|
x: 200
|
|
y: 1000
|
|
text: "FPS: " + monitor.fps
|
|
}
|
|
|
|
Text {
|
|
id: elementsCounter
|
|
x: 300
|
|
y: 1000
|
|
text: "Elements: " + rootwin.elements
|
|
}
|
|
}
|
|
|
|
/*##^##
|
|
Designer {
|
|
D{i:0;formeditorZoom:2}
|
|
}
|
|
##^##*/
|