AU
Size: a a a
МВ
AS
import QtQuick 2.12
import QtQuick.Window 2.12
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.12
import Qt.labs.qmlmodels 1.0
Window {
visible: true
width: 640
height: 480
title: qsTr("Hello World")
QtObject {
id: object
property string name
property int age
}
ListModel {
id: model
ListElement {
objectType: "string"
objectProperty: "name"
}
ListElement {
objectType: "number"
objectProperty: "age"
}
}
DelegateChooser {
id: chooser
role: "objectType"
DelegateChoice {
roleValue: "string"
delegate: TextField {
placeholderText: "Введите строку"
text: object[objectProperty]
onTextChanged: {
object[objectProperty] = text
}
}
}
DelegateChoice {
roleValue: "number"
delegate: TextField {
placeholderText: "Введите число"
text: object[objectProperty]
onTextChanged: {
object[objectProperty] = parseInt(text)
}
}
}
}
ColumnLayout {
anchors.fill: parent
Text {
text: object.name
}
Text {
text: object.age
}
ListView {
model: model
delegate: chooser
Layout.fillWidth: true
Layout.fillHeight: true
}
}
}
Е
AS
AS
Е
AS
AS
AS
m
component LabeledImage: Column {https://bugreports.qt.io/browse/QTBUG-85189
property alias source: image.source
property alias caption: text.text
Image {
id: image
width: 50
height: 50
}
Text {
id: text
font.bold: true
}
}
VK
GK
GS
GS