МВ
Size: a a a
МВ
МВ
ApplicationWindow {
id: root
width: 400
height: 500
visible: true
title: qsTr("Hello World")
Component {
id: testItem
Item {
id: childItem
width: 20
height: 20
}
}
Component.onCompleted: {
for (var k=0; k < root.contentData.length; ++k) console.log(k, root.contentData[k])
}
}
qml: 0 QQmlComponent(0x56325ec7a860)
AS
AS
ApplicationWindow {
id: root
width: 400
height: 500
visible: true
title: qsTr("Hello World")
Component {
id: testItem
Item {
id: childItem
width: 20
height: 20
}
}
Component.onCompleted: {
for (var k=0; k < root.contentData.length; ++k) console.log(k, root.contentData[k])
}
}
qml: 0 QQmlComponent(0x56325ec7a860)
AS
AS
import QtQuick 2.15
import QtQuick.Window 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.12
Window {
width: 640
height: 480
visible: true
title: qsTr("Hello World")
ColumnLayout {
anchors.fill: parent
MyItem {
id: item
Layout.fillWidth: true
Layout.fillHeight: true
}
Button {
text: "test"
Layout.fillWidth: true
onClicked: {
for (var i = 0; i < item.contentData.length; ++i) {
console.log(item.contentData[i])
}
}
}
}
}
AS
МВ
AS
МВ
AS
МВ
AS
МВ
МВ
МВ
AS
import QtQuick 2.15
import QtQuick.Window 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.12
Window {
width: 640
height: 480
visible: true
title: qsTr("Hello World")
property var dummy: null
ColumnLayout {
anchors.fill: parent
MyItem {
id: item
Layout.fillWidth: true
Layout.fillHeight: true
}
Button {
text: "test"
Layout.fillWidth: true
onClicked: {
for (var i = 0; i < item.data.length; ++i) {
console.log(item.data[i])
}
}
}
Loader {
id: loader
sourceComponent: dummy
Layout.fillWidth: true
Layout.fillHeight: true
onLoaded: {
loader.item.color = "black"
console.log("loaded")
}
}
}
Component.onCompleted: {
dummy = item.data[0]
}
}
AS
AS
FS