AS
Size: a a a
AS
AS
AS
import ControlImpl
но чтобы этот ControlImpl
не болтался в отдельном файле и его можно было бы написать в текущем, и он не экспортировался из текущего модуля?
Item {
Component {
id: controlImpl
Item {
}
}
}
?AS
ControlImpl {
...
}
Item {
ControlImpl {... }
ControlImpl {... }
}
Window {
width: 640
height: 480
visible: true
title: qsTr("Hello World")
Component {
id: controlImpl
Rectangle {
width: 100
height: 20
}
}
ColumnLayout {
anchors.fill: parent
Loader {
sourceComponent: controlImpl
onLoaded: item.color = "red"
}
Loader {
sourceComponent: controlImpl
onLoaded: item.color = "green"
}
}
}
AS
AS
AS
AS
AS
import QtQuick 2.0
import QtQuick.Layouts 1.12
Item {
Component {
id: controlImpl
Rectangle {
width: 100
height: 20
}
}
ColumnLayout {
anchors.fill: parent
Loader {
sourceComponent: controlImpl
onLoaded: item.color = "red"
Layout.fillWidth: true
Layout.fillHeight: true
}
Loader {
sourceComponent: controlImpl
onLoaded: item.color = "green"
Layout.fillWidth: true
Layout.fillHeight: true
}
}
}
import QtQuick 2.15
import QtQuick.Window 2.15
import QtQuick.Layouts 1.12
Window {
width: 640
height: 480
visible: true
title: qsTr("Hello World")
MyItem {
anchors.fill: parent
}
}
AS
AS
AS
AS
МВ
AS