-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.qml
36 lines (32 loc) · 878 Bytes
/
main.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/****************************************************************************
**
** Copyright (C) 2023 Eduardo Gonzalez Lazo.
** Contact: https://eddytheco.github.io/
**
****************************************************************************/
import QtQuick
import QtQml
import qmlonline
Window {
visible: true
title: qsTr("QML Online")
color: "#161616"
Connections {
target: QmlTextCode
function onCodeChanged() {
box.create(QmlTextCode.code);
}
}
Item {
id: box
anchors.fill: parent
property var userItem: null
function create(textComponent) {
if (userItem) {
userItem.destroy();
}
userItem = Qt.createQmlObject(textComponent, box, "userItem");
}
Component.onCompleted: box.create(QmlTextCode.code)
}
}